:root {
  --fond: #fbf4ea; --fond-2: #f3e7d6; --carte: #fffaf3;
  --encre: #2e2a22; --encre-douce: #655c4e;
  --terre: #a94e34; --sur-terre: #fff8f1;
  --sauge: #5f7559; --sauge-clair: #dfe6d6;
  --trait: #dccdb6;
  --attente: #8a6200; --attente-fond: #f6e7bd;
  --refus: #8c3030; --refus-fond: #f3d6d2;
  --titre: "Young Serif", Georgia, serif;
  --texte: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1f1b16; --fond-2: #2a241d; --carte: #26211a; --encre: #f3e9da; --encre-douce: #bfb19c;
    --terre: #e39274; --sur-terre: #24160f; --sauge: #a9bd9f; --sauge-clair: #2f3a2b; --trait: #453c30;
    --attente: #efcf7a; --attente-fond: #45380f; --refus: #f0a9a2; --refus-fond: #4a2320; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 1rem; line-height: 1.5; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; margin: 0; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sauge); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 36rem; margin-inline: auto; padding-inline: 16px; padding-top: env(safe-area-inset-top, 0px); padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 1.25rem; }
.haut { position: sticky; top: 0; z-index: 3; background: var(--fond); padding-block: 0.8rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--trait); }
.marque { font-family: var(--titre); font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.demo { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sauge); border: 1.5px dashed var(--sauge); border-radius: 4px; padding: 0.1rem 0.45rem; white-space: nowrap; }

.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--carte); border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom, 0px); }
.onglets div { max-width: 36rem; margin-inline: auto; display: flex; }
.onglets button { flex: 1; border: 0; background: transparent; padding: 0.8rem 0.25rem; font-weight: 700; font-size: 0.86rem; color: var(--encre-douce); cursor: pointer; border-top: 3px solid transparent; }
.onglets button[aria-current="page"] { color: var(--terre); border-top-color: var(--terre); }
.compteur { display: inline-block; min-width: 1.3em; margin-left: 0.25rem; padding: 0 0.3em; border-radius: 999px; background: var(--terre); color: var(--sur-terre); font-size: 0.75rem; }

.sur { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sauge); }
.section { display: flex; flex-direction: column; gap: 0.7rem; }
.doux { color: var(--encre-douce); font-size: 0.93rem; }
.vide { color: var(--encre-douce); font-size: 0.93rem; padding: 0.5rem 0; }

.prochaine { background: var(--terre); color: var(--sur-terre); border-radius: 1.25rem 1.25rem 1.25rem 0.25rem; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.3rem; }
.prochaine .sur { color: var(--sur-terre); opacity: 0.85; }
.prochaine .quand { font-family: var(--titre); font-size: 1.5rem; line-height: 1.15; }

.liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--trait); }
.liste li { display: grid; grid-template-columns: 5.4rem 1fr auto; gap: 0.7rem; align-items: start; padding: 0.7rem 0; border-bottom: 1px solid var(--trait); }
.liste li.simple { grid-template-columns: 1fr auto; }
.liste li > * { min-width: 0; }
.heure { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.93rem; }
.liste strong { display: block; }
.fin-ligne { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.jour-titre { font-family: var(--titre); font-size: 1.05rem; margin-top: 0.6rem; text-transform: capitalize; }
.semaine { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.pastille { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap; background: var(--sauge-clair); color: var(--encre); }
.pastille.attente { background: var(--attente-fond); color: var(--attente); }
.pastille.refus { background: var(--refus-fond); color: var(--refus); }

.note { border-left: 3px solid var(--sauge); padding-left: 0.85rem; display: flex; flex-direction: column; gap: 0.15rem; }
.note .qui { font-size: 0.83rem; color: var(--encre-douce); font-weight: 600; }

.fiche { background: var(--carte); border: 1px solid var(--trait); border-radius: 0.75rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
details.fiche summary { cursor: pointer; font-weight: 700; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.champs label, label.bloc { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.83rem; font-weight: 600; color: var(--encre-douce); min-width: 0; }
.champs .large { grid-column: 1 / -1; }
input, select, textarea { background: var(--fond); border: 1px solid var(--trait); border-radius: 0.5rem; padding: 0.55rem 0.6rem; width: 100%; min-width: 0; font-size: 1rem; }
textarea { min-height: 4.5rem; resize: vertical; }
.bouton { border: 2px solid var(--terre); background: var(--terre); color: var(--sur-terre); border-radius: 999px; padding: 0.6rem 1.1rem; font-weight: 700; cursor: pointer; }
.bouton.discret { background: transparent; color: var(--terre); }
.bouton.petit { padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.lien { border: 0; background: none; padding: 0; color: var(--terre); font-weight: 600; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.erreur { color: var(--refus); background: var(--refus-fond); border-radius: 0.5rem; padding: 0.6rem 0.8rem; font-weight: 600; }
.info { color: var(--encre); background: var(--sauge-clair); border-radius: 0.5rem; padding: 0.6rem 0.8rem; font-weight: 600; }

.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.chiffres div { background: var(--fond-2); border-radius: 0.75rem; padding: 0.7rem 0.8rem; min-width: 0; }
.chiffres b { display: block; font-family: var(--titre); font-weight: 400; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.chiffres span { font-size: 0.8rem; color: var(--encre-douce); }

.contacts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.contacts dt { color: var(--encre-douce); font-weight: 600; }
.contacts dd { margin: 0; overflow-wrap: anywhere; }
.contacts a { color: var(--terre); }

.accueil { padding-top: 12vh; display: flex; flex-direction: column; gap: 1.5rem; }
.accueil .marque { font-size: 1.6rem; }
