/* Disposition : une colonne sur téléphone, cartes d'enfants en grille sur grand écran.
   Chaque enfant a sa couleur, utilisée partout (carte, case cochée, calendrier). */
:root {
  --bg: #F2F3F9;
  --surface: #FFFFFF;
  --surface-2: #E8EAF5;
  --ink: #1A1C3A;
  --muted: #5A5E80;
  --line: #D9DCEB;
  --accent: #3B3FD1;
  --accent-ink: #FFFFFF;
  --c-elykia: #6D45CF;
  --c-djeden: #0B7F7A;
  --c-kaissa: #8F5F00;
  --c-erine: #C42F4D;
  --ok: #1E8E4E;
  --warn: #A25F00;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101227; --surface: #191C38; --surface-2: #232749; --ink: #ECEEFA; --muted: #A2A6CB;
    --line: #2D3159; --accent: #8E92FF; --accent-ink: #101227;
    --c-elykia: #B59CFF; --c-djeden: #4FD3CB; --c-kaissa: #F0C04A; --c-erine: #FF8FA3; --ok: #5CD08A; --warn: #F0B24A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101227; --surface: #191C38; --surface-2: #232749; --ink: #ECEEFA; --muted: #A2A6CB;
  --line: #2D3159; --accent: #8E92FF; --accent-ink: #101227;
  --c-elykia: #B59CFF; --c-djeden: #4FD3CB; --c-kaissa: #F0C04A; --c-erine: #FF8FA3; --ok: #5CD08A; --warn: #F0B24A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px 96px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.wrap.wide { max-width: 1000px; }

/* Pastilles et petites étiquettes */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--ink);
}
.pill.accent { background: var(--accent); color: var(--accent-ink); }
.pill.erine { background: color-mix(in srgb, var(--c-erine) 18%, var(--surface)); color: var(--c-erine); }

/* Barre de jour / de semaine */
.daybar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.daytitle { text-align: center; display: grid; gap: 6px; justify-items: center; min-width: 0; }
.daytitle h1 { font-size: clamp(1.4rem, 5.5vw, 2rem); line-height: 1.1; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center;
}
.iconbtn svg { width: 20px; height: 20px; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Bandeau Erine */
.banner { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: 15px; }
.banner strong { color: var(--ink); }
.banner.on { background: color-mix(in srgb, var(--c-erine) 14%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c-erine) 40%, var(--surface)); }

/* Filtre enfants */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Cartes d'enfants */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.card { --c: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-width: 0; }
.card.elykia { --c: var(--c-elykia); } .card.djeden { --c: var(--c-djeden); }
.card.kaissa { --c: var(--c-kaissa); } .card.erine { --c: var(--c-erine); }
.card > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c);
}
.card h2 { font-size: 1.3rem; } .card h2 small { font-family: var(--font-body); font-size: .8rem; font-weight: 600; opacity: .85; margin-left: 4px; }
.prog { font-weight: 700; font-variant-numeric: tabular-nums; }
.card ul { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; gap: 2px; }
.group { padding-top: 8px; }
.group h3 { font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--c); padding: 0 14px 2px; }
.group.table { margin: 4px 6px 6px; padding: 8px 0 2px; border-radius: 14px; background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.group.table ul { padding-bottom: 4px; }
.task { width: 100%; display: grid; grid-template-columns: 26px 26px 1fr; gap: 8px; align-items: center; text-align: left; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; }
.task:hover { background: var(--surface-2); }
.box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--c); display: grid; place-items: center; }
.box svg { width: 14px; height: 14px; opacity: 0; stroke: var(--surface); }
.task[aria-pressed="true"] .box { background: var(--c); }
.task[aria-pressed="true"] .box svg { opacity: 1; }
.task[aria-pressed="true"] .txt { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ico { font-size: 20px; text-align: center; }
.txt { min-width: 0; overflow-wrap: anywhere; }
.txt em { display: block; font-style: normal; font-size: 13px; color: var(--c); font-weight: 600; }
.task[aria-pressed="true"] .txt em { text-decoration: none; display: block; }

/* Semaine */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table.week { border-collapse: collapse; width: 100%; min-width: 640px; }
.week th, .week td { padding: 10px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.week tr:last-child th, .week tr:last-child td { border-bottom: 0; }
.week thead th { position: sticky; top: 0; font-family: var(--font-display); font-size: 15px; background: var(--surface-2); }
.week thead th.elykia { color: var(--c-elykia); } .week thead th.djeden { color: var(--c-djeden); }
.week thead th.kaissa { color: var(--c-kaissa); } .week thead th.erine { color: var(--c-erine); }
.week tbody th { white-space: nowrap; font-weight: 700; width: 1%; }
.week tbody th .linkbtn { padding: 0; font-size: 15px; }
.week tbody th small { display: block; font-weight: 500; color: var(--muted); }
.week tr.today th, .week tr.today td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.week ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.week li { display: flex; gap: 6px; }
.week li span:first-child { flex: none; }
.week .note { color: var(--muted); font-size: 12.5px; }
.week .away { color: var(--muted); }
.legend { color: var(--muted); font-size: 14px; }

/* Panneaux génériques */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.panel h2 { font-size: 1.2rem; }
.hint { color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }
input[type="date"], input[type="text"] { min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); min-width: 0; max-width: 100%; }
.btn { min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--c-erine); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 9px 14px; min-height: 44px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--c, var(--accent)); }

