:root {
  --fond: #f6f4ef;
  --carte: #ffffff;
  --texte: #1d232b;
  --doux: #6b7380;
  --bord: #e2ded4;
  --accent: #1f3a5f;
  --accent-clair: #e3ebf5;
  --actif: #fff3c4;
  --rouge: #b3261e;
  --vert: #2e7d4f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14171c;
    --carte: #1d2128;
    --texte: #e8e6e1;
    --doux: #9aa3ae;
    --bord: #2c323b;
    --accent: #8fb3e0;
    --accent-clair: #233247;
    --actif: #3b3520;
    --rouge: #f08a80;
    --vert: #7fcf9f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, textarea { font: inherit; color: inherit; }
.entete {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--carte); border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 5;
}
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--texte); text-decoration: none; font-size: 18px; }
.marque img { width: 28px; height: 28px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.lien { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
h1 { font-size: 22px; margin: 0 0 12px; line-height: 1.25; }
h2 { font-size: 17px; margin: 0 0 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--carte); border: 0; border-radius: 10px;
  padding: 10px 16px; cursor: pointer; font-weight: 600; text-decoration: none; min-height: 44px;
}
.btn.second { background: var(--accent-clair); color: var(--accent); }
.btn.danger { background: none; color: var(--rouge); border: 1px solid var(--bord); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond);
}
textarea { min-height: 160px; resize: vertical; }
label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 14px; }
.erreur { color: var(--rouge); margin: 8px 0 0; }
.aide { color: var(--doux); font-size: 14px; margin: 6px 0 0; }
.onglets { display: flex; gap: 6px; margin-bottom: 10px; }
.onglets button { flex: 1; border: 1px solid var(--bord); background: var(--fond); border-radius: 8px; padding: 8px; cursor: pointer; }
.onglets button.actif { background: var(--accent-clair); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.zone-fichier {
  display: block; border: 2px dashed var(--bord); border-radius: 12px; padding: 22px 12px; text-align: center; cursor: pointer; color: var(--doux);
}
.zone-fichier.survol { border-color: var(--accent); background: var(--accent-clair); }
.liste { list-style: none; padding: 0; margin: 0; }
.doc {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--texte);
  border: 1px solid var(--bord); background: var(--carte); margin-bottom: 8px;
}
.doc .icone { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-clair); color: var(--accent); display: grid; place-items: center; flex: none; font-size: 18px; }
.doc .infos { flex: 1; min-width: 0; }
.doc .titre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .etat { color: var(--doux); font-size: 14px; }
.barre { height: 4px; background: var(--bord); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.barre > div { height: 100%; background: var(--accent); transition: width .5s; }
.vide { color: var(--doux); text-align: center; padding: 24px 0; }
.lecteur { position: sticky; top: 58px; z-index: 4; }
.temps { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: var(--doux); font-size: 14px; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 6px 0; }
.commandes { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 4px; }
.rond {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--bord); background: var(--fond); cursor: pointer;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.rond.grand { width: 68px; height: 68px; background: var(--accent); color: var(--carte); border: 0; font-size: 26px; }
.vitesses { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.vitesses button { border: 1px solid var(--bord); background: var(--fond); border-radius: 16px; padding: 4px 10px; cursor: pointer; font-size: 14px; }
.vitesses button.actif { background: var(--accent); color: var(--carte); border-color: var(--accent); }
.outils { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chapitres { list-style: none; padding: 0; margin: 0; }
.chapitres button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 4px; cursor: pointer; border-bottom: 1px solid var(--bord); display: flex; gap: 10px; }
.chapitres button span:first-child { color: var(--doux); font-variant-numeric: tabular-nums; min-width: 52px; }
.chapitres button.actif { color: var(--accent); font-weight: 600; }
.texte p { margin: 0 0 4px; }
.texte .seg { cursor: pointer; border-radius: 4px; padding: 1px 2px; }
.texte .seg.actif { background: var(--actif); }
.texte h3 { font-size: 18px; margin: 18px 0 8px; cursor: pointer; }
.texte .bloc { margin-bottom: 12px; }
.suivre { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--doux); font-weight: 400; margin: 0; }
.ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.depot summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.depot summary::-webkit-details-marker { display: none; }
.depot summary::before { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--carte); font-weight: 700; }
.depot[open] summary::before { content: "−"; }
.depot summary h2 { margin: 0; }
.depot[open] summary { margin-bottom: 12px; }
