/* ==========================================================================
   Transcript PV — composants propres à l'application.

   Le système de design (jetons, surfaces, thèmes, densités d'affichage) vient
   de style.css, partagé avec les autres outils du CASU 144. Ce fichier n'ajoute
   que ce qui n'existe nulle part ailleurs : onglets de séance, curseur de
   densité, page de document, attribution des voix, enregistreur.
   ========================================================================== */

/* ── Onglets ──────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 var(--gap-block);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.tabs .tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  top: 1px;
}

.tabs .tab:hover { color: var(--text); background: var(--surface-2); }

.tabs .tab.active {
  color: var(--text-strong);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: inset 0 3px 0 var(--hug-red);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Curseur de densité ───────────────────────────────────────────────── */
.density-bar { margin-bottom: var(--gap-block); }

.density-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.density-head label { margin: 0; font-weight: 700; }

.density-range {
  width: 100%;
  margin: 0.9rem 0 0.35rem;
  accent-color: var(--hug-red);
}

.density-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  font-size: 0.74rem;
  color: var(--faint);
  text-align: center;
}

.density-scale span { line-height: 1.25; }
.density-scale span:first-child { text-align: left; }
.density-scale span:last-child { text-align: right; }
.density-scale span.active { color: var(--text-strong); font-weight: 700; }

.density-cache {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.density-cache .chip {
  min-width: 1.9rem;
  justify-content: center;
  opacity: 0.45;
}

.density-cache .chip-ready {
  opacity: 1;
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-bg);
}

/* ── Page de document ─────────────────────────────────────────────────── */
.doc-page.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

.doc-page h1 {
  font-family: var(--serif);
  font-size: 1.65rem;
  margin: 0 0 0.6rem;
}

.doc-page h2 {
  font-family: var(--serif);
  font-size: 1.22rem;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

.doc-page h3 {
  font-size: 1rem;
  margin: 1.4rem 0 0.35rem;
  color: var(--hug-blue);
}

.doc-page p { margin: 0 0 0.7rem; line-height: var(--prose-leading); }

.doc-page blockquote {
  margin: 0.6rem 0;
  padding: 0.5rem 0.9rem;
  border-left: 3px solid var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.doc-page strong { color: var(--text-strong); }

.doc-page details {
  margin: 0.6rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-inset);
  padding: 0.5rem 0.8rem;
}

.doc-page details summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.doc-page pre {
  overflow-x: auto;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 0.7rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.doc-source {
  width: 100%;
  min-height: 60vh;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  tab-size: 2;
  resize: vertical;
}

.panel-note-busy { border-left: 3px solid var(--hug-blue); background: var(--info-bg); }
.panel-note-err { border-left: 3px solid var(--err); background: var(--err-bg); color: var(--err); }
.panel-note-warn { border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--warn); }
.panel-note-ok { border-left: 3px solid var(--ok); background: var(--ok-bg); color: var(--ok); }

/* ── Verbatim ─────────────────────────────────────────────────────────── */
.vb-line {
  margin: 0 0 0.45rem;
  line-height: 1.7;
  padding-left: 0.2rem;
}

.vb-speaker {
  color: var(--hug-blue);
  margin-right: 0.3rem;
}

.transcript .chip-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  margin-right: 0.5rem;
  cursor: pointer;
}

/* ── Attribution des voix ─────────────────────────────────────────────── */
.speaker-table audio { height: 32px; max-width: 230px; }
.speaker-table code { font-family: var(--mono); font-size: 0.8rem; }
.speaker-select, .roster-pick { min-width: 13rem; }

/* ── Choix des participants ───────────────────────────────────────────── */
.people-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.3rem 0.9rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.3rem 0.1rem;
}

.check-disabled { opacity: 0.55; }

/* ── Enregistreur ─────────────────────────────────────────────────────── */
.seg-wide { width: 100%; margin-bottom: 0.9rem; }
.seg-wide button { flex: 1; }

.rec-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 0.9rem 0;
}

.rec-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ok), var(--warn) 70%, var(--hug-red));
  transition: width 90ms linear;
}

.audio-timer {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Divers ───────────────────────────────────────────────────────────── */
.steps { padding-left: 1.1rem; }
.steps li { margin-bottom: 0.55rem; line-height: 1.65; }

.form-row,
.form-row-3 {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.form-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-row-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

@media print {
  .tabs, .density-bar, .panel-head-actions, .sidebar, .shell-top, .footer { display: none !important; }
  .tab-pane { display: block !important; }
  .doc-page { max-width: none; }
}

/* ── Page Moteurs ─────────────────────────────────────────────────────── */
.host-card .meta-list dd code { font-family: var(--mono); font-size: 0.82rem; }

.advice-box {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--hug-blue);
  background: var(--info-bg);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.advice-box p { margin: 0 0 0.5rem; line-height: 1.55; }
.advice-box p:last-child { margin-bottom: 0; }
.advice-box code { font-family: var(--mono); font-size: 0.82rem; }

.model-table code { font-family: var(--mono); font-size: 0.8rem; }
.model-table tr.row-dim { opacity: 0.45; }

.chip-reco {
  border-color: var(--hug-blue);
  color: var(--hug-blue);
  background: var(--info-bg);
}

.chip-bad {
  border-color: var(--err);
  color: var(--err);
  background: var(--err-bg);
}

.pull-panel {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}

.vram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}

.vram-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem 0.4rem;
  margin: 0 0 0.9rem;
}

.vram-block legend { font-weight: 700; padding: 0 0.4rem; }
