:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #24282d;
  --muted: #6d737a;
  --line: #e4e0d8;
  --accent: #3f8a7d;
  --accent-soft: #e2f0ec;
  --danger: #b5483f;
  --warn: #c27c1a;
  --warn-soft: #fdf1dd;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --surface: #212428;
    --text: #e8e6e1;
    --muted: #9aa0a6;
    --line: #33373c;
    --accent: #5fb3a4;
    --accent-soft: #23372f;
    --danger: #e0766c;
    --warn: #e0a64a;
    --warn-soft: #3a2f1c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
.center { text-align: center; }
.hint { font-size: .85rem; color: var(--muted); margin: .4rem 0 0; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 48px; }
main.narrow { max-width: 640px; }
main.wide { max-width: 1300px; }

/* Navigation */
.topnav {
  display: flex; gap: 2px; align-items: center;
  padding: 8px 12px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  overflow-x: auto; scrollbar-width: none;
}
.topnav a {
  padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--muted); white-space: nowrap; font-size: .95rem;
}
.topnav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topnav .settings-link { margin-left: auto; }
.topnav form { margin: 0; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: .88rem; }
.btn.danger { color: var(--danger); }
button.link { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 6px 10px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; background: var(--accent-soft); }
.flash.error { background: var(--warn-soft); color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* En-têtes de page */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 16px; }
.pager .btn { font-size: 1.4rem; padding: 4px 16px; }
.pager-title { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.badge { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 600; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }
.section-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title.late { color: var(--warn); }

/* Progression */
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); transition: width .3s; }

/* Liste du jour */
.occ-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.occ {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--c); border-radius: var(--radius);
  padding: 12px;
}
.occ-body { flex: 1; min-width: 0; }
.occ-title { font-weight: 600; }
.occ-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--muted); margin-top: 2px; align-items: center; }
.occ-meta .moved { color: var(--warn); }
.occ-notes { font-size: .88rem; color: var(--muted); margin-top: 6px; white-space: pre-line; }
.occ.done .occ-title, .occ.skipped .occ-title { text-decoration: line-through; color: var(--muted); font-weight: normal; }
.occ.done, .occ.skipped { opacity: .7; }

form.inline { display: inline; margin: 0; }
.check {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  border: 2px solid var(--c, var(--accent)); background: transparent;
  cursor: pointer; color: #fff; font-weight: 700; font-size: .9rem; line-height: 1; padding: 0;
  transition: background-color .15s, transform .15s;
}
.check:active { transform: scale(.88); }
.occ { transition: opacity .2s; }
.check:hover { background: color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); }
.check.done { background: var(--c, var(--accent)); }
.check.skipped { background: var(--muted); border-color: var(--muted); }

.actions { position: relative; }
.actions summary { list-style: none; cursor: pointer; padding: 2px 8px; border-radius: 8px; color: var(--muted); font-size: 1.2rem; }
.actions summary::-webkit-details-marker { display: none; }
.actions[open] summary { background: var(--line); }
.actions .menu {
  position: absolute; right: 0; top: 110%; z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 10px;
  display: flex; flex-direction: column; gap: 8px; min-width: 230px;
}
.actions .menu form { margin: 0; }
.actions .menu .btn { width: 100%; }
.actions .move { display: flex; gap: 6px; }
.actions .move input { flex: 1; min-width: 0; }
.actions .move .btn { width: auto; }

.chip {
  display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }

.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.quick-add { display: flex; gap: 8px; margin-top: 24px; }
.quick-add input { flex: 1; }

