:root {
  --fond: #f6f5f9; --carte: #fff; --texte: #1d1b26; --doux: #6b6779; --ligne: #e6e3ee;
  --accent: #6c5fb7; --accent-doux: color-mix(in srgb, var(--accent) 14%, transparent);
  --ok: #1f8a5b; --attente: #b7791f; --rayon: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #15131c; --carte: #1f1c29; --texte: #ece9f5; --doux: #a29db3; --ligne: #312d3f; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.barre { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne); }
.logo { font-weight: 700; }
.qui { color: var(--doux); font-size: .9rem; display: flex; gap: 10px; align-items: center; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.sous { color: var(--doux); margin: 0 0 12px; font-size: .92rem; }
.onglets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.onglets button, .btn { font: inherit; border: 1px solid var(--ligne); background: var(--carte); color: var(--texte);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.onglets button[aria-selected="true"], .btn.plein { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.lien { border: 0; background: none; color: var(--doux); padding: 0; text-decoration: underline; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: .88rem; color: var(--doux); }
.titre { font-weight: 650; }
.images { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; }
.images img { width: 132px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; scroll-snap-align: start; background: var(--accent-doux); flex: none; }
.images:has(img:only-child) img { width: 100%; max-width: 260px; }
details summary { cursor: pointer; color: var(--doux); font-size: .9rem; }
.legende { white-space: pre-wrap; font-size: .92rem; margin: 6px 0 0; }
.etiquette { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--accent-doux); color: var(--texte); }
.etiquette.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.etiquette.attente { background: color-mix(in srgb, var(--attente) 18%, transparent); }
.notes { border-top: 1px dashed var(--ligne); padding-top: 8px; display: grid; gap: 6px; font-size: .9rem; }
.note b { font-weight: 600; }
.note small, .vide, small.doux { color: var(--doux); }
form { display: grid; gap: 8px; }
textarea, input, select { font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--fond); color: var(--texte); }
textarea { min-height: 84px; resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.liste { display: grid; gap: 8px; }
.ligne { background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 10px 12px; }
.ligne p { margin: 4px 0 0; font-size: .92rem; white-space: pre-wrap; }
.lecons { white-space: pre-wrap; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px; font-size: .92rem; }
.connexion { max-width: 380px; margin: 10vh auto; text-align: center; }
.connexion input { text-align: center; font-size: 1.6rem; letter-spacing: .4em; }
.erreur { color: #c0392b; min-height: 1.4em; }
.toast { position: fixed; left: 50%; bottom: 20px; translate: -50% 0; background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 999px; }