/* Calendrier de présence d'Erine */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal button { aspect-ratio: 1 / 1; min-height: 40px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); font-variant-numeric: tabular-nums; font-weight: 600; position: relative; }
.cal button.pad { visibility: hidden; }
.cal button.on { background: var(--c-erine); color: var(--surface); }
.cal button.manual::after { content: ""; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); border: 1px solid var(--surface); }
.cal button.off.manual { border: 2px dashed var(--c-erine); background: var(--surface); }
.cal button.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.monthbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.monthbar h3 { font-size: 1.1rem; }
.blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.blocks li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.period { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--surface-2); }

/* Bilan */
table.stats { border-collapse: collapse; width: 100%; min-width: 520px; }
.stats th, .stats td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: 14px; }
.stats th:first-child, .stats td:first-child { text-align: left; font-weight: 700; }
.stats tr:last-child td { border-bottom: 0; }
.stats thead th { background: var(--surface-2); font-size: 13px; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 76px 1fr 44px; gap: 8px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.bar i { display: block; height: 14px; border-radius: 7px; background: var(--c, var(--accent)); min-width: 3px; }
.bar.elykia { --c: var(--c-elykia); } .bar.djeden { --c: var(--c-djeden); } .bar.kaissa { --c: var(--c-kaissa); } .bar.erine { --c: var(--c-erine); }

/* Barre d'onglets */
nav.tabs.n3 { --n: 3; } nav.tabs.n4 { --n: 4; }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
nav.tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; color: var(--muted); font-size: 12.5px; font-weight: 600; border-radius: 12px; }
nav.tabs svg { width: 24px; height: 24px; }
nav.tabs button[aria-current="page"] { color: var(--accent); }
nav.tabs button[aria-current="page"] svg { stroke-width: 2.4; }

@media (min-width: 700px) { body { padding-block: 24px 110px; } }
@media (prefers-reduced-motion: no-preference) { .task, .chip, .btn { transition: background-color .15s; } }

.daylist { padding: 8px 14px 12px; margin: 0; }
.daylist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.daylist li { display: flex; gap: 8px; }
.daylist .note { color: var(--c); font-weight: 600; font-size: 13px; }
.card.istoday { outline: 2px solid var(--accent); outline-offset: 2px; }
.card > header .linkbtn { color: var(--c); font-size: 14px; }