/* Formulaires */
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
label .muted { font-weight: normal; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1 1 140px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 4px; margin: 4px 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.modes { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
label.radio, label.check-label { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; margin: 0; padding: 4px 0; }
label.check-label { margin-bottom: 8px; }
label.inline-label { flex-direction: row; align-items: center; flex-wrap: wrap; font-weight: normal; gap: 6px; }
input.tiny { width: 70px; }
.sub { padding: 10px 0 12px; border-top: 1px dashed var(--line); }
.sub-title { font-size: .9rem; font-weight: 600; margin-bottom: 8px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { margin: 0; font-weight: normal; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block; min-width: 44px; text-align: center;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; user-select: none;
}
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pill input:focus-visible + span { outline: 2px solid var(--accent); }
.pills.days .pill span { min-width: 40px; padding: 5px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.preview { position: sticky; top: 70px; }
.preview h2 { margin-top: 0; }
.preview ul { list-style: none; padding: 0; margin: 12px 0; }
.preview li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.preview li.heavy span { color: var(--warn); }
.delete-form { margin-top: 20px; }
@media (max-width: 800px) {
  .form-layout { grid-template-columns: 1fr; }
  .preview { position: static; }
}

/* Liste des tâches */
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.task-list li { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px 4px 0; }
.task-list li.inactive { opacity: .55; }
.task-list form { margin: 0; }
.task-main { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; text-decoration: none; color: var(--text); min-width: 0; }
.task-main .muted { font-size: .88rem; }
.task-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.task-tags .off { color: var(--warn); }
.once-box { margin-top: 32px; }
.once-box summary { cursor: pointer; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 0; }
.once-box .task-list { margin-top: 8px; }
.once-box .late { color: var(--warn); }

/* Semaine */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; cursor: pointer; }
.week-day:hover { border-color: var(--accent); }
.week-day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; text-decoration: none; color: var(--text); margin-bottom: 8px; flex-wrap: wrap; }
.week-head .muted { font-size: .78rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.mini-list li { display: flex; gap: 8px; align-items: flex-start; }
.mini-list .check { width: 20px; height: 20px; font-size: .7rem; }
.mini-list li.done span, .mini-list li.skipped span { text-decoration: line-through; color: var(--muted); }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
}

/* Mois */
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-head { text-align: center; font-size: .8rem; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.month-cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  min-height: 110px; padding: 6px; text-decoration: none; color: var(--text); overflow: hidden;
}
.month-cell.other { opacity: .45; }
.month-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.month-cell.heavy { background: var(--warn-soft); }
.month-num { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; }
.month-num .load { font-weight: normal; font-size: .72rem; color: var(--muted); }
.month-cell ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: .74rem; line-height: 1.3; }
.month-cell li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c); padding-left: 4px; margin-bottom: 2px; }
.month-cell li.done, .month-cell li.skipped { text-decoration: line-through; color: var(--muted); }
.month-cell .dots { display: none; }
@media (max-width: 700px) {
  .month-cell { min-height: 58px; padding: 4px; }
  .month-cell ul, .month-num .load { display: none; }
  .month-cell .dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
  .month-cell .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
}

/* Catégories */
.cat-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: flex; gap: 6px; align-items: center; margin: 0; }
.cat-row input[type=text] { flex: 1; min-width: 0; }
.cat-row .pos { width: 64px; flex: none; }
.cat-row.add { margin-top: 16px; }

/* Paramètres : notifications */
.steps { padding-left: 20px; margin: 8px 0 12px; }
.steps li { margin-bottom: 4px; }
.notif-prefs { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.notif-row input[type=time], .moment-times input[type=time] { width: auto; }
.sub-option { margin-left: 26px; }
.moment-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 0 26px; }
.moment-times label { font-weight: normal; margin: 0; }
input[type=time] { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.notif-prefs .btn { margin-top: 16px; }

/* Foyer : membres, avatars, filtre */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff;
  font-weight: 700; font-size: .85rem; font-style: normal; line-height: 1;
}
.avatar.small { width: 20px; height: 20px; font-size: .68rem; }
.topnav .settings-link { padding: 4px; }
.shared-tag { font-size: .75rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 0 8px; }
.scope-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 16px; padding-bottom: 2px; }
.scope-chips a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem;
}
.scope-chips a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.who-initial { font-weight: 800; }
.quick-add select { width: auto; flex: none; }
.pills.people .pill span { display: inline-flex; align-items: center; gap: 6px; }
.alt-row { margin-top: 12px; }
.preview .who { font-style: normal; color: var(--accent); font-size: .85rem; }
.member-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.member-list .card { padding: 12px 16px; }
.member-list .inactive { opacity: .6; }
.member-list summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.member-list summary::-webkit-details-marker { display: none; }
.member-form { margin-top: 14px; }
.member-form .row > label { flex: 1 1 120px; }
@media (max-width: 600px) {
  .quick-add { flex-wrap: wrap; }
  .quick-add input[type=text] { flex-basis: 100%; }
}

