:root {
  --fond: #14121f; --carte: #1e1b2e; --carte2: #272339; --bord: #34304a; --texte: #ece9f7; --doux: #a29cbd;
  --accent: #ffb454; --accent-txt: #1a1206; --ok: #5ad19a; --alerte: #ff6b7a; --bleu: #7aa7ff;
  --r: 14px; --bas: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: light) {
  :root { --fond: #f4f2fb; --carte: #ffffff; --carte2: #ece9f7; --bord: #d9d4ec; --texte: #1d1a2b; --doux: #6b6585; --accent: #c77700; --accent-txt: #ffffff; --ok: #12875a; --alerte: #c8283c; --bleu: #2f5fd0; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; }
#app { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(84px + var(--bas)); }
h1 { font-size: 1.5rem; margin: 8px 0 2px; letter-spacing: -.01em; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--doux); margin: 24px 0 8px; font-weight: 700; }
.sous { color: var(--doux); font-size: .92rem; margin: 0 0 8px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.ligne { display: flex; align-items: center; gap: 10px; }
.ligne > .grow { flex: 1; min-width: 0; }
.titre { font-weight: 600; overflow-wrap: anywhere; }
.petit { color: var(--doux); font-size: .85rem; overflow-wrap: anywhere; }
.fait .titre { text-decoration: line-through; color: var(--doux); }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--carte2); color: var(--doux); margin-left: 6px; font-weight: 600; }
.badge.rouge { background: color-mix(in srgb, var(--alerte) 22%, transparent); color: var(--alerte); }
.badge.vert { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge.or { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--bord); background: var(--carte2); border-radius: 10px; padding: 9px 14px; min-height: 44px; }
button.primaire { background: var(--accent); color: var(--accent-txt); border-color: transparent; font-weight: 700; }
button.danger { color: var(--alerte); }
button.lien { border: 0; background: none; color: var(--bleu); padding: 6px 4px; min-height: 36px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { width: 100%; background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: .82rem; color: var(--doux); margin: 12px 0 4px; font-weight: 600; }
.case { width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; }
.case.coche { background: var(--ok); color: #06251a; border-color: transparent; }
.ajout { display: flex; gap: 8px; margin-top: 8px; }
.ajout input { flex: 1; }
nav { position: fixed; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--carte) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--bord); display: flex; padding-bottom: var(--bas); z-index: 5; }
nav button { flex: 1; border: 0; border-radius: 0; background: none; padding: 10px 4px 8px; min-height: 58px; color: var(--doux); font-size: .74rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav button .ico { font-size: 1.35rem; line-height: 1; }
nav button[aria-current="page"] { color: var(--accent); font-weight: 700; }
.modal { position: fixed; inset: 0; background: rgba(5, 4, 12, .66); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.modal > .feuille { background: var(--carte); width: 100%; max-width: 720px; max-height: 92dvh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--bas)); border: 1px solid var(--bord); }
.modal h3 { margin: 0 0 4px; }
.actions { display: flex; gap: 8px; margin-top: 18px; }
.actions .grow { flex: 1; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jours { display: flex; gap: 6px; flex-wrap: wrap; }
.jours label { margin: 0; display: flex; align-items: center; gap: 4px; background: var(--fond); border: 1px solid var(--bord); border-radius: 99px; padding: 6px 12px; color: var(--texte); font-size: .9rem; }
.jours input { width: auto; min-height: 0; }
.interrupteur { width: 52px; height: 30px; min-height: 30px; border-radius: 99px; padding: 0; position: relative; flex: none; background: var(--carte2); }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--doux); transition: transform .15s; }
.interrupteur[aria-checked="true"] { background: var(--ok); border-color: transparent; }
.interrupteur[aria-checked="true"]::after { transform: translateX(22px); background: #06251a; }
.vide { text-align: center; color: var(--doux); padding: 18px 8px; }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.stat svg { grid-column: 1 / -1; width: 100%; height: 56px; }
.valeur { font-size: 1.4rem; font-weight: 800; text-align: right; }
.connexion { min-height: 80dvh; display: grid; align-content: center; gap: 12px; }
.erreur { color: var(--alerte); min-height: 1.4em; font-size: .92rem; }
.bandeau { background: color-mix(in srgb, var(--alerte) 18%, transparent); border: 1px solid var(--alerte); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
[hidden] { display: none !important; }
.recap p { white-space: pre-line; margin: 2px 0 10px; }
