/* ------------------------------------------------------------
   view-tool.css — écran d'un outil, direction « Conversation » (lot 07)
   Référence : handoffs/07-ecran-outil-revision/screenshots/D1-mobile.png
   Mise en page de l'atelier grand écran : view-tool-atelier.css
   ------------------------------------------------------------ */

.tool-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0 var(--sp-4);
}

.tool-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 16px 0 12px;
  margin-left: -10px;
}
.tool-header__back {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tool-header h1 { flex: 1; font-size: 15px; font-weight: 600; margin-left: 4px; }
.tool-header__badge {
  height: 22px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--tint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Ouverture (aucun échange) ---------- */
.tool-opening {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
  padding-bottom: var(--sp-5);
}
.tool-opening h2 {
  font-size: 28px;
  max-width: 20em;
}
.tool-opening__starters {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  max-width: 360px;
}
.starter {
  min-height: 40px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

/* ---------- Fil de conversation (mobile) ---------- */
.thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
}

.msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--tint);
  color: var(--ink);
  border-radius: 20px 20px 6px 20px;
  padding: 10px 14px;
  font-size: 15px;
}
.msg-user__meta {
  margin-top: 4px;
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--muted);
}

.msg-assistant { max-width: 92%; }
.msg-assistant__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.msg-assistant__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  flex: none;
}
.msg-assistant__avatar .icon { width: 13px; height: 13px; }
.msg-assistant__card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: 0 0 0 1px var(--line);
  padding: var(--sp-3);
  display: grid;
  gap: var(--sp-2);
}
.msg-note { font-size: 13px; color: var(--muted); }
.msg-assistant__text { font-size: 15px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }

/* ---------- Média d'un résultat (vidéo/image), partagé fil + scène ---------- */
.media-frame {
  position: relative;
  max-width: 200px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}
.media-frame video, .media-frame img { display: block; width: 100%; }
.media-frame__duration {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.tool-result__actions { display: flex; gap: 8px; }
.tool-result__actions .btn { flex: 1; }
.media-audio { width: 100%; }