/* To-do */
.todo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 12px; margin-bottom: 16px; }
.todo-add > input[type=text] { flex: 1 1 200px; }
.todo-add .todo-more { flex-basis: 100%; order: 3; font-size: .9rem; }
.todo-add .todo-more summary { cursor: pointer; color: var(--muted); }
.todo-add .todo-more .row { margin-top: 8px; }
.todo-list .occ { align-items: center; }
.todo-list a.occ-title { color: var(--text); text-decoration: none; }
.plan { color: var(--accent); }
.plan.late { color: var(--warn); }
.plan-form { display: flex; flex-direction: column; gap: 6px; }
.plan-form label { margin: 0; font-weight: normal; }
.todo-tag { font-size: .72rem; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 0 7px; }
.check.partial { background: linear-gradient(90deg, var(--c, var(--accent)) 50%, transparent 50%); color: var(--text); }
.picker { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.picker summary { cursor: pointer; font-weight: 600; }
.picker-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.picker-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.picker-list form { margin: 0; }
.picker-title { display: flex; flex-direction: column; }

/* Foyers et administration */
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-inline > input[type=text] { flex: 1 1 180px; width: auto; }
.row-inline form { margin: 0; }
.household-name { margin: 12px 0; }
.invite-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.invite-list li { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.invite-list li.expired { opacity: .55; }
.invite-list input[readonly] { font-size: .8rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }

/* Sous-étapes */
.steps { margin-top: 6px; font-size: .88rem; }
.steps summary { cursor: pointer; color: var(--muted); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.steps summary::-webkit-details-marker { display: none; }
.steps-count { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-weight: 600; color: var(--text); }
.steps-count.complete { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.steps ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li form { margin: 0; }
.steps li.on span { text-decoration: line-through; color: var(--muted); }
.mini-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--c, var(--accent));
  background: transparent; color: #fff; font-size: .7rem; font-weight: 700; padding: 0; cursor: pointer;
}
.mini-check.on { background: var(--c, var(--accent)); }

/* Jeu */
.score-chip {
  display: flex; justify-content: center; gap: 14px; margin: -6px auto 14px; width: fit-content;
  padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  text-decoration: none; font-size: .88rem; font-weight: 600;
}
.game-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.game-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.game-stat strong { display: block; font-size: 1.6rem; }
.game-stat span { color: var(--muted); font-size: .82rem; }
.level-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.level-bar div { height: 100%; background: linear-gradient(90deg, var(--accent), #d4a72c); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.badge-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 6px; text-align: center; background: var(--surface); }
.badge-card .em { font-size: 1.8rem; display: block; }
.badge-card small { color: var(--muted); display: block; font-size: .72rem; margin-top: 2px; }
.badge-card.locked { opacity: .4; filter: grayscale(1); }
.reward-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.reward-list li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.reward-list .em { font-size: 1.5rem; }
.reward-list .grow { flex: 1; min-width: 0; }
.reward-list form { margin: 0; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-list .pos { width: 26px; text-align: center; font-weight: 700; }
.rank-list .grow { flex: 1; }
.reward-edit { display: grid; grid-template-columns: 60px 1fr 90px auto; gap: 6px; align-items: center; }
@media (max-width: 520px) { .reward-edit { grid-template-columns: 50px 1fr 70px; } .reward-edit button { grid-column: 1 / -1; } }

/* Hors connexion */
#offline-banner {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50;
  background: #24282d; color: #fff; padding: 8px 16px; border-radius: 999px; font-size: .88rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100% - 32px); text-align: center;
}
.queued { opacity: .6; font-style: italic; }
li.occ.queued { padding: 12px 16px; }

/* Mode enfant */
.child-mode-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: #fdf1dd; color: #6b4a12; font-size: .9rem; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .child-mode-bar { background: #3a2f1c; color: #f0d29a; } }
.open-child { text-align: center; margin: -6px 0 12px; }
.pin-input { display: block; width: 100%; font-size: 2rem; letter-spacing: .6em; text-align: center; max-width: 220px; margin: 0 auto; }

/* Connexion */
.login { margin-top: 12vh; text-align: center; }
.login form { text-align: left; margin-top: 20px; }
.login .btn { width: 100%; }

/* =====================================================================
   Application (look « appli iPhone ») — prend le pas sur ce qui précède
   ===================================================================== */
:root {
  --accent-strong: #2f6f64;   /* texte vert lisible sur fond clair */
  --seg-bg: #e9e5dd;
  --hairline: #efece6;
  --tab-bg: rgba(255, 255, 255, 0.94);
  --toast-bg: #24282d;
  --sheet-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  --tab-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent-strong: #7fcfbf;
    --seg-bg: #2b2f34;
    --hairline: #2c3035;
    --tab-bg: rgba(33, 36, 40, 0.94);
    --toast-bg: #3a3f45;
  }
}
@view-transition { navigation: auto; }   /* transition douce entre les pages (navigateurs récents) */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
input, select, textarea { font-size: 16px; }    /* évite le zoom automatique de Safari */
button, .tabbar, .occ, .week-strip, .tile, .list-row, summary { -webkit-user-select: none; user-select: none; }
main { padding-top: calc(env(safe-area-inset-top) + 8px); }
body.with-tabs main { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 96px); }
.child-mode-bar { padding-top: calc(env(safe-area-inset-top) + 8px); }
.child-mode-bar + main { padding-top: 8px; }

/* --- Barre d'onglets ------------------------------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 6px max(6px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(6px, env(safe-area-inset-left));
  background: var(--tab-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
}
.tabbar a {
  flex: 1; max-width: 110px; min-height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500;
}
.tabbar a svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent-strong); font-weight: 600; }

/* --- En-tête d'application ------------------------------------------------ */
.app-header { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0 12px; }
.app-header-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-subtitle { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title { margin: 0; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; }
.app-header-extra { display: flex; align-items: center; gap: 6px; padding-bottom: 4px; }
.app-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--c); color: #fff;
  display: grid; place-items: center; text-decoration: none; font-weight: 700; font-size: 16px; margin-bottom: 2px;
}
.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-strong); text-decoration: none;
  font-size: 16px; font-weight: 500; margin: 0 0 4px -6px; min-height: 32px; }
