/* Cap : objectifs en grille 3 par 3. Minimalisme editorial : monochrome chaud, pastels semantiques, aucune ombre lourde. */
:root {
  --bg: #f7f6f3; --surface: #ffffff; --surface-2: #f1f0ec; --line: #eaeaea; --line-2: #dcdbd6;
  --ink: #2f3437; --ink-strong: #111111; --muted: #787774; --on-ink: #ffffff;
  --btn: #111111; --btn-hover: #333333; --btn-text: #ffffff;
  --ok-bg: #edf3ec; --ok-fg: #346538; --warn-bg: #fbf3db; --warn-fg: #956400;
  --info-bg: #e1f3fe; --info-fg: #1f6c9f; --bad-bg: #fdebec; --bad-fg: #9f2f2d;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --surface: #1d1d1b; --surface-2: #252523; --line: #2c2c29; --line-2: #3a3a36;
    --ink: #d9d8d3; --ink-strong: #f2f1ed; --muted: #9b9a95; --on-ink: #151514;
    --btn: #ecebe8; --btn-hover: #ffffff; --btn-text: #111111;
    --ok-bg: #1f2a1f; --ok-fg: #9fcf9f; --warn-bg: #2e2812; --warn-fg: #e6c36a;
    --info-bg: #14262f; --info-fg: #7cc0e6; --bad-bg: #321a1b; --bad-fg: #eb9b98;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --surface: #1d1d1b; --surface-2: #252523; --line: #2c2c29; --line-2: #3a3a36;
  --ink: #d9d8d3; --ink-strong: #f2f1ed; --muted: #9b9a95; --on-ink: #151514;
  --btn: #ecebe8; --btn-hover: #ffffff; --btn-text: #111111;
  --ok-bg: #1f2a1f; --ok-fg: #9fcf9f; --warn-bg: #2e2812; --warn-fg: #e6c36a;
  --info-bg: #14262f; --info-fg: #7cc0e6; --bad-bg: #321a1b; --bad-fg: #eb9b98;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; border-radius: 4px; }

.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px)); min-height: 100dvh; }
.vue { padding-top: calc(20px + env(safe-area-inset-top, 0px)); display: grid; gap: 24px; align-content: start; }
.vue > * { animation: entree 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* typographie */
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
.titre { font: 500 32px/1.1 var(--serif); letter-spacing: -0.025em; color: var(--ink-strong); }
.sous-titre { font: 500 22px/1.2 var(--serif); letter-spacing: -0.02em; color: var(--ink-strong); }
.etiquette { font: 500 11px/1 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.discret { color: var(--muted); font-size: 13.5px; }
.lead { max-width: 56ch; color: var(--muted); margin: 6px 0 0; }

/* entete de vue */
.entete { display: grid; gap: 10px; }
.retour { max-width: 100%; text-align: left; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--muted); font-size: 13.5px; width: fit-content; }
.retour:hover { color: var(--ink-strong); }
.retour-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-text); font-weight: 500; transition: transform 160ms var(--ease), background 160ms; }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.second { background: transparent; color: var(--ink-strong); border-color: var(--line-2); }
.btn.second:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--bad-fg); border-color: var(--line-2); }
.btn.bloc { width: 100%; }
.btn.petit { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.icone-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-strong); }
.icone-btn:hover { background: var(--surface-2); }
.ico { width: 18px; height: 18px; flex: none; }

