[hidden] { display: none !important; }
:root {
  --fond: #fbf7f2; --carte: #ffffff; --texte: #2b2521; --doux: #8a7f76; --ligne: #ece4da;
  --accent: #c8643b; --accent-c: #f6e2d8; --vert: #4f8a62; --vert-c: #e2f0e6;
  --laurent: #3f7cc4; --laurent-c: #e1ecf8; --caroline: #b0508e; --caroline-c: #f6e1ee; --libre: #9a8f86; --libre-c: #efebe7;
  --rayon: 16px; --ombre: 0 1px 3px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #1c1916; --carte: #27231f; --texte: #f1ebe4; --doux: #a89c91; --ligne: #3a342e; --accent-c: #4a2e22; --vert-c: #24382a;
    --laurent-c: #22344a; --caroline-c: #43263a; --libre-c: #35302b; --ombre: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.fige { overflow: hidden; }
#app { max-width: 720px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 22px 0 8px; } h2 small { color: var(--doux); font-weight: 400; font-size: .85rem; }
h3 { font-size: .95rem; margin: 14px 0 6px; }
.doux { color: var(--doux); } .petit { font-size: .85rem; } .centre { text-align: center; }
.vide { color: var(--doux); font-style: italic; margin: 6px 0; }
.erreur { color: #c0392b; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 10px; width: 100%; }
textarea { resize: vertical; }

.entete { display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 0 6px; }
.entete p { margin: 2px 0 0; font-size: .9rem; }
.rond { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 1.6rem; line-height: 1; box-shadow: var(--ombre); }

.onglets { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--carte); border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.onglets button { flex: 1; max-width: 140px; background: none; border: 0; padding: 8px 2px 10px; font-size: .72rem; color: var(--doux); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.onglets button span { font-size: 1.3rem; }
.onglets button.actif { color: var(--accent); font-weight: 600; }

.progres { background: var(--carte); border-radius: var(--rayon); padding: 12px 14px; box-shadow: var(--ombre); margin-top: 10px; }
.progres p { margin: 8px 0 0; font-size: .92rem; }
.barre { height: 10px; background: var(--ligne); border-radius: 6px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--vert); border-radius: 6px; transition: width .4s; }

.chips { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--ligne); background: var(--carte); border-radius: 20px; padding: 6px 14px; font-size: .9rem; }
.chip.actif { background: var(--accent); border-color: var(--accent); color: #fff; }

.carte { display: flex; gap: 12px; align-items: flex-start; background: var(--carte); border-radius: var(--rayon); padding: 12px; margin: 8px 0; box-shadow: var(--ombre); transition: opacity .3s, transform .3s; }
.carte.retard { border-left: 4px solid #e0a43a; }
.carte.part { opacity: .3; transform: scale(.97); }
.carte .emoji { font-size: 1.6rem; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--accent-c); border-radius: 12px; }
.carte .corps { flex: 1; min-width: 0; }
.carte .titre { font-weight: 600; }
.carte .meta { font-size: .82rem; color: var(--doux); margin-top: 2px; }
.carte .note { font-size: .85rem; margin-top: 4px; white-space: pre-line; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: .75rem; padding: 2px 9px; border-radius: 10px; background: var(--libre-c); color: var(--libre); font-weight: 600; white-space: nowrap; }
.badge.laurent { background: var(--laurent-c); color: var(--laurent); }
.badge.caroline { background: var(--caroline-c); color: var(--caroline); }
.badge.doux { font-weight: 400; }
.actions { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.fait { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--vert); background: var(--vert-c); color: var(--vert); font-size: 1.35rem; font-weight: 700; }
.fait:active { background: var(--vert); color: #fff; }
.mini { background: none; border: 1px solid var(--ligne); border-radius: 10px; min-width: 36px; height: 32px; color: var(--doux); }

details.faits { margin: 20px 0; background: var(--carte); border-radius: var(--rayon); padding: 10px 14px; }
details.faits summary { cursor: pointer; font-weight: 600; }
.ligne-fait { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ligne); font-size: .92rem; flex-wrap: wrap; }
.ligne-fait > span:first-child { flex: 1; min-width: 150px; }
.lien { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 4px; }
.accueil { text-align: center; padding: 20px; background: var(--carte); border-radius: var(--rayon); margin-top: 20px; }

.btn { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; }
.btn.sec { background: var(--accent-c); color: var(--accent); }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.boutons.collant { position: sticky; bottom: 0; background: var(--carte); padding: 10px 0 0; margin-bottom: 0; }

.bloc { background: var(--carte); border-radius: var(--rayon); padding: 12px 14px; box-shadow: var(--ombre); margin: 12px 0; }
.bloc h3:first-child { margin-top: 2px; }
.nav-sem { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.repart { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--ligne); gap: 2px; }
.repart span { min-width: 0; }
.repart .laurent, .barres .laurent, .pt.laurent { background: var(--laurent); }
.repart .caroline, .barres .caroline, .pt.caroline { background: var(--caroline); }
.repart .libre, .pt.libre { background: var(--libre); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin: 6px 0 10px; }
.pt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.jour { background: var(--carte); border-radius: var(--rayon); padding: 8px 14px; margin: 8px 0; }
.jour.auj { outline: 2px solid var(--accent); }
.jour h3 { margin: 4px 0; }
.ligne-sem { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--ligne); font-size: .92rem; align-items: center; }
.ligne-sem.fait { color: var(--doux); width: auto; height: auto; border-radius: 0; border-width: 1px 0 0; background: none; font-size: .92rem; font-weight: 400; }
.graph { display: flex; gap: 6px; align-items: flex-end; height: 140px; }
.graph .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.graph .barres { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; }
.graph .barres span { flex: 1; border-radius: 4px 4px 0 0; min-height: 2px; }
.graph small { font-size: .68rem; color: var(--doux); margin-top: 4px; }

.interr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ligne); }
.interr small { display: block; color: var(--doux); font-size: .8rem; font-weight: 400; }
.interr input[type=checkbox] { width: 46px; height: 26px; flex: none; appearance: none; background: var(--ligne); border-radius: 13px; position: relative; border: 0; padding: 0; transition: background .2s; }
.interr input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; }
.interr input[type=checkbox]:checked { background: var(--vert); }
.interr input[type=checkbox]:checked::after { left: 23px; }
.interr input[type=time] { width: auto; }