.back-link svg, .icon-btn svg, .strip-arrow svg, .chevron, .sheet-x svg, .round-add svg, .fab svg {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.back-link svg { width: 22px; height: 22px; }
.pill-link { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill-link.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.header-pager { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

/* --- Bandeau des jours ---------------------------------------------------- */
/* Roue des jours : 7 jours visibles, on fait défiler au doigt, calée sur un jour */
.wheel { position: relative; display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.wheel::-webkit-scrollbar { display: none; }
.wheel-month { margin: 0 4px 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.week-strip { margin: 0 -10px 10px; padding: 2px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.strip-day { flex: 0 0 calc(100% / 7); scroll-snap-align: center; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 14px;
  text-decoration: none; color: var(--muted); font-size: 12px; }
.strip-day.monday:not(.on) { box-shadow: -1px 0 0 var(--hairline); }  /* repère entre deux semaines */
.strip-num { font-size: 17px; font-weight: 600; color: var(--text); }
.strip-day.is-today .strip-num { color: var(--accent-strong); }
.strip-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.strip-dot.has { background: #c9cdd1; }
.strip-dot.done { background: var(--accent); }
.strip-day.on { background: var(--accent); color: #e6f2ef; }
.strip-day.on .strip-num { color: #fff; }
.strip-day.on .strip-dot.has, .strip-day.on .strip-dot.done { background: #fff; }

/* --- Carte de synthèse ---------------------------------------------------- */
.summary-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface);
  border-radius: 20px; text-decoration: none; color: var(--text); margin-bottom: 12px; }
.ring { width: 56px; height: 56px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring text { font-size: 15px; font-weight: 700; fill: var(--text); }
.summary-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.summary-text strong { font-size: 16px; }
.summary-text .muted { font-size: 13px; }
.summary-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge-pts, .badge-streak { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-pts { background: #fdf1dd; color: #8a5a00; }
.badge-streak { background: #fbe6df; color: #a3361f; }
.badge-pts svg { width: 13px; height: 13px; fill: #c27c1a; }
.badge-streak svg { width: 13px; height: 13px; fill: #d1492b; }
.score-chip { display: none; }

/* --- Sélecteur segmenté (Moi / Tout le foyer / …) ------------------------- */
.scope-chips.segmented { display: flex; gap: 3px; padding: 3px; margin: 0 0 6px; background: var(--seg-bg); border-radius: 10px; overflow-x: auto; }
.scope-chips.segmented a { flex: 1 0 auto; justify-content: center; border: 0; border-radius: 8px; padding: 7px 12px;
  font-size: 14px; font-weight: 500; color: var(--text); background: transparent; }
.scope-chips.segmented a.on { background: var(--surface); font-weight: 600; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* --- Listes groupées de tâches -------------------------------------------- */
.group-title { margin: 18px 4px 6px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.group-title.late { color: var(--warn); }
.occ-list.group { background: var(--surface); border-radius: 16px; gap: 0; }
.occ-list.group > .occ { border: 0; border-radius: 0; background: transparent; padding: 12px 10px 12px 14px;
  border-bottom: 1px solid var(--hairline); align-items: center; min-height: 60px; }
.occ-list.group > .occ:last-child { border-bottom: 0; }
.occ-list.group > .occ:first-child { border-radius: 16px 16px 0 0; }
.occ-list.group > .occ:last-child { border-radius: 0 0 16px 16px; }
.occ-list.group > .occ:only-child { border-radius: 16px; }
.occ-title { font-size: 16px; font-weight: 500; }
.occ.done .occ-title, .occ.skipped .occ-title, .occ.partial .occ-title { color: var(--muted); }
.occ.done, .occ.skipped { opacity: 1; }
.check.done { border-color: var(--c, var(--accent)); }
details.actions summary { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; padding: 0; color: var(--muted); }
details.actions summary svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
details.actions[open] summary { background: transparent; }

/* --- Panneaux qui montent du bas (menu ⋯, ajout) --------------------------- */
details.actions[open]::before, details.sheet[open]::before {
  content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(20, 22, 25, .42); animation: fade-in .18s ease-out;
}
details.actions .menu, details.sheet .sheet-panel {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 61; margin: 0 auto; max-width: 560px; min-width: 0;
  max-height: 88vh; overflow-y: auto; background: var(--surface); border: 0; border-radius: 22px 22px 0 0;
  box-shadow: var(--sheet-shadow); padding: 8px 18px calc(env(safe-area-inset-bottom) + 18px);
  display: flex; flex-direction: column; gap: 8px; animation: sheet-up .24s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-grabber { align-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 4px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sheet-head strong { font-size: 19px; }
.sheet-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); display: grid; place-items: center; }
.sheet-x svg { width: 15px; height: 15px; }
details.actions .menu .btn { width: 100%; justify-content: flex-start; padding: 14px 16px; border-radius: 12px; border: 0;
  background: var(--bg); font-size: 16px; font-weight: 500; color: var(--text); }
details.actions .menu .btn.ghost { color: var(--accent-strong); }
details.actions .menu .btn.sheet-cancel { justify-content: center; font-weight: 700; background: transparent; margin-top: 2px; }
details.actions .menu form { margin: 0; display: flex; flex-direction: column; gap: 8px; }
details.actions .menu form.move { flex-direction: row; }
details.actions .move input { flex: 1; min-width: 0; }
details.actions .move .btn { width: auto; justify-content: center; }

/* Bouton « + » flottant */
details.add-sheet > summary.fab {
  list-style: none; position: fixed; z-index: 35; right: max(18px, env(safe-area-inset-right));
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px);
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(47, 111, 100, .35); cursor: pointer;
}
details.add-sheet > summary.fab::-webkit-details-marker { display: none; }
details.add-sheet > summary.fab svg { width: 26px; height: 26px; stroke-width: 2.6; }
details.add-sheet[open] > summary.fab { opacity: 0; pointer-events: none; }
.add-sheet .quick-add { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.field-label { margin: 0; font-size: 13px; color: var(--muted); }
.field-label input { font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); }
.field-label input:focus { border-color: var(--accent); outline: none; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.choice legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 8px; }
.choice-pill { margin: 0; font-weight: normal; position: relative; flex-direction: row; align-items: center; }
.choice-pill > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill > span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 15px; cursor: pointer; min-height: 38px; }
.choice-pill > input[type=radio]:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.choice-pill > input[type=radio]:focus-visible + span { outline: 2px solid var(--accent); }
.date-pill { gap: 6px; }
.date-pill input[type=date] { width: auto; padding: 6px 8px; border-radius: 999px; }
.btn.block { width: 100%; padding: 14px 0; border-radius: 14px; font-size: 17px; }
.add-sheet .picker { margin-top: 6px; border: 0; padding: 12px 0 0; background: transparent; border-top: 1px solid var(--hairline); border-radius: 0; }
.add-sheet .picker summary { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); list-style: none; }
.add-sheet .picker summary::-webkit-details-marker { display: none; }
.picker-list li { border-top: 1px solid var(--hairline); padding: 8px 0; }
.picker-list li:first-child { border-top: 0; }
.round-add { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; cursor: pointer; }
.round-add svg { width: 16px; height: 16px; stroke-width: 2.8; }

/* --- Bulles de message ---------------------------------------------------- */
.toasts { position: fixed; z-index: 70; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body:not(.with-tabs) .toasts { bottom: calc(env(safe-area-inset-bottom) + 16px); }
.toast, .flash.toast { pointer-events: auto; margin: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 14px; background: var(--toast-bg); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: toast-in .25s cubic-bezier(.2, .9, .3, 1); transition: opacity .3s, transform .3s; }
.toast.error, .flash.toast.error { background: #8f2f27; color: #fff; }
.toast.out { opacity: 0; transform: translateY(12px); }
.toast .grow { flex: 1; }
.toast button { border: 0; background: transparent; color: #8fd3c4; font-weight: 700; font-size: 14px; padding: 4px 2px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
#offline-banner { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); }

/* --- Page « Plus » -------------------------------------------------------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: 18px;
  text-decoration: none; color: var(--text); }
.avatar.big { width: 52px; height: 52px; font-size: 22px; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-text strong { font-size: 17px; }
.profile-text .muted { font-size: 13px; }
.chevron { width: 18px; height: 18px; color: #a0a5aa; flex: none; }
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.tile { background: var(--surface); border-radius: 16px; padding: 16px 6px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; min-height: 96px; }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--b); color: var(--t); display: grid; place-items: center; }
.tile-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-group { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 16px; }
.list-group li + li { border-top: 1px solid var(--hairline); }
.list-group form { margin: 0; }
.list-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--text); text-align: left; text-decoration: none; min-height: 52px; cursor: pointer; }
.list-row .grow { flex: 1; }
.danger-text { color: var(--danger); }

/* Pages secondaires : moins « site web » */
main > .card { border: 0; border-radius: 18px; }
.task-list li, .member-list .card, .reward-list li, .game-stat, .badge-card { border-color: transparent; }

/* --- Bouton « + » flottant en lien (page Routines) -------------------------- */
a.fab-link {
  position: fixed; z-index: 35; right: max(18px, env(safe-area-inset-right));
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px);
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(47, 111, 100, .35);
}
a.fab-link svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* --- Pastilles à cocher (cases et boutons radio) ----------------------------- */
.choice-pill > input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill > input[type=checkbox]:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.choice-pill > input[type=checkbox]:focus-visible + span { outline: 2px solid var(--accent); }
.choice-pill.small > span { padding: 6px 11px; font-size: 14px; min-height: 34px; }
.choice-pill i.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.choice-pill > input:checked + span i.dot { box-shadow: 0 0 0 2px #fff; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
.choice-row.scroll::-webkit-scrollbar { display: none; }
.choice-row.scroll .choice-pill > span { white-space: nowrap; }

/* --- Formulaire de routine ----------------------------------------------------- */
main.form-page { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 110px); }
.routine-form { display: flex; flex-direction: column; }
.form-card { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 16px; }
.big-input { border: 0 !important; background: transparent !important; padding: 2px 0 !important; font-size: 22px !important;
  font-weight: 700; outline: none !important; }
.big-input::placeholder { color: #a7acb1; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-label .muted { font-weight: 400; }
.preset { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 7px 13px; font: inherit; font-size: 14px; min-height: 36px; cursor: pointer; }
.preset.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.preset-input { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.preset-input input { width: 70px; padding: 6px 8px; border-radius: 999px; text-align: center; }
.segmented-input { display: flex; gap: 3px; padding: 3px; background: var(--seg-bg); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.segmented-input label { flex: 1 0 auto; margin: 0; position: relative; }
.segmented-input input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-input span { display: block; text-align: center; padding: 7px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.segmented-input input:checked + span { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.segmented-input input:focus-visible + span { outline: 2px solid var(--accent); }

.day-circles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-circles label { margin: 0; position: relative; display: flex; justify-content: center; }
.day-circles input { position: absolute; opacity: 0; pointer-events: none; }
.day-circles span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line);
  font-weight: 700; font-size: 15px; cursor: pointer; }
.day-circles input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-circles input:focus-visible + span { outline: 2px solid var(--accent); }

.stepper-field { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 42px; height: 40px; border: 0; background: var(--bg); font-size: 20px; color: var(--text); cursor: pointer; }
.stepper input { width: 52px; border: 0; border-radius: 0; text-align: center; font-weight: 700; padding: 8px 0; background: var(--surface); }

.month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.month-days label { margin: 0; position: relative; }
.month-days input { position: absolute; opacity: 0; pointer-events: none; }
.month-days span { display: grid; place-items: center; height: 38px; border-radius: 10px; background: var(--bg); font-size: 14px; font-weight: 500; cursor: pointer; }
.month-days input:checked + span { background: var(--accent); color: #fff; font-weight: 700; }
.month-days .last-day { grid-column: span 4; }

.inline-field { flex-direction: row; align-items: center; justify-content: space-between; }
.inline-field input[type=date] { width: auto; }
details.fold { border-top: 1px solid var(--hairline); padding-top: 12px; }
details.fold > summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--accent-strong); list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "＋ "; }
details.fold[open] > summary::before { content: "− "; }
details.fold > .choice-row { margin-top: 10px; }
.presets-row .preset { font-size: 13px; padding: 5px 11px; min-height: 32px; }

.rule-preview { border-top: 1px solid var(--hairline); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.rule-preview > strong { font-size: 15px; color: var(--accent-strong); }
.date-chips { list-style: none; margin: 0 -14px; padding: 0 14px 4px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.date-chips::-webkit-scrollbar { display: none; }
.date-chips li { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--bg); min-width: 104px; }
.date-chips li strong { font-size: 14px; }
.date-chips li .who { font-size: 12px; color: var(--accent-strong); font-weight: 600; }
.date-chips li .who:empty { display: none; }
.date-chips li .load { font-size: 12px; color: var(--muted); }
.date-chips li.heavy { background: var(--warn-soft); }
.date-chips li.heavy .load { color: var(--warn); font-weight: 600; }

.options { gap: 0; padding: 4px 14px; }
.options > * + * { border-top: 1px solid var(--hairline); }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 0; font-weight: 400; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 16px; font-weight: 500; }
.switch-row .muted { font-size: 13px; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px;
  background: var(--line); position: relative; cursor: pointer; transition: background .2s; border: 0; padding: 0; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
input.switch:checked { background: #34c759; }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.text-row { margin: 0; padding: 12px 0; gap: 6px; font-weight: 400; }
.text-row textarea, .text-row input { border-radius: 10px; }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two-cols > .text-row + .text-row { border-top: 0; }
.alt-row select { border-radius: 10px; }

.save-bar { position: fixed; z-index: 34; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 10px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.save-bar .btn { max-width: 560px; margin: 0 auto; display: flex; box-shadow: 0 6px 16px rgba(47, 111, 100, .25); }
.delete-form { margin-top: 18px; }
.card-like { background: var(--surface); border-radius: 16px; }

/* Panneau d'ajout de la to-do : interrupteur et notes */
.add-sheet .switch-row { padding: 4px 0; }
.add-sheet textarea { border-radius: 12px; font-size: 16px; }

/* --- Roue des semaines --------------------------------------------------------- */
.week-wheel { margin: 0 -16px 12px; padding: 4px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.wheel-week { flex: 0 0 22%; scroll-snap-align: center; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0; border-radius: 14px;
  text-decoration: none; color: var(--muted); }
.wheel-week:first-child { margin-left: 39%; }
.wheel-week:last-child { margin-right: 39%; }
.ww-month { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ww-range { font-size: 18px; font-weight: 700; color: var(--text); }
.ww-cycle { font-size: 11px; }
.wheel-week.is-today .ww-range { color: var(--accent-strong); }
.wheel-week.on { background: var(--accent); color: #e6f2ef; }
.wheel-week.on .ww-range { color: #fff; }
@media (min-width: 900px) { .wheel-week { flex-basis: 12%; } .wheel-week:first-child { margin-left: 44%; } .wheel-week:last-child { margin-right: 44%; } }

/* --- Mois : jour touché et ses tâches sous le calendrier ----------------------- */
.month-cell { cursor: pointer; }
.month-cell.on { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.month-day { margin-top: 18px; scroll-margin-top: calc(env(safe-area-inset-top) + 12px); max-width: 640px; }
.month-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px; }
.month-day-head h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.month-day-head .pill-link { flex: none; }

/* --- To-do par catégorie, repliable -------------------------------------------- */
.todo-cat { margin-top: 14px; }
.todo-cat-head { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer;
  font-size: 15px; font-weight: 700; }
.todo-cat-head::-webkit-details-marker { display: none; }
.todo-cat-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.todo-cat-arrow { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round;
  stroke-linejoin: round; transition: transform .2s; flex: none; }
.todo-cat[open] > summary .todo-cat-arrow { transform: rotate(90deg); }
.todo-cat-count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--seg-bg); border-radius: 999px; padding: 1px 9px; }
.todo-cat > .occ-list { margin-top: 4px; }

/* --- Planning : vues Jour / Semaine / Mois --------------------------------------- */
.view-switch { margin: 0 0 10px; }
.view-switch a { flex: 1; text-align: center; }