/* cartes et listes */
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.liste-objectifs { display: grid; gap: 12px; }
.objectif { display: grid; gap: 14px; padding: 20px; text-align: left; width: 100%; transition: border-color 200ms, transform 200ms var(--ease); }
.objectif:hover { border-color: var(--line-2); }
.objectif:active { transform: scale(0.99); }
.objectif .nom { font: 500 20px/1.25 var(--serif); letter-spacing: -0.015em; color: var(--ink-strong); }
.barre { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.barre > i { display: block; height: 100%; background: var(--ink-strong); transform-origin: left; transition: transform 600ms var(--ease); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* pastilles (seul endroit ou le pill est permis) */
.pastille { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 9999px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pastille.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pastille.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pastille.info { background: var(--info-bg); color: var(--info-fg); }
.pastille.bad { background: var(--bad-bg); color: var(--bad-fg); }
.pastille .ico { width: 12px; height: 12px; }

/* grille 3 par 3 */
.mandala { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; container-type: inline-size; }
.cell { position: relative; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: border-color 180ms, transform 180ms var(--ease), background 180ms; animation: entree 480ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.cell:hover { border-color: var(--line-2); }
.cell:active { transform: scale(0.97); }
.cell .txt { flex: 1; min-height: 0; font-size: 12px; line-height: 1.25; color: var(--ink-strong); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
@container (min-width: 440px) { .cell .txt { font-size: 14px; -webkit-line-clamp: 6; } .cell { padding: 14px; } }
.cell .pied { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 18px; color: var(--muted); font: 500 10.5px/1 var(--mono); }
.cell.vide { border-style: dashed; border-color: var(--line-2); background: transparent; align-items: center; justify-content: center; color: var(--muted); }
.cell.vide .ico { width: 20px; height: 20px; }
.cell.centre { background: var(--ink-strong); border-color: var(--ink-strong); cursor: default; }
.cell.centre { justify-content: center; }
.cell.centre .txt { flex: 0 1 auto; color: var(--on-ink); font: 500 13.5px/1.25 var(--serif); letter-spacing: -0.01em; -webkit-line-clamp: 5; }
@container (min-width: 440px) { .cell.centre .txt { font-size: 17px; -webkit-line-clamp: 6; } }
.cell.centre:active { transform: none; }
.cell.fait { background: var(--ok-bg); border-color: transparent; }
.cell.fait .txt { color: var(--ok-fg); text-decoration: line-through; text-decoration-thickness: 1px; }
.cell .marques { display: flex; gap: 4px; align-items: center; }
.cell .marques .ico { width: 14px; height: 14px; }
.cell .etoile { color: var(--warn-fg); }
.cell .coche { color: var(--ok-fg); }

/* segmented */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; background: var(--surface-2); gap: 2px; }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink-strong); font-weight: 500; }
.seg .point { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.seg .point.on { background: var(--ok-fg); }

/* liste d'actions */
.rangees { display: grid; }
.rangee { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rangee:first-child { border-top: 1px solid var(--line); }
.rangee .corps { min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.rangee .corps .t { color: var(--ink-strong); overflow-wrap: anywhere; }
.rangee .corps .t.fait { text-decoration: line-through; color: var(--muted); }
.rangee .corps .ctx { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.case { width: 24px; height: 24px; margin-top: 1px; border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface); display: grid; place-items: center; color: transparent; padding: 0; }
.case[aria-pressed="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--on-ink); }
.case .ico { width: 14px; height: 14px; }
.groupe { display: grid; gap: 4px; }

/* formulaires et feuilles */
.champ { display: grid; gap: 6px; }
.champ label { font-size: 13px; color: var(--muted); }
.champ input, .champ textarea { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; min-height: 44px; }
.champ textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--ink-strong); outline-offset: 0; border-color: transparent; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0; background: none; border: 0; width: 100%; text-align: left; }
.interrupteur .rail { width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background 180ms; flex: none; }
.interrupteur .rail::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform 220ms var(--ease); }
.interrupteur[aria-pressed="true"] .rail { background: var(--ink-strong); }
.interrupteur[aria-pressed="true"] .rail::after { transform: translateX(16px); background: var(--on-ink); }
.indice { padding: 10px 12px; border-radius: 6px; font-size: 13px; background: var(--warn-bg); color: var(--warn-fg); display: flex; gap: 8px; align-items: flex-start; }
.indice.erreur { background: var(--bad-bg); color: var(--bad-fg); }
.indice .ico { margin-top: 2px; width: 14px; height: 14px; }

.voile { position: fixed; inset: 0; z-index: 30; background: rgba(17, 17, 17, 0.38); display: flex; align-items: flex-end; justify-content: center; animation: fondu 220ms ease both; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.feuille { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 18px; animation: monte 380ms var(--ease) both; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.feuille .tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feuille .actions { display: grid; gap: 10px; }
@media (min-width: 640px) { .voile { align-items: center; } .feuille { border-radius: 16px; } }

.proposition { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: 100%; text-align: left; }
.proposition[aria-pressed="true"] { border-color: var(--ink-strong); }
.proposition .case { margin-top: 0; }
.attente { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.rond { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--ink-strong); border-radius: 50%; animation: tour 800ms linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }

/* navigation basse */
.nav { position: fixed; inset: auto 0 0 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.nav a { display: grid; justify-items: center; gap: 4px; padding: 10px 0 9px; min-height: 56px; color: var(--muted); text-decoration: none; font-size: 11.5px; position: relative; }
.nav a[aria-current="page"] { color: var(--ink-strong); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--ink-strong); }
.nav .compteur { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink-strong); color: var(--on-ink); font: 500 10px/16px var(--mono); text-align: center; }

.vide-etat { padding: 32px 4px; display: grid; gap: 14px; }
.etapes { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: e; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: baseline; }
.etapes li::before { content: counter(e); font: 500 12px/1 var(--mono); color: var(--muted); }
.etapes b { color: var(--ink-strong); font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--ink-strong); color: var(--on-ink); padding: 10px 16px; border-radius: 6px; font-size: 13.5px; max-width: calc(100% - 32px); animation: entree 300ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* v2 : loupe, report, toast avec action, case cochee dans les propositions */
.icone-btn.mini { width: 36px; height: 36px; border-color: transparent; color: var(--muted); }
.icone-btn.mini:hover { color: var(--ink-strong); background: var(--surface-2); }
.icone-btn.mini.plein { color: var(--info-fg); }
.lien-corps { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; }
.etoile-inline { color: var(--warn-fg); margin-right: 6px; display: inline-flex; vertical-align: -2px; }
.etoile-inline .ico { width: 14px; height: 14px; }
.reporter { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12.5px; }
.reporter:hover { color: var(--ink-strong); }
.reporter .ico { width: 14px; height: 14px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-action { background: none; border: 0; color: var(--on-ink); font-weight: 600; text-decoration: underline; padding: 6px 0; }
.proposition .case[aria-pressed="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--on-ink); }
.proposition[aria-pressed="true"] { background: var(--surface-2); }
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }
