:root {
  --fond: #0b0d12;
  --carte: #12151d;
  --bord: #232838;
  --texte: #e8eaf0;
  --sourd: #9aa3b5;
  --accent: #5b8cff;
  --ok: #4ade80;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}
.carte {
  width: 100%;
  max-width: 560px;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
h1 { margin: 0; font-size: 20px; }
.sous-titre { margin: 4px 0 16px; color: var(--sourd); font-size: 13px; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--sourd); }
.note { font-size: 12px; }
input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--bord);
  background: #0f1219;
  color: var(--texte);
  font-size: 15px;
}
input:focus { outline: 1px solid var(--accent); }
button {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: default; }
.erreur { color: #f87171; font-size: 14px; }
.limites { margin-top: 18px; font-size: 13px; color: var(--sourd); }
.limites summary { cursor: pointer; }
.limites li { margin: 6px 0; }
.barre { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#titre-salon { font-weight: 600; }
.badge {
  font-size: 11px;
  border: 1px solid var(--bord);
  border-radius: 99px;
  padding: 3px 9px;
  color: var(--sourd);
  white-space: nowrap;
}
.statut { color: var(--sourd); font-size: 13px; margin: 8px 0 0; }
.code { font-size: 12px; color: var(--ok); margin: 6px 0 0; word-spacing: 4px; }
#messages {
  flex: 1;
  min-height: 280px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}
.systeme { align-self: center; color: var(--sourd); font-size: 12px; text-align: center; }
.bulle {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.bulle .nom { font-size: 11px; color: var(--sourd); margin-bottom: 2px; }
.bulle.moi { align-self: flex-end; background: #1d3a8a; }
.bulle.pair { align-self: flex-start; background: #1a1f2c; }
#formulaire { display: flex; gap: 8px; align-items: stretch; }
#formulaire #champ-message { margin-top: 0; flex: 1; }
#formulaire button { margin-top: 0; }
#bouton-fichier { padding: 10px 12px; background: #1a1f2c; border: 1px solid var(--bord); font-size: 16px; }
#bouton-fichier:hover:not(:disabled) { border-color: var(--accent); }
.media-corps { display: flex; flex-direction: column; gap: 6px; }
.media-titre { font-size: 12px; color: var(--ok); }
.media-apercu { max-width: 100%; max-height: 240px; border-radius: 8px; }
.bulle audio { width: 240px; max-width: 100%; }
.bulle .statut-msg { font-size: 10px; color: #9aa3b5; margin-top: 3px; align-self: flex-end; }
#table-preuves { width: 100%; border-collapse: collapse; margin-top: 8px; }
#table-preuves td, #table-preuves th {
  padding: 4px 6px; border-bottom: 1px solid var(--bord);
  text-align: left; font-size: 11px;
}
#table-preuves .ok { color: var(--ok); }
#table-preuves .ko { color: #f87171; }
