/* Taperlustre — bleu de lessive, carreaux jaunes. */
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/fonts/instrument.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #EEF2FC;
  --paper: #FFFFFF;
  --ink: #151B54;
  --ink-2: #4A5185;
  --blue: #2B3FBF;
  --blue-deep: #1F2E94;
  --blue-soft: #DCE3FA;
  --sun: #FFC53D;
  --sun-edge: #B97F00;
  --sun-soft: #FFF0C2;
  --mint: #D6F3E4;
  --mint-deep: #0B6B4B;
  --rose: #B4204F;
  --rose-soft: #FCE4EC;
  --line: #D3DAF1;
  --display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument", "Segoe UI", system-ui, -apple-system, sans-serif;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
html.sheet-open, html.sheet-open body { overflow: hidden; }
h1, h2, p, ul, ol, dl, dd, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, .brand, .btn, legend { font-family: var(--display); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Coquille ---------- */
.shell { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(var(--tabs-h) + var(--safe-b) + 28px); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  height: 60px; margin: 0 -16px; padding: env(safe-area-inset-top, 0px) 16px 0; background: var(--bg);
}
.top-left { display: flex; align-items: center; gap: 6px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--blue); text-decoration: none; }
.brand-tag { font: 600 13px var(--body); color: var(--ink); background: var(--sun); padding: 2px 8px; border-radius: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink);
}
.top .icon-btn { margin-left: -10px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.avatar {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: var(--c, var(--blue)); color: #fff; font: 700 17px var(--display); text-decoration: none;
}
.offline { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--sun-soft); font-size: 14px; }

.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 520px);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); text-decoration: none; font-size: 11.5px; font-weight: 500;
}
.tabs a[aria-current] { color: var(--blue); font-weight: 700; }
.tabs a[aria-current]::before { content: ""; position: absolute; top: 0; width: 28px; height: 5px; border-radius: 0 0 4px 4px; background: var(--sun); }
.tabs a:focus-visible { outline-offset: -4px; }

/* ---------- Titres de page ---------- */
.page-head { margin: 8px 0 18px; }
.page-head h1, .hello h1 { font-size: 32px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; }
.page-head p, .hello p { margin-top: 6px; color: var(--ink-2); max-width: 46ch; }
.hello { margin: 8px 0 18px; }
.list-label { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 10px; font-size: 18px; font-weight: 700; }
.list-label span { font: 600 14px var(--body); color: var(--ink-2); }
.empty, .loading { padding: 18px 0; color: var(--ink-2); }
.hint { font-size: 14px; color: var(--ink-2); }
.hint.center, .center { text-align: center; }

/* ---------- Carreaux (jauges) ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tile { display: block; flex: 1 0 18px; max-width: 30px; aspect-ratio: 1; border-radius: 5px; background: var(--blue-soft); }
.tile.lit { background: var(--sun); box-shadow: inset 0 0 0 1.5px var(--sun-edge); }
.tile.goal { outline: 2px solid var(--ink); outline-offset: 1px; }
.tile.pop { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@keyframes pop {
  from { transform: scale(.3) rotate(-20deg); background: #fff; }
  55% { transform: scale(1.45) rotate(8deg); background: #fff; box-shadow: 0 0 0 6px rgba(255, 197, 61, .35); }
}
/* Carreau gagné mais pas encore allumé : il attend que son étoile arrive. */
.tile.lit.await-star { background: var(--blue-soft); box-shadow: none; }
.gauges .tile.lit.await-star { background: rgba(255, 255, 255, .15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
.tabs a.bump svg { animation: bump .45s cubic-bezier(.3, 1.8, .5, 1); color: var(--sun-edge); }
@keyframes bump { 40% { transform: scale(1.6) rotate(-14deg); } }

.tiles-empty { font-size: 14px; opacity: .8; }

.gauges { background: var(--blue); border-radius: 22px; color: #fff; overflow: hidden; }
.gauge { display: block; padding: 18px 18px 16px; color: inherit; text-decoration: none; }
.gauge + .gauge { border-top: 1px solid rgba(255, 255, 255, .22); }
.gauge:focus-visible { outline-color: #fff; outline-offset: -5px; border-radius: 22px; }
.gauge-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gauge-head h2 { font-size: 20px; font-weight: 700; }
.gauge-count { font-size: 14px; }
.gauge-count b { font: 750 22px var(--display); }
.gauge-status { margin-top: 10px; font-size: 14px; color: #D9E0FF; }
.gauge.reached .gauge-status { color: #fff; font-weight: 600; }
.gauges .tile { background: rgba(255, 255, 255, .15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.gauges .tile.lit { background: var(--sun); box-shadow: none; }
.gauges .tile.goal { outline-color: #fff; }

/* ---------- Accueil ---------- */
.pot-summary, .block-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 16px 18px;
  background: var(--sun-soft); border-radius: 22px; color: var(--ink); text-decoration: none;
}
.pot-summary h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pot-summary p { font-size: 15px; }
.pot-summary b { font: 750 18px var(--display); }
.recent h2 { margin: 26px 0 10px; font-size: 18px; font-weight: 700; }
.feed, .tasks, .ledger, .members, .log { background: var(--paper); border-radius: 18px; overflow: hidden; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.feed li + li, .tasks li + li, .ledger li + li, .members li + li, .log li + li { border-top: 1px solid var(--bg); }
.feed-emoji { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg); font-size: 18px; }
.feed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-text b, .task-title { font-weight: 600; overflow-wrap: anywhere; }
.feed-text span, .task-meta { font-size: 13.5px; color: var(--ink-2); }

.chip-stars {
  display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 3px 8px 3px 9px; border-radius: 8px;
  background: var(--sun-soft); font: 700 15px var(--display); color: var(--ink); white-space: nowrap;
}
.chip-stars svg { color: var(--sun-edge); }

/* ---------- Listes de tâches ---------- */
.list-gauge { margin-bottom: 4px; padding: 14px 16px; background: var(--paper); border-radius: 18px; }
.list-gauge p { margin-bottom: 10px; font-size: 14.5px; color: var(--ink-2); }
.list-gauge p b { font: 750 20px var(--display); color: var(--ink); }
.list-gauge.reached p { color: var(--mint-deep); font-weight: 600; }
.task { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 6px; }
.check {
  position: relative; width: 52px; height: 52px; flex: none; border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.check::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 2.5px solid var(--blue); background: var(--paper); transition: background .15s, transform .15s; }
.check:active::before { transform: scale(.88); background: var(--blue-soft); }
.check > * { position: relative; }
.check svg { width: 20px; height: 20px; }
.check-steps { font: 700 11.5px var(--body); color: var(--blue); letter-spacing: -0.02em; }
.task.done .check::before { background: var(--mint-deep); border-color: var(--mint-deep); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 6px 8px 2px; color: inherit; text-decoration: none; }
.task-meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta:empty { display: none; }
.task.done .task-title { color: var(--ink-2); }
.task.done .task-meta { color: var(--mint-deep); }
.task.done .chip-stars { background: var(--mint); }
.task.done .chip-stars svg { color: var(--mint-deep); }
.all-done { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--mint); color: var(--mint-deep); font-weight: 600; }

/* ---------- Panneau de détail ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(21, 27, 84, .5); animation: fade .2s both; }
.sheet {
  width: min(100%, 520px); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 18px calc(22px + var(--safe-b)); background: var(--paper); border-radius: 26px 26px 0 0;
  animation: rise .26s cubic-bezier(.2, .9, .3, 1) both;
}
.sheet-wrap.settled, .sheet-wrap.settled .sheet { animation: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-head .icon-btn { margin: -6px -8px 0 0; background: var(--bg); border-radius: 50%; flex: none; }
.sheet-kind { font-size: 14px; color: var(--ink-2); }
.sheet h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.sheet-stars { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.sheet-desc { margin-top: 14px; white-space: pre-line; }
.steps { margin-top: 18px; }
.steps legend, .steps-edit legend, .segmented legend { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--bg); cursor: pointer; }
.step + .step { margin-top: 6px; }
.step input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.step-box { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 2.5px solid var(--blue); background: var(--paper); color: transparent; }
.step-box svg { width: 18px; height: 18px; }
.step input:checked + .step-box { background: var(--blue); color: #fff; }
.step input:focus-visible + .step-box { outline: 3px solid var(--ink); outline-offset: 2px; }
.step input:checked ~ .step-label { color: var(--ink-2); }
.step-label { display: flex; flex-direction: column; font-weight: 500; overflow-wrap: anywhere; }
.step-label small { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.steps:disabled .step { cursor: default; opacity: .75; }
.sheet .btn-block { margin-top: 20px; }
.sheet .hint { margin-top: 10px; }
.sheet-done { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--mint); color: var(--mint-deep); }
.sheet-done svg { flex: none; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 20px;
  border: 0; border-radius: 15px; font-weight: 650; font-size: 16.5px; text-decoration: none; text-align: center;
}
.btn svg { width: 20px; height: 20px; }
.btn-block { display: flex; width: 100%; }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 14.5px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-deep); }
.btn-quiet { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-undo { background: var(--rose-soft); color: var(--rose); }
.btn-danger { background: var(--rose); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 14.5px; font-weight: 600; }
.field small, .switch small { font-size: 13px; color: var(--ink-2); font-weight: 400; }
.field input, .field textarea, .field select, .steps-edit input {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper); font-size: 16px;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .steps-edit input:focus { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.field-row { display: flex; gap: 10px; }
.field-row .grow { flex: 1; }
.field-row .field:not(.grow) { width: 120px; flex: none; }
.field-row .field-emoji { width: 76px; }
.field-emoji input { text-align: center; font-size: 22px; padding: 8px; }
.form-error { margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--rose-soft); color: var(--rose); font-weight: 600; font-size: 14.5px; }
.block { display: block; margin-top: 14px; padding: 18px; background: var(--paper); border-radius: 20px; }
.block h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.block h2:not(:first-child) { margin-top: 20px; }
.block > p, .block .hint { margin-bottom: 14px; }
.block.block-link { display: flex; background: var(--paper); }
.block-link > svg { flex: none; color: var(--ink-2); }
.block-link p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.block-link h2 { margin-bottom: 2px; }

/* ---------- Connexion ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; background: var(--blue);
  background-image: linear-gradient(rgba(255,255,255,.07) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,.07) 2px, transparent 2px);
  background-size: 64px 64px; }
.auth-brand { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; width: min(100%, 520px); margin: 0 auto; padding: 56px 24px 28px; color: #fff; }
.auth-brand img { border-radius: 16px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.auth-brand h1 { margin-top: 18px; font-size: min(64px, 14vw); font-weight: 800; letter-spacing: -0.04em; line-height: .95; }
.auth-brand p { margin-top: 10px; font-size: 18px; color: #D9E0FF; max-width: 28ch; }
.auth-form { width: min(100%, 520px); margin: 0 auto; padding: 26px 22px calc(28px + var(--safe-b)); background: var(--bg); border-radius: 28px 28px 0 0; }
.auth-form h2 { font-size: 24px; font-weight: 750; margin-bottom: 14px; }
.auth-form .hint { margin: 0 0 16px; }
.auth-form .btn + .hint { margin: 16px 0 0; text-align: center; }
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; color: var(--ink-2); }
.splash img { border-radius: 18px; }

/* ---------- Étoiles ---------- */
.pot { padding: 18px; background: var(--blue); color: #fff; border-radius: 22px; }
.pot-figures { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.pot-main b { display: block; font: 800 60px/0.9 var(--display); letter-spacing: -0.03em; color: var(--sun); }
.pot-main span { display: block; margin-top: 6px; font-weight: 600; }
.pot-side { text-align: right; font-size: 15px; }
.pot-side b { font: 750 22px var(--display); }
.pot-side small { display: block; color: #D9E0FF; font-size: 12.5px; white-space: nowrap; }
.hundred { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.pot .tile { max-width: none; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); border-radius: 6px; }
.pot .tile.lit { background: var(--sun); box-shadow: none; }
.pot .tile.wait { background: repeating-linear-gradient(135deg, var(--sun) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--sun); }
.pot-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: #D9E0FF; }
.pot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pot-legend .tile { width: 14px; flex: none; border-radius: 4px; }
.pot-next { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.22); font-size: 15px; }
.facts { margin: 12px 0; background: var(--paper); border-radius: 18px; overflow: hidden; }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 16px; }
.facts div + div { border-top: 1px solid var(--bg); }
.facts dt { color: var(--ink-2); font-size: 14.5px; }
.facts dd { font-weight: 650; text-align: right; }
.ledger li, .ledger-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ledger li { padding: 12px 14px; }
.ledger li:has(.ledger-link) { padding: 0; }
.ledger-link { width: 100%; padding: 12px 8px 12px 14px; color: inherit; text-decoration: none; }
.ledger li > div:first-child, .ledger-link > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.ledger b { font-weight: 600; overflow-wrap: anywhere; }
.ledger span { font-size: 13.5px; color: var(--ink-2); }
.ledger-right { display: flex; align-items: center; gap: 8px; flex: none; }
.ledger-right svg { color: var(--ink-2); }
.ledger .chip-stars svg { color: var(--sun-edge); }
.ledger .count { font: 700 16px var(--display); }
.ledger .tag-ok { color: var(--mint-deep); font-weight: 600; }
.ledger .tag-wait { color: var(--ink-2); }
.ledger li.paused b { color: var(--ink-2); }

/* ---------- Admin ---------- */
.admin-nav { display: flex; gap: 6px; margin: 0 -16px 14px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { flex: none; padding: 9px 14px; border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.admin-nav a[aria-current] { background: var(--ink); color: #fff; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-gauge { padding: 14px; background: var(--paper); border-radius: 18px; }
.stat-gauge h2 { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.stat-gauge p { margin: 2px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.stat-gauge p b { display: block; font: 800 30px/1.1 var(--display); color: var(--ink); }
.stat-gauge .tile { flex-basis: 12px; border-radius: 4px; }
.chart { margin-top: 12px; padding: 16px; background: var(--paper); border-radius: 18px; }
.chart h2 { font-size: 18px; font-weight: 700; }
.chart-note { margin: 2px 0 14px; font-size: 13.5px; color: var(--ink-2); }
.bars { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; height: 190px; align-items: end; }
.bars li { display: grid; grid-template-rows: 18px 1fr 18px 14px; height: 100%; justify-items: center; align-items: end; min-width: 0; }
.bar { width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--blue); }
.bars li.goal .bar { background: var(--sun); box-shadow: inset 0 0 0 1.5px var(--sun-edge); }
.bar-value { font: 700 12px var(--body); align-self: end; }
.bar-label { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; align-self: center; }
.bar-goal { font-size: 11px; line-height: 1; color: var(--sun-edge); }

.form .btn-block + .btn-block { margin-top: 10px; }
.segmented { margin-bottom: 14px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented legend { grid-column: 1 / -1; font: 600 14.5px var(--body); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: grid; place-items: center; min-height: 48px; border-radius: 13px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: 15px; cursor: pointer; }
.segmented input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.segmented input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 52px; min-height: 50px; border: 0; border-radius: 13px; background: var(--blue-soft); font: 700 22px var(--display); color: var(--blue-deep); }
.stepper input { width: 84px; text-align: center; font: 700 20px var(--display); }
.steps-edit { margin: 4px 0 18px; }
.steps-edit legend { font: 600 14.5px var(--body); }
.steps-edit li { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.steps-edit li input { flex: 1; min-width: 0; margin-right: 2px; }
.steps-edit .icon-btn { width: 38px; }
.step-num { width: 22px; flex: none; font: 700 15px var(--display); color: var(--ink-2); }
.steps-edit .hint { margin-bottom: 10px; }
.switch { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 52px; height: 32px; flex: none; border-radius: 16px; background: var(--line); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--mint-deep); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--ink); outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filters button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 12px; background: var(--paper); font-weight: 600; font-size: 14.5px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.log li { padding: 11px 14px 11px 18px; position: relative; }
.log li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line); }
.log .log-done::before { background: var(--mint-deep); }
.log .log-undo::before { background: var(--rose); }
.log .log-stars::before { background: var(--sun); }
.log time { font-size: 12.5px; color: var(--ink-2); }
.log p { overflow-wrap: anywhere; }
.log + .btn { margin-top: 12px; }

.members li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.member-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-text b { font-weight: 600; overflow-wrap: anywhere; }
.member-text span { font-size: 13.5px; color: var(--ink-2); }
.members .member-edit { display: block; padding: 16px 14px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--blue); border-radius: 18px; }
.member-edit .btn-block { margin-top: 10px; }
.account .btn-block { margin-top: 18px; }
.account > .hint { margin-top: 14px; }

/* ---------- Toasts et dialogues ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); transform: translateX(-50%); z-index: 40;
  width: min(calc(100% - 24px), 496px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 16px; background: var(--ink); color: #fff;
  box-shadow: 0 8px 24px rgba(21, 27, 84, .28); pointer-events: auto; animation: rise .22s both; }
.toast.leaving { opacity: 0; transition: opacity .2s; }
.toast-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14.5px; }
.toast-text strong { font: 650 15.5px var(--display); }
.toast-text span { color: #D9E0FF; overflow-wrap: anywhere; }
.toast-done { background: var(--mint-deep); }
.toast-done .toast-text span { color: #D6F3E4; }
.toast-goal { background: var(--sun); color: var(--ink); }
.toast-goal .toast-text span { color: var(--ink); }
.toast-error { background: var(--rose); }
.toast-error .toast-text span { color: #fff; }
.toast-action { flex: none; min-height: 40px; padding: 6px 14px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .2); color: inherit; font-weight: 700; }
.toast-action:focus-visible { outline-color: #fff; }

dialog.confirm { width: min(calc(100% - 32px), 420px); padding: 22px; border: 0; border-radius: 22px; color: var(--ink); background: var(--paper); }
dialog.confirm::backdrop { background: rgba(21, 27, 84, .5); }
dialog.confirm h2 { font-size: 21px; font-weight: 750; margin-bottom: 8px; }
dialog.confirm p { color: var(--ink-2); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

@media (min-width: 560px) {
  body { background: #E3E9F8; }
  .shell { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
  .sheet { border-radius: 26px; margin-bottom: 24px; }
  .sheet-wrap { align-items: center; }
  .auth-form { border-radius: 28px; margin-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
