:root {
  --fond: #f1f5f9; --carte: #ffffff; --encre: #0f172a; --encre-2: #475569; --muted: #64748b;
  --ligne: #e2e8f0; --primaire: #0f766e; --primaire-doux: #ccfbf1; --famille: #e2e8f0;
  --ok: #15803d; --ko: #b91c1c; --attente: #b45309;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0b1220; --carte: #111a2b; --encre: #e2e8f0; --encre-2: #cbd5e1; --muted: #94a3b8;
    --ligne: #223049; --primaire: #2dd4bf; --primaire-doux: #134e4a; --famille: #1e293b;
    --ok: #4ade80; --ko: #f87171; --attente: #fbbf24;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
a { color: var(--primaire); }
.chiffres { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.aide { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.barre { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .8rem 1rem; background: var(--carte); border-bottom: 1px solid var(--ligne); }
.marque { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--encre); text-decoration: none; }
.marque small { font-weight: 400; color: var(--muted); }
.point { width: .65rem; height: .65rem; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px #f59e0b33; }
.page { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 1.25rem; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

button, input { font: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--ligne); background: var(--carte); color: var(--encre); padding: .5rem .9rem; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
button.principal { background: var(--primaire); border-color: var(--primaire); color: #fff; font-weight: 600; width: 100%; padding: .7rem; }
button.lien { border: 0; background: none; color: var(--encre-2); padding: .25rem; }
input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--ligne); border-radius: 8px; background: var(--fond); color: var(--encre); }

.connexion { max-width: 24rem; margin: 3rem auto; display: grid; gap: .75rem; }
.connexion form { display: grid; gap: .6rem; margin-top: .5rem; }
.connexion label { font-weight: 600; font-size: .9rem; }
.erreur { margin: 0; padding: .6rem .8rem; border-radius: 8px; color: var(--ko); background: color-mix(in srgb, var(--ko) 10%, var(--carte)); }

.recherche { display: flex; gap: .5rem; flex: 1 1 22rem; max-width: 30rem; }
.recherche button { white-space: nowrap; }

.tableau { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 44rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; }
.extrait { color: var(--encre-2); }
.pastille { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pastille.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--carte)); }
.pastille.ko { color: var(--ko); background: color-mix(in srgb, var(--ko) 12%, var(--carte)); }
.pastille.attente { color: var(--attente); background: color-mix(in srgb, var(--attente) 12%, var(--carte)); }
.vide { text-align: center; }

.retour { text-decoration: none; font-weight: 600; }
.lecteur { position: sticky; top: 0; z-index: 1; margin-bottom: 1.25rem; }
.lecteur audio { width: 100%; }

.conversation { display: flex; flex-direction: column; gap: .6rem; }
.bulle { max-width: min(36rem, 85%); text-align: left; display: grid; gap: .2rem; border: 1px solid var(--ligne); padding: .6rem .85rem; border-radius: 14px; }
.bulle.famille { align-self: flex-start; background: var(--famille); border-bottom-left-radius: 4px; }
.bulle.conseillere { align-self: flex-end; background: var(--primaire-doux); border-bottom-right-radius: 4px; }
.bulle.inconnu { align-self: center; background: var(--carte); }
.bulle.active { outline: 2px solid var(--primaire); }
.qui { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pied { margin-top: 1.5rem; }