.banner.err { background: color-mix(in srgb, var(--c-erine) 14%, var(--surface)); color: var(--ink); border: 1px solid var(--c-erine); }
.hist td { text-align: center; } .hist th:not(:first-child) { text-align: center; }
.hc { min-width: 56px; min-height: 40px; padding: 4px 8px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.hc.ok { background: color-mix(in srgb, var(--ok) 22%, var(--surface)); color: var(--ink); border-color: var(--ok); }
.hc.part { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--ink); border-color: var(--warn); }
.hc.none { background: var(--surface); color: var(--muted); border: 1px dashed var(--muted); }


/* ===================== Comptes personnels ===================== */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.stack { display: grid; gap: 12px; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; border-radius: 10px; }
code { font-size: .95em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
input[type="password"], input[type="number"], input:not([type]), select {
  min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); min-width: 0; max-width: 100%;
}
.elykia { --c: var(--c-elykia); } .djeden { --c: var(--c-djeden); } .kaissa { --c: var(--c-kaissa); } .erine { --c: var(--c-erine); }

/* Pastille d'initiale */
.avatar {
  --size: 36px; flex: none; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--c, var(--accent)); color: var(--surface); font: 700 calc(var(--size) * .45)/1 var(--font-display);
}
.avatar.lg { --size: 52px; } .avatar.xl { --size: 84px; }

/* Barre du haut (compte connecté) */
.topbar { max-width: 1000px; margin: 0 auto 12px; display: grid; gap: 8px; }
.topbar-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .who { font-family: var(--font-display); font-size: 1.1rem; }
.topbar .btn { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--warn); }
.status.off { color: var(--muted); }
.status svg { width: 18px; height: 18px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--surface)); border: 2px dashed var(--c, var(--accent)); }

/* Connexion : tuiles-profils */
body.is-login { padding-bottom: 24px; }
.login-head { text-align: center; display: grid; gap: 4px; padding-top: 12px; }
.login-head h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
.login-sub { font-size: 1rem; color: var(--muted); text-align: center; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px; }
.tile {
  width: 100%; min-height: 160px; display: grid; justify-items: center; align-content: center; gap: 10px; padding: 16px 8px;
  border-radius: 22px; border: 2px solid color-mix(in srgb, var(--c, var(--accent)) 35%, var(--surface));
  background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--surface));
  font: 700 1.35rem/1.1 var(--font-display); color: var(--ink);
}
.tile:hover { border-color: var(--c, var(--accent)); }
.tiles.small { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.tiles.small .tile { min-height: 64px; grid-auto-flow: column; justify-content: center; align-items: center; font-size: 1.05rem; }

/* Connexion : clavier PIN */
.pin { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 360px; margin: 0 auto; width: 100%; }
.pin h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
.dots { display: flex; gap: 14px; min-height: 22px; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--c, var(--accent)); }
.dot.on { background: var(--c, var(--accent)); }
.login-msg { min-height: 1.45em; font-weight: 600; color: var(--c-erine); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.key {
  min-height: 68px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  font: 700 2rem/1 var(--font-display); font-variant-numeric: tabular-nums; display: grid; place-items: center;
}
.key:active { background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--surface)); }
.key.fn { background: var(--surface-2); }
.key svg { width: 30px; height: 30px; }
.key[disabled] { opacity: .45; cursor: not-allowed; }
.login-parent { max-width: 460px; margin: 0 auto; width: 100%; }
.login-parent input { width: 100%; }