.modal { position: fixed; inset: 0; background: rgba(30, 20, 10, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.fenetre { background: var(--carte); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { align-items: center; } .fenetre { border-radius: 20px; } }
.titre-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.titre-f h2 { margin: 0; }
form label { display: block; margin: 12px 0 0; font-weight: 600; font-size: .9rem; }
form label input, form label select, form label textarea { margin-top: 4px; font-weight: 400; }
label.ligne { display: flex; align-items: center; gap: 8px; font-weight: 400; flex-wrap: wrap; }
label.ligne input[type=number] { width: 72px; margin: 0; }
label.ligne input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-b { margin: 0 !important; }
.seg-b input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-b span { display: inline-block; padding: 8px 12px; border: 1px solid var(--ligne); border-radius: 10px; font-weight: 400; }
.seg-b input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-b input:focus-visible + span { outline: 2px solid var(--accent); }
.r { margin-top: 8px; }
.jours { display: flex; gap: 6px; }
.jbtn { margin: 0 !important; }
.jbtn input { position: absolute; opacity: 0; width: 1px; }
.jbtn span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ligne); font-weight: 600; }
.jbtn input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.emojis, .durees { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.emojis button { width: 40px; height: 40px; border: 1px solid transparent; border-radius: 10px; background: none; font-size: 1.3rem; }
.emojis button.actif { border-color: var(--accent); background: var(--accent-c); }
.durees button { border: 1px solid var(--ligne); background: none; border-radius: 10px; padding: 6px 10px; font-weight: 400; }
.durees button.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.deux { display: flex; gap: 10px; } .deux > label { flex: 1; }
.liste-act { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.liste-act button { text-align: left; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 12px; background: none; }
.liste-act .danger { color: #c0392b; }
.cat-l { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--ligne); }
.cat-l label { flex: 1; margin: 0; font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.cat-l label small { display: block; font-size: .8rem; }
.cat-l label input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; }
.cat-l select { width: auto; max-width: 42%; padding: 6px; font-size: .85rem; }
.cat-l.deja { opacity: .45; }

.login { text-align: center; padding-top: 18vh; }
.login .logo { font-size: 4rem; }
.login h1 { margin: 10px 0 4px; }
#gbtn { display: flex; justify-content: center; margin: 26px 0 10px; min-height: 44px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #2b2521; color: #fff; padding: 10px 18px; border-radius: 22px; z-index: 30; max-width: 90vw; text-align: center; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