/* Enfant : grandes zones tactiles */
.card.big .task, .card.simple .task { min-height: 58px; }
.card.big .task { font-size: 17px; }
.task[aria-disabled="true"] { cursor: default; }
.task[aria-disabled="true"]:hover { background: none; }
.task[aria-disabled="true"] .box { opacity: .55; }
.task .wait { color: var(--warn); display: grid; } .task .wait svg { width: 20px; height: 20px; }
.task { grid-template-columns: 26px 26px 1fr auto; }
.cards.one { grid-template-columns: 1fr; }
.done-all { text-align: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); border: 1px solid var(--c); }
.away-msg { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.away-msg h2 { color: var(--c); }
.daylist li.is-done span:last-child { color: var(--muted); }
.bignum { font-size: 1.1rem; } .bignum strong { font: 700 2.2rem/1 var(--font-display); color: var(--c, var(--accent)); }
.meter { height: 16px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 8px; background: var(--c, var(--accent)); }
.histlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.histrow { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.histrow .hc { min-width: 64px; text-align: center; display: inline-block; padding: 6px 8px; }

/* Mode simplifié (Kaïssa) : une colonne, grosses icônes, texte court */
.simple-mode .wrap { max-width: 560px; }
.card.simple .task { grid-template-columns: 34px 40px 1fr auto; gap: 12px; min-height: 68px; font-size: 19px; font-weight: 600; }
.card.simple .box { width: 32px; height: 32px; border-width: 3px; border-radius: 10px; }
.card.simple .box svg { width: 20px; height: 20px; }
.card.simple .ico { font-size: 30px; }
.card.simple .txt em { font-size: 15px; }
.simple-mode .daytitle h1 { font-size: 2rem; }
.simple-mode nav.tabs button span { font-size: 13px; }

@media (prefers-reduced-motion: no-preference) { .key, .tile { transition: background-color .15s, border-color .15s; } }

/* ===================== Interface parent ===================== */
.only-narrow { display: none; }
@media (max-width: 699px) { .only-wide { display: none; } .only-narrow { display: grid; } }
.hint.pad { padding: 0 14px 12px; }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.bar .track { display: block; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.bar .track i { height: 100%; }
.daylist .kid { display: grid; gap: 4px; padding: 6px 0; }
.daylist .kid + .kid { border-top: 1px solid var(--line); }
.daylist .kid h3 { font: 700 14px/1.2 var(--font-body); color: var(--c); }
table.hist { border-collapse: collapse; width: 100%; }
.hist th, .hist td { padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 14px; text-align: center; }
.hist thead th { font-family: var(--font-display); background: var(--surface-2); }
.hist thead th.elykia { color: var(--c-elykia); } .hist thead th.djeden { color: var(--c-djeden); }
.hist thead th.kaissa { color: var(--c-kaissa); } .hist thead th.erine { color: var(--c-erine); }
.hist tbody th { text-align: left; font-weight: 700; white-space: nowrap; padding-left: 6px; }
.hist tbody th small { display: block; font-weight: 500; color: var(--muted); }
.hist tr.today th, .hist tr.today td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.hist .hc { min-width: 46px; padding: 4px 4px; }
.statcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.statcard { margin: 0; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--surface)); display: grid; gap: 4px; }
.statcard h3 { color: var(--c); font-size: 1.1rem; }
.statcard div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.statcard dt { color: var(--muted); } .statcard dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.accounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.account { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.account.inactive { opacity: .7; border-style: dashed; }
.account-head { display: flex; gap: 10px; align-items: center; }
.account-head small { display: block; color: var(--muted); font-size: 13px; }
.account .row { gap: 6px; }
.inline-form { display: grid; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.inline-form input, .inline-form select, form.stack input:not([type="checkbox"]):not([type="color"]), form.stack select { width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type="color"] { width: 64px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.journal li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.journal .jres { font-weight: 700; color: var(--ok); text-align: right; } .journal li.ko .jres { color: var(--c-erine); }
.journal .jdate { font-weight: 600; } .journal .jip { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.switch.erine { --c: var(--c-erine); }

/* ===================== Avatars ===================== */
.avatar.emoji {
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface));
  box-shadow: inset 0 0 0 3px var(--c, var(--accent));
  font: calc(var(--size) * .56)/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pick {
  aspect-ratio: 1 / 1; min-height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface);
  font: 28px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font-display); display: grid; place-items: center;
}
.pick:first-child { font: 700 22px/1 var(--font-display); color: var(--c, var(--accent)); }
.pick[aria-pressed="true"] { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface)); box-shadow: 0 0 0 2px var(--c, var(--accent)); }
/* Comptes sans couleur d'enfant (parents) : couleur foncée enregistrée, initiale toujours en blanc */
.avatar[data-color]:not(.emoji) { color: #FFFFFF; }

/* ===================== Photos d'avatar ===================== */
.avatar.photo { overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 3px var(--c, var(--accent)); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; padding: 3px; display: block; }
.pick.photo { padding: 3px; overflow: hidden; }
.pick.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
label.btn { display: inline-flex; align-items: center; cursor: pointer; }
label.btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
label.btn.busy { opacity: .6; cursor: progress; }
.photo-row { margin-top: 4px; }
.panel h3 { font-size: 1.05rem; margin-top: 4px; }

/* ===================== Bonus ===================== */
.score { text-align: center; border-color: var(--c, var(--line)); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--surface)); }
.btypes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.btypes > li { display: grid; align-content: start; }
.btypes > li:has(.qty) { grid-column: 1 / -1; }
.btype {
  width: 100%; min-height: 112px; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 8px; text-align: center;
  border-radius: 16px; border: 1px solid var(--line); background: var(--bg);
}
.btype:hover { border-color: var(--accent); }
.btype[aria-expanded="true"] { border: 2px solid var(--accent); }
.btype .bico { font-size: 32px; line-height: 1; }
.btype .bname { font-weight: 700; line-height: 1.2; }
.btype small { color: var(--muted); font-size: 12.5px; }
.btypes.simple .btype { min-height: 130px; } .btypes.simple .bico { font-size: 40px; } .btypes.simple .bname { font-size: 1.05rem; }
.qty { margin-top: 8px; } .qty input { width: 110px; }
.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bline { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.bline .bicon { font-size: 26px; width: 36px; text-align: center; }
.bline .btext { min-width: 0; display: grid; } .bline .btext small { color: var(--muted); font-size: 13px; }
.bline .why { color: var(--c-erine) !important; font-weight: 600; }
.bline .bpts { font: 700 1.1rem/1 var(--font-display); color: var(--ok); font-variant-numeric: tabular-nums; }
.bline.refused .btext strong { text-decoration: line-through; color: var(--muted); } .bline.refused .bpts { color: var(--muted); }
.bline .bacts, .bline .inline-form { grid-column: 1 / -1; }
.banner.champion { background: color-mix(in srgb, #E8B400 18%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, #E8B400 60%, var(--surface)); }

/* Classement */
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranking li { display: grid; grid-template-columns: 40px auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); }
.ranking li.first { background: color-mix(in srgb, #E8B400 16%, var(--surface)); }
.ranking li.is-me { outline: 2px solid var(--c, var(--accent)); }
.ranking .rk { font: 700 1.4rem/1 var(--font-display); text-align: center; }
.ranking .rk sup { font-size: .55em; }
.ranking .rname { font-weight: 700; min-width: 0; overflow-wrap: anywhere; } .ranking .rname small { font-weight: 500; color: var(--muted); }
.ranking .rpts { font-variant-numeric: tabular-nums; } .ranking .rpts strong { font: 700 1.3rem/1 var(--font-display); }

/* Badges */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; text-align: center; border-radius: 16px; border: 1px dashed var(--line); background: var(--bg); }
.badge .bico { font-size: 34px; line-height: 1; filter: grayscale(1); opacity: .45; }
.badge strong { font-size: 14px; line-height: 1.2; } .badge small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.badge.got { border: 2px solid color-mix(in srgb, #E8B400 70%, var(--surface)); background: color-mix(in srgb, #E8B400 10%, var(--surface)); }
.badge.got .bico { filter: none; opacity: 1; }
.meter.small { width: 100%; height: 8px; }
.kidbadges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kidbadges li { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.minibadges { display: flex; flex-wrap: wrap; gap: 4px; font-size: 22px; margin-top: 2px; }

/* Liste des actions (parents) */
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tlist > li { padding: 10px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; }
.tlist > li.inactive { opacity: .65; }
.trow { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; }
.trow .bico { font-size: 26px; text-align: center; } .trow small { display: block; color: var(--muted); font-size: 13px; }
.tform { background: var(--surface); }
.tform input:not([type="checkbox"]), .tform select { width: 100%; }

/* Défilement automatique (focus, ancres) : ne jamais cacher un élément sous la barre d’onglets fixe */
html { scroll-padding-bottom: 96px; scroll-padding-top: 12px; }

/* Message de réussite */
.banner.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ok) 55%, var(--surface)); }

/* ===================== Points : sous-onglets, classement détaillé ===================== */
.subnav .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; background: var(--c-erine); color: #fff; font-size: 12px; }
.ranking li { grid-template-columns: 40px auto 1fr auto; }
.ranking li.absent { opacity: .7; }
.ranking .rname { display: grid; gap: 3px; }
.ranking .rdetail { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.ranking .meter.small { max-width: 180px; }
details.rules, details { font-size: 14px; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; }
details.rules p { color: var(--muted); margin-top: 6px; }

/* Objectifs de famille */
.objective { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.objective.reached { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.ohead { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.ohead .bico { font-size: 30px; text-align: center; } .ohead small { display: block; color: var(--muted); }
.objective .meter i { background: linear-gradient(90deg, var(--c-elykia), var(--c-djeden), var(--c-kaissa), var(--c-erine)); }
.pastobj { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Boutique */
.bignum.wallet strong { color: var(--c, var(--accent)); }
.rewards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.reward { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 12px 8px; text-align: center; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.reward .bico { font-size: 34px; line-height: 1; }
.reward strong { line-height: 1.2; }
.reward .cost { font: 700 1.05rem/1 var(--font-display); color: var(--accent); }
.reward small { color: var(--muted); font-size: 12.5px; }
.reward.locked { opacity: .75; } .reward.locked .bico { filter: grayscale(.7); }
.reward .missing { color: var(--warn); font-weight: 600; }
.rewards.simple .bico { font-size: 42px; } .rewards.simple strong { font-size: 1.05rem; }
.pline { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.pline .bicon { font-size: 26px; width: 36px; text-align: center; }
.pline .btext { min-width: 0; display: grid; } .pline .btext small { color: var(--muted); font-size: 13px; }
.pline .why { color: var(--c-erine) !important; font-weight: 600; }
.pline .bacts, .pline .inline-form { grid-column: 1 / -1; }
.pill.st { white-space: nowrap; }
.pline.st-demande .pill.st { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.pline.st-accepte .pill.st { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.pline.st-refuse .pill.st { background: color-mix(in srgb, var(--c-erine) 16%, var(--surface)); color: var(--c-erine); }
.pline.st-annule { opacity: .7; }

/* ===================== Lecture à voix haute (Kaïssa) ===================== */
.card ul li.with-speak { display: grid; grid-template-columns: 1fr 52px; gap: 4px; align-items: center; }
.speak { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--c, var(--accent)); background: var(--surface); color: var(--c, var(--accent)); display: grid; place-items: center; }
.speak svg { width: 26px; height: 26px; }
.speak:active { background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--surface)); }
.btn.speak-all { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; font-size: 1.05rem; border: 2px solid var(--c, var(--accent)); color: var(--c, var(--accent)); }
.btn.speak-all svg { width: 24px; height: 24px; }

/* ===================== Journées spéciales ===================== */
.banner.special, .away-msg.special { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); border: 1px dashed var(--accent); }
.away-msg.special h2 { color: var(--accent); }
.specials { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.specials li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.specials li small { display: block; color: var(--muted); font-size: 13px; }

/* Bonus accordés par les parents (information côté enfant) */
.parent-only { margin-top: 6px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line); display: grid; gap: 6px; }
.parent-only h3 { font-size: 1rem; }
.parent-only ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.parent-only small { color: var(--muted); }
