/* Dispatch, piste A « Cartes » : une mosaïque de cartes souples. */
:root {
  --fond: #F7F2EB; --surf: #FFFFFF; --surf2: #FBF8F4; --txt: #2A2420; --doux: #655B52; --ligne: #E6DDD1;
  --acc: #C2410C; --on-acc: #FFFFFF; --bulle: #E8590C; --on-bulle: #FFFFFF; --acc-doux: #FBE3D6;
  --ok: #1F7A3A; --ko: #B42318; --ko-bg: #FDE3DF; --focus: #1D4ED8; --etoile: #C25E00; --puce-bg: #EFE8DE; --scrim: rgba(24, 16, 8, .5);
  --ombre: 0 1px 3px rgba(60, 40, 20, .10), 0 8px 22px rgba(60, 40, 20, .08); --ombre-g: 0 12px 40px rgba(40, 24, 8, .28);
  --t0: #FDE6DC; --t1: #FDF0C4; --t2: #E1F0DF; --t3: #D9EEF5; --t4: #E7E2F8; --t5: #FADFEA; --t6: #DDE8FB; --t7: #EDE6D8;
  --r: 22px; --nav-h: 64px; --vvh: 100dvh;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #171412; --surf: #26211E; --surf2: #2D2825; --txt: #F5EFE8; --doux: #C8BDB2; --ligne: #3F3732;
    --acc: #FB923C; --on-acc: #1C1410; --bulle: #F97316; --on-bulle: #1C1410; --acc-doux: #4A2E1C;
    --ok: #6EE7A0; --ko: #FFB4AB; --ko-bg: #5A2A25; --focus: #93C5FD; --etoile: #FBBF24; --puce-bg: #3A322D; --scrim: rgba(0, 0, 0, .62);
    --ombre: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .35); --ombre-g: 0 12px 40px rgba(0, 0, 0, .6);
    --t0: #4A2F27; --t1: #473E1F; --t2: #2C3E2E; --t3: #264049; --t4: #38324F; --t5: #4A2E3B; --t6: #2B3A55; --t7: #3C382F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #171412; --surf: #26211E; --surf2: #2D2825; --txt: #F5EFE8; --doux: #C8BDB2; --ligne: #3F3732;
  --acc: #FB923C; --on-acc: #1C1410; --bulle: #F97316; --on-bulle: #1C1410; --acc-doux: #4A2E1C;
  --ok: #6EE7A0; --ko: #FFB4AB; --ko-bg: #5A2A25; --focus: #93C5FD; --etoile: #FBBF24; --puce-bg: #3A322D; --scrim: rgba(0, 0, 0, .62);
  --ombre: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .35); --ombre-g: 0 12px 40px rgba(0, 0, 0, .6);
  --t0: #4A2F27; --t1: #473E1F; --t2: #2C3E2E; --t3: #264049; --t4: #38324F; --t5: #4A2E3B; --t6: #2B3A55; --t7: #3C382F;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--txt); font: 500 16px/1.4 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; overflow-wrap: break-word; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.ico { flex: none; }
.teinte-0 { background: var(--t0); } .teinte-1 { background: var(--t1); } .teinte-2 { background: var(--t2); } .teinte-3 { background: var(--t3); }
.teinte-4 { background: var(--t4); } .teinte-5 { background: var(--t5); } .teinte-6 { background: var(--t6); } .teinte-7 { background: var(--t7); }

/* ───── Cadre ───── */
#app { height: 100dvh; display: flex; flex-direction: column; }
#colonne { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
#haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 6px 16px; min-height: 60px; }
.haut-g { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
h1.titre-haut { font-size: 21px; display: block; white-space: normal; line-height: 1.15; padding: 4px 0; min-height: 0; }
.rang-b--pied { flex-wrap: nowrap; }
.rang-b--pied .btn { padding: 0 14px; white-space: nowrap; }
.tuiles-h--3 .val { font-size: 21px; white-space: nowrap; }
.haut-d { display: flex; align-items: center; gap: 8px; flex: none; }
.titre-haut { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; min-height: 44px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.titre-haut { text-align: left; }
#haut .btn-ico--retour { margin-left: -10px; }
.tour { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--doux); background: var(--surf); border-radius: 999px; padding: 6px 11px 6px 9px; min-height: 32px; box-shadow: var(--ombre); white-space: nowrap; }
.tour i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.tour--hors { color: var(--ko); background: var(--ko-bg); }
.tour--hors i { background: var(--ko); }
.btn-ico { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--txt); flex: none; }
.btn-ico:hover { background: var(--puce-bg); }
.btn-ico--rond { background: var(--surf); box-shadow: var(--ombre); }
#vue { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.defile { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 16px 150px; overscroll-behavior: contain; }
.ecran { max-width: 1100px; margin: 0 auto; }
#nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); display: flex; background: var(--surf); box-shadow: 0 -2px 18px rgba(60, 40, 20, .10); }
.nav-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--doux); font-size: 12px; font-weight: 700; min-height: 44px; text-align: center; }
.nav-b[aria-current="page"] { color: var(--acc); }
.nav-i { position: relative; display: inline-flex; padding: 3px 18px; border-radius: 999px; }
.nav-b[aria-current="page"] .nav-i { background: var(--acc-doux); }
.pastille { position: absolute; top: -4px; right: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ko); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .pastille { color: #1C1410; background: #FFB4AB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pastille { color: #1C1410; background: #FFB4AB; } }

.micro { position: fixed; z-index: 60; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bulle); color: var(--on-bulle); box-shadow: 0 6px 20px rgba(194, 65, 12, .45); transition: box-shadow .2s; }
.micro--bulle { right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); width: 64px; height: 64px; }
.micro--fil, .micro--dictee { width: 76px; height: 76px; }
.micro--carte { width: 44px; height: 44px; box-shadow: none; }
.micro--cache { visibility: hidden; }
.micro.ecoute { background: var(--ko); color: #fff; animation: pulse 1.2s infinite; }
:root[data-theme="dark"] .micro.ecoute { color: #1C1410; background: #FFB4AB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .micro.ecoute { color: #1C1410; background: #FFB4AB; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .5); } 100% { box-shadow: 0 0 0 18px rgba(180, 35, 24, 0); } }
.micro-creux { display: block; width: 76px; height: 76px; margin: 0 auto; }
.micro-creux--carte { width: 44px; height: 44px; }
.stop-lecture { position: fixed; z-index: 65; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; min-height: 44px; border-radius: 999px; background: var(--ko); color: #fff; font-weight: 800; box-shadow: var(--ombre-g); }
:root[data-theme="dark"] .stop-lecture { background: #FFB4AB; color: #1C1410; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stop-lecture { background: #FFB4AB; color: #1C1410; } }
#toasts { position: fixed; z-index: 70; left: 0; right: 0; bottom: calc(var(--nav-h) + 88px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #2A2420; color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 700; box-shadow: var(--ombre-g); max-width: 420px; animation: monte .2s ease-out; }
.toast button { color: #FFB27A; font-weight: 800; min-height: 44px; padding: 0 6px; }
:root[data-theme="dark"] .toast { background: #F5EFE8; color: #1C1410; } :root[data-theme="dark"] .toast button { color: #9A3412; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #F5EFE8; color: #1C1410; } :root:not([data-theme="light"]) .toast button { color: #9A3412; } }
.banniere { position: fixed; z-index: 90; top: 12px; left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 24px)); display: flex; gap: 10px; align-items: center; background: var(--surf); color: var(--txt); border-radius: 18px; padding: 12px 14px; box-shadow: var(--ombre-g); animation: descend .25s ease-out; }
.b-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bulle); color: var(--on-bulle); display: flex; align-items: center; justify-content: center; flex: none; }
@keyframes monte { from { transform: translateY(10px); opacity: 0; } }
@keyframes descend { from { transform: translate(-50%, -14px); opacity: 0; } }

/* Rail à gauche sur écran large (768 px et plus) */
@media (min-width: 760px) {
  #colonne { padding-bottom: 0; margin-left: 96px; }
  #nav { top: 0; right: auto; bottom: 0; width: 96px; height: auto; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 72px 8px 80px; box-shadow: 2px 0 18px rgba(60, 40, 20, .08); }
  .nav-b { flex: none; padding: 8px 0; }
  [data-reglages] { position: fixed; left: 26px; bottom: 22px; z-index: 41; }
  .micro--bulle { bottom: 24px; right: 28px; }
  .defile { padding: 0 104px 120px 28px; }
  #haut { padding: 14px 28px 6px; }
  .stop-lecture { bottom: 100px; }
  #toasts { bottom: 100px; }
}

/* ───── Boutons communs ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surf2); border: 1.5px solid var(--ligne); font-weight: 800; color: var(--txt); text-align: center; }
.btn:hover { background: var(--puce-bg); }
.btn--go { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.btn--go:hover { background: var(--acc); filter: brightness(1.08); }
.btn--go[disabled], .btn[disabled] { opacity: .5; cursor: default; }
.btn--texte { background: none; border-color: transparent; color: var(--doux); }
.btn--doux { background: var(--acc-doux); border-color: transparent; color: var(--txt); }
.btn--danger { color: var(--ko); }
.btn--danger-plein { background: var(--ko); border-color: var(--ko); color: #fff; }
:root[data-theme="dark"] .btn--danger-plein { color: #1C1410; background: #FFB4AB; border-color: #FFB4AB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--danger-plein { color: #1C1410; background: #FFB4AB; border-color: #FFB4AB; } }
.btn--petit { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn--grand { width: 100%; min-height: 52px; font-size: 17px; }
.lien { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px; font-weight: 800; color: var(--acc); }
.lien--bouton { border-radius: 999px; padding: 0 14px; background: var(--surf); box-shadow: var(--ombre); }
.lien--bouton[aria-pressed="true"] { background: var(--acc); color: var(--on-acc); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surf2); border: 1.5px solid var(--ligne); font-weight: 800; }
.chip:hover { background: var(--puce-bg); }
.chip--go { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.chip--autre { background: none; border-style: dashed; color: var(--doux); }
.chip[aria-pressed="true"] { background: var(--acc-doux); border-color: var(--acc); }
.pastilles { display: flex; gap: 8px; margin: 22px 0 14px; }
.pastille-p { min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--surf); box-shadow: var(--ombre); font-weight: 800; color: var(--doux); }
.pastille-p[aria-pressed="true"] { background: var(--acc); color: var(--on-acc); }
.pastille-p--grande { flex: 1; text-align: center; }
.err { color: var(--ko); font-weight: 700; min-height: 0; }
.err:empty { display: none; }
.aide { color: var(--doux); font-size: 14px; margin: 4px 0 10px; }
.rien { color: var(--doux); font-weight: 700; padding: 10px 2px 14px; }
.vide { color: var(--doux); padding: 20px 0; }
.calme-msg { text-align: center; padding: 40px 12px; }
.date { color: var(--doux); font-weight: 700; margin: 0 0 12px; }
.erreur { text-align: center; padding: 40px 12px; display: flex; flex-direction: column; gap: 14px; align-items: center; font-weight: 700; }
.sous-t { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); font-weight: 800; margin: 18px 2px 8px; display: flex; align-items: center; gap: 6px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2.5px solid var(--ligne); border-top-color: var(--acc); border-radius: 50%; animation: tourne 1s linear infinite; margin-right: 8px; vertical-align: -2px; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ───── Aujourd'hui (E01) ───── */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.carte-a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; border-radius: var(--r); box-shadow: var(--ombre); min-height: 148px; background: var(--t3); }
.carte-a--decider { background: var(--t0); }
.carte-a--ranger { background: var(--t4); }
.carte-a.calme { opacity: .75; }
.carte-a .compte { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.carte-a .lib { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.carte-a .apercu-t { font-size: 14px; font-weight: 700; color: var(--txt); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-a .apercu-r { font-size: 13px; color: var(--doux); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bloc { margin-top: 24px; }
.bloc-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bloc-t h2 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.bloc-t h2 .ico { color: var(--etoile); }
.rang-cadre { position: relative; margin: 0 -16px; }
.rang-cadre::after { content: ""; position: absolute; top: 0; right: 0; bottom: 12px; width: 28px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--fond)); }
.rang { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 14px; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; align-items: stretch; }
.rang::-webkit-scrollbar { display: none; }
.rang > * { scroll-snap-align: start; flex: none; }
.carte-rap { width: 160px; display: flex; flex-direction: column; gap: 2px; background: var(--surf); border-radius: 20px; padding: 12px 14px 14px; box-shadow: var(--ombre); }
.carte-rap.premiere { background: var(--acc-doux); }
.carte-rap .jour { font-size: 12px; font-weight: 800; color: var(--doux); text-transform: none; }
.carte-rap .heure { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.carte-rap .t { font-size: 14px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.carte-rap--plus { justify-content: center; background: none; box-shadow: none; border: 2px dashed var(--ligne); }
.vide-rang { align-self: center; color: var(--doux); font-weight: 700; padding: 8px 4px; white-space: nowrap; }
.puce-retard { align-self: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--ko-bg); color: var(--ko); font-weight: 800; white-space: nowrap; }
.bloc-retard { background: var(--surf); border-radius: var(--r); padding: 4px 6px; box-shadow: var(--ombre); margin-top: 4px; }
.carte-imp { width: 168px; display: flex; flex-direction: column; gap: 4px; border-radius: 20px; padding: 12px 14px; box-shadow: var(--ombre); }
.carte-imp .e { color: var(--etoile); }
.carte-imp .t { font-size: 15px; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.carte-imp .d { font-size: 12px; color: var(--doux); font-weight: 700; margin-top: auto; }
.carte-imp--plus { justify-content: center; background: none; box-shadow: none; border: 2px dashed var(--ligne); }
.calme-bloc { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.calme-ico { width: 80px; height: 80px; border-radius: 50%; background: var(--t2); display: flex; align-items: center; justify-content: center; }
.calme-t { font-size: 24px; font-weight: 800; }
.calme-s { color: var(--doux); max-width: 300px; }
@media (min-width: 760px) {
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
  .rang-cadre { margin: 0; } .rang { padding-left: 0; padding-right: 0; scroll-padding: 0; }
  .poignee { display: none; }
}

/* ───── Lignes de tâche ───── */
.ligne { display: flex; align-items: center; min-height: 56px; }
.case { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.rond { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--doux); display: inline-flex; align-items: center; justify-content: center; color: var(--on-acc); transition: background .15s; }
.case:hover .rond { border-color: var(--acc); }
.case[aria-pressed="true"] .rond { background: var(--ok); border-color: var(--ok); color: #fff; }
:root[data-theme="dark"] .case[aria-pressed="true"] .rond { color: #1C1410; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .case[aria-pressed="true"] .rond { color: #1C1410; } }
.ligne-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 4px; min-height: 44px; justify-content: center; }
.ligne .titre { font-weight: 700; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.ligne--fait .titre { text-decoration: line-through; color: var(--doux); }
.ligne--neuve { animation: apparait .25s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; background: var(--puce-bg); color: var(--doux); max-width: 100%; }
.puce--rappel { background: var(--acc-doux); color: var(--txt); }
.puce--retard { background: var(--ko-bg); color: var(--ko); }
.etoile { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--doux); opacity: .6; }
.etoile.on { color: var(--etoile); opacity: 1; }
.etoile:hover { opacity: 1; }
.ligne-gestes { display: flex; gap: 6px; flex: none; }
.lignes, .bloc-lignes { display: flex; flex-direction: column; }
.bloc-lignes { background: var(--surf); border-radius: var(--r); padding: 4px 6px; box-shadow: var(--ombre); }
.groupe { margin-top: 18px; }
.groupe-t { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 4px; background: var(--fond); font-size: 15px; font-weight: 800; text-transform: none; }
.groupe-t b { background: var(--puce-bg); color: var(--doux); border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.groupe-t--bouton { width: 100%; }
.groupe-t--bouton .ico { margin-left: auto; transition: transform .15s; }
.groupe-t--bouton[aria-expanded="true"] .ico, .repli[aria-expanded="true"] .ico { transform: rotate(90deg); }
.groupe--retard .groupe-t { color: var(--ko); }
.repli { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; margin-top: 10px; font-weight: 800; color: var(--doux); }
.carte-jour { background: var(--surf); border-radius: var(--r); padding: 10px 8px 6px; margin-bottom: 12px; box-shadow: var(--ombre); }
.carte-jour h3 { font-size: 15px; font-weight: 800; padding: 0 8px 2px; }
.carte-jour .bloc-lignes { box-shadow: none; padding: 0; background: none; }
.carte-jour--retard { background: var(--ko-bg); }

/* ───── Mosaïque ───── */
.mosaique { display: flex; gap: 12px; align-items: flex-start; }
.mosaique .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tuile { position: relative; border-radius: var(--r); box-shadow: var(--ombre); padding: 14px 12px 12px 14px; display: flex; flex-direction: column; }
.tuile-ouvrir { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; min-height: 44px; }
.tuile-ouvrir::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.tuile .t { font-size: 18px; font-weight: 800; line-height: 1.2; padding-right: 30px; overflow-wrap: break-word; }
.tuile .s { font-size: 13.5px; font-weight: 700; color: var(--doux); display: inline-flex; align-items: center; gap: 4px; }
.minis { display: flex; flex-direction: column; margin: 6px -6px 0 -10px; }
.mini { display: flex; align-items: center; min-height: 44px; }
.mini-t { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; padding: 2px 0; }
.mini-e { color: var(--etoile); padding: 0 6px; display: inline-flex; }
.case--mini .rond { width: 22px; height: 22px; border-width: 2px; }
.tuile .plus { font-size: 13px; font-weight: 800; color: var(--doux); padding: 2px 2px 2px 0; }
.tuile--vide { background: none !important; border: 2.5px dashed var(--ligne); box-shadow: none; padding: 0; min-height: 88px; }
.tuile--vide .tuile-ouvrir { flex-direction: row; align-items: center; justify-content: center; gap: 8px; font-weight: 800; color: var(--doux); text-align: center; padding: 22px 12px; }
.tuile--vide .tuile-ouvrir::after { border-radius: var(--r); }
.tuile--finie { opacity: .72; box-shadow: none; padding: 12px 14px; }
.tuile--finie .t { font-size: 16px; }
.tuile--nouvelle { flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-height: 76px; background: none; border: 2.5px dashed var(--ligne); box-shadow: none; font-weight: 800; color: var(--doux); text-align: center; width: 100%; }
.pin { position: absolute; top: 6px; right: 6px; z-index: 3; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--doux); }
.pin.on { color: var(--acc); }
.pin[disabled] { pointer-events: none; }
.tuile .pin[disabled] { top: 2px; right: 2px; }
.mosaique .tuile[data-glisser] { touch-action: none; cursor: grab; animation: tremble .32s ease-in-out infinite alternate; }
@keyframes tremble { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
.tuile.glisse { z-index: 20; animation: none !important; box-shadow: var(--ombre-g); cursor: grabbing; }
.tuile.survol { outline: 3px dashed var(--acc); outline-offset: 3px; }
.tuile-projet .tuile-ouvrir { flex-direction: row; align-items: center; gap: 12px; }
.tuile-projet .bloc-p { display: flex; flex-direction: column; min-width: 0; }
.tuile-projet.calme { opacity: .72; }
.grille-projets { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.anneau { position: relative; width: 60px; height: 60px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.anneau svg { position: absolute; inset: 0; }
.anneau circle { fill: none; stroke-width: 6; }
.a-fond { stroke: rgba(120, 100, 80, .25); } .a-arc { stroke: var(--acc); stroke-linecap: round; }
.anneau b { font-size: 18px; font-weight: 800; }
.cadenas { display: inline-flex; color: var(--doux); vertical-align: -2px; }
.tuile-tout { border-radius: var(--r); background: var(--t6); box-shadow: var(--ombre); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.tuile-tout .tuile-ouvrir { gap: 2px; }
.tuile-tout .t { font-size: 22px; padding: 0; } .tuile-tout .s { font-size: 15px; }
.histo { display: flex; gap: 6px; align-items: flex-end; }
.hb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.hb b { font-size: 15px; font-weight: 800; } .hb i { display: block; width: 100%; max-width: 40px; background: var(--acc); border-radius: 8px 8px 3px 3px; } .hb em { font-style: normal; font-size: 11px; color: var(--doux); font-weight: 700; line-height: 1.1; }
@media (min-width: 640px) { .grille-projets { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .grille-projets { grid-template-columns: repeat(3, 1fr); } }

/* ───── À décider, À ranger ───── */
.pile { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }
.pile--sourdine { margin-top: 18px; opacity: .8; }
.carte-dec { background: var(--surf); border-radius: var(--r); padding: 16px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 10px; }
.carte-dec h3 { font-size: 18px; font-weight: 800; }
.carte-dec .resume { color: var(--doux); font-weight: 600; }
.carte-dec--sourdine { background: var(--surf2); box-shadow: none; border: 1.5px dashed var(--ligne); }
.rang-b { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rang-b--pied { justify-content: flex-end; margin-top: 14px; }
.etat-go { font-weight: 800; display: flex; align-items: center; gap: 6px; color: var(--doux); }
.etat-go--ok { color: var(--ok); } .etat-go--ko { color: var(--ko); }
.carte-ran { background: var(--surf); border-radius: var(--r); padding: 12px 14px 8px; box-shadow: var(--ombre); margin: 0 auto 14px; max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.carte-ran-t { min-height: 44px; }
.carte-ran h3 { font-size: 18px; font-weight: 800; }
.motif { color: var(--doux); font-weight: 600; }
.lib-rec { font-size: 13px; font-weight: 800; color: var(--doux); text-transform: uppercase; letter-spacing: .05em; }
.btn--archiver { align-self: flex-end; }

/* ───── Réglages ───── */
.carte-reg { background: var(--surf); border-radius: var(--r); padding: 14px; box-shadow: var(--ombre); margin: 0 auto 14px; max-width: 640px; }
.carte-reg h2 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.trois { display: flex; gap: 8px; }
.reg-ligne { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 4px; border-bottom: 1px solid var(--ligne); font-weight: 800; }
.reg-ligne:last-child { border-bottom: 0; }
.reg-v { margin-left: auto; color: var(--doux); font-weight: 700; text-align: right; }
.reg-ligne .reg-v + .ico { color: var(--doux); }
.sw { width: 56px; height: 32px; border-radius: 999px; background: var(--ligne); position: relative; margin-left: auto; flex: none; border: 2px solid var(--doux); }
.sw i { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--doux); transition: transform .18s; }
.sw[aria-checked="true"] { background: var(--acc); border-color: var(--acc); }
.sw[aria-checked="true"] i { transform: translateX(24px); background: var(--on-acc); }
.sw { min-height: 44px; height: 44px; border-radius: 999px; }
.sw i { top: 8px; }
.aide--prevu { max-width: 640px; margin: 18px auto; text-align: center; }

/* ───── Fil ───── */
.fil { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fil-msgs { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.jour-sep { text-align: center; margin: 14px 0 6px; } .jour-sep span { background: var(--surf); color: var(--doux); border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 800; box-shadow: var(--ombre); }
.bulle { max-width: min(86%, 560px); padding: 10px 14px 6px; border-radius: 22px; box-shadow: var(--ombre); position: relative; overflow-wrap: break-word; }
.bulle--m { align-self: flex-end; background: var(--acc); color: var(--on-acc); border-bottom-right-radius: 8px; }
.bulle--d { align-self: flex-start; background: var(--surf); border-bottom-left-radius: 8px; }
.bulle p + p { margin-top: 8px; }
.bulle .meta { font-size: 11.5px; font-weight: 700; opacity: .75; margin-top: 4px; }
.bulle--longue .texte { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.lire-suite { font-weight: 800; color: var(--acc); min-height: 44px; display: inline-flex; align-items: center; }
.bulle--m .lire-suite { color: var(--on-acc); text-decoration: underline; }
.bulle--attente { opacity: .8; border: 1.5px dashed rgba(255, 255, 255, .6); }
.bulle--penser { color: var(--doux); font-style: italic; display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.pts { display: inline-flex; gap: 4px; } .pts i { width: 7px; height: 7px; border-radius: 50%; background: var(--doux); animation: saute 1s infinite; } .pts i:nth-child(2) { animation-delay: .15s; } .pts i:nth-child(3) { animation-delay: .3s; }
@keyframes saute { 50% { transform: translateY(-4px); opacity: .5; } }
.chips--sous { align-self: flex-start; margin: 2px 0 6px; max-width: 94%; }
.bandeau { margin: 0 16px 6px; background: var(--ko-bg); color: var(--ko); border-radius: 16px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.fil-bas { flex: none; padding: 6px 16px 4px; display: flex; flex-direction: column; gap: 2px; }
.fil-champ { display: flex; gap: 8px; align-items: flex-end; background: var(--surf); border-radius: 28px; box-shadow: var(--ombre); padding: 4px 4px 4px 18px; }
.fil-champ textarea { flex: 1; border: 0; background: none; resize: none; min-height: 44px; max-height: 120px; padding: 11px 0; outline: none; line-height: 1.3; }
.fil-champ textarea::placeholder { color: var(--doux); opacity: 1; }
.fil-champ:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.envoyer { width: 44px; height: 44px; border-radius: 50%; background: var(--acc); color: var(--on-acc); display: flex; align-items: center; justify-content: center; flex: none; }
.fil-etat { min-height: 20px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--doux); }
.fil-bas .micro-creux--fil { margin-top: 0; }
@media (max-height: 560px) { .micro-creux--fil { display: none; } }
@media (min-width: 760px) { .fil-msgs, .fil-bas, .bandeau { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; } .fil-bas { padding-left: 0; padding-right: 0; } .micro-creux--fil { height: 80px; } }

/* ───── Couches ───── */
.couche { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.couche--boite { align-items: center; padding: 16px; }
.fond { position: absolute; inset: 0; background: var(--scrim); animation: fond .2s ease-out; }
@keyframes fond { from { opacity: 0; } }
.panneau { position: relative; z-index: 1; width: 100%; background: var(--surf); box-shadow: var(--ombre-g); outline: none; }
.couche--feuille .panneau { border-radius: 28px 28px 0 0; max-height: 88dvh; overflow-y: auto; display: flex; flex-direction: column; padding: 8px 20px 22px; animation: feuille .22s ease-out; }
@keyframes feuille { from { transform: translateY(40px); opacity: .4; } }
.couche--boite .panneau { max-width: 420px; border-radius: 28px; padding: 22px 20px 16px; animation: apparait .2s ease-out; }
.couche--carte .panneau { height: calc(var(--vvh, 100dvh) - 36px); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; background: var(--surf); overflow: hidden; }
.poignee { width: 44px; height: 5px; border-radius: 3px; background: var(--ligne); margin: 4px auto 6px; flex: none; }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.feuille-tete h2, .boite-c h2 { font-size: 22px; font-weight: 800; }
.feuille-tete--g { align-items: flex-start; }
.titre-complet { font-size: 20px !important; line-height: 1.25; overflow-wrap: break-word; padding: 8px 0; flex: 1; min-width: 0; }
.sous-titre { color: var(--doux); font-weight: 700; margin-bottom: 8px; overflow-wrap: break-word; }
.etoile-grosse { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--surf2); border: 1.5px solid var(--ligne); font-weight: 800; color: var(--doux); flex: none; }
.etoile-grosse.on { background: var(--acc-doux); border-color: var(--etoile); color: var(--txt); }
.etoile-grosse.on .ico { color: var(--etoile); }
.texte-dicte { color: var(--doux); font-weight: 600; background: var(--surf2); border-radius: 16px; padding: 10px 14px; margin: 4px 0 8px; max-height: 20dvh; overflow: auto; overflow-wrap: break-word; }
.meta-t { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--doux); font-size: 14px; font-weight: 700; margin: 4px 0 14px; }
.meta-t li { display: inline-flex; align-items: center; gap: 4px; }
.tuiles-g { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tuile-g { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 84px; padding: 14px; border-radius: 20px; background: var(--surf2); border: 1.5px solid var(--ligne); font-weight: 800; }
.tuile-g:hover { background: var(--puce-bg); }
.tuile-g small { display: block; font-size: 12.5px; color: var(--doux); font-weight: 700; }
.tuile-g--large { grid-column: 1 / -1; background: var(--acc); color: var(--on-acc); border-color: var(--acc); flex-direction: row; align-items: center; min-height: 56px; }
.tuile-g--danger { color: var(--ko); }
.detail-corps { overflow: auto; flex: 1; min-height: 80px; max-height: 50dvh; padding: 4px 2px; overflow-wrap: break-word; }
.detail-corps p + p { margin-top: 10px; }
.fichiers { color: var(--doux); }
.raccourcis { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.tag-idee { align-self: flex-start; font-size: 11.5px; font-weight: 800; color: var(--doux); background: var(--puce-bg); border-radius: 999px; padding: 2px 10px; }
.champ-l { display: flex; flex-direction: column; gap: 6px; font-weight: 800; margin: 8px 0; }
.champ-l input[type="text"], .champ-l input[type="datetime-local"] { min-height: 48px; border-radius: 14px; border: 1.5px solid var(--ligne); background: var(--surf2); padding: 0 14px; width: 100%; }
.champ-l input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--acc); }
.ra-etat { min-height: 22px; color: var(--ok); font-weight: 700; margin-top: 6px; }
.btn--micro { margin-top: 4px; }
.conf-t { font-size: 18px; font-weight: 800; line-height: 1.3; }
.dest-corps { overflow: auto; flex: 1; min-height: 0; padding-bottom: 8px; }
.dest-l { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 4px 6px; border-radius: 14px; font-weight: 700; }
.dest-l:hover { background: var(--puce-bg); } .dest-l .n { flex: 1; }
.pastille-teinte { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1.5px solid var(--ligne); }
.conf-bas { background: var(--acc-doux); border-radius: 18px; padding: 12px 14px; margin-top: 10px; }
.voix-corps { overflow: auto; flex: 1; min-height: 0; }
.voix-i { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--ligne); }
.voix-n { flex: 1; min-height: 56px; display: flex; flex-direction: column; justify-content: center; padding: 6px 4px; position: relative; font-weight: 800; }
.voix-n small { color: var(--doux); font-weight: 600; }
.voix-n .ico { position: absolute; right: 6px; top: 18px; color: var(--ok); }
.voix-i.sel .n { color: var(--acc); }
.case-l { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; margin-top: 6px; }
.case-l input { width: 22px; height: 22px; accent-color: var(--acc); }
.notif-corps { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 4px; }
.systeme { background: var(--surf2); border: 1.5px solid var(--ligne); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dictee-c { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 6px 0 4px; }
.dictee-etat { font-weight: 800; font-size: 18px; }
.dictee-texte { min-height: 52px; color: var(--doux); font-weight: 700; font-style: italic; }
.couche--feuille:has(.panneau[data-dictee]) .panneau { padding-bottom: 14px; }

/* Carte agrandie */
.carte-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 12px 12px 20px; flex: none; }
.carte-titre { min-width: 0; padding-top: 6px; }
.carte-titre h2 { font-size: 26px; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; outline: none; }
.carte-titre .sous { color: var(--doux); font-weight: 700; }
.carte-actions { display: flex; align-items: center; gap: 2px; position: relative; flex: none; }
.menu-carte { position: absolute; top: 48px; right: 0; z-index: 5; background: var(--surf); border-radius: 16px; box-shadow: var(--ombre-g); padding: 6px; min-width: 210px; }
.menu-carte button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; font-weight: 800; }
.menu-carte button:hover { background: var(--puce-bg); }
.carte-corps { padding: 6px 14px 16px 12px; }
.carte-pied { flex: none; display: flex; gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surf); border-top: 1px solid var(--ligne); }
.carte-pied input { flex: 1; min-width: 0; min-height: 48px; border-radius: 999px; border: 1.5px solid var(--ligne); background: var(--surf2); padding: 0 18px; outline: none; }
.carte-pied input:focus { border-color: var(--acc); outline: 3px solid var(--focus); outline-offset: 1px; }
.carte-pied input::placeholder { color: var(--doux); opacity: 1; }
@media (min-width: 760px) {
  .couche { align-items: center; padding: 24px; }
  .couche--feuille .panneau { max-width: 520px; border-radius: 28px; max-height: 86dvh; }
  .couche--carte .panneau { max-width: 640px; height: min(calc(var(--vvh, 100dvh) - 48px), 820px); border-radius: 28px; }
}

/* ───── Heures ───── */
.frais { color: var(--doux); font-size: 13.5px; font-weight: 700; margin: 2px 2px 10px; }
.tuiles-h { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tuiles-h--3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tuile-h { background: var(--t3); border-radius: 20px; padding: 14px 14px 12px; box-shadow: var(--ombre); }
.tuile-h:nth-child(2) { background: var(--t1); } .tuile-h:nth-child(3) { background: var(--t4); }
.tuile-h .lib { font-weight: 800; color: var(--doux); font-size: 14px; }
.tuile-h .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tuile-h--gros .val { font-size: 34px; }
.tuile-h .ia { font-size: 13px; font-weight: 700; color: var(--doux); margin-top: 2px; }
.periodes { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.cartes-h { display: flex; flex-direction: column; gap: 10px; }
.carte-h { background: var(--surf); border-radius: 20px; padding: 14px 16px 14px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 10px; width: 100%; }
.carte-h.calme { opacity: .6; }
.carte-h .haut { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.carte-h .nom { font-weight: 800; font-size: 17px; display: flex; flex-direction: column; min-width: 0; overflow-wrap: break-word; }
.carte-h small { font-size: 13px; color: var(--doux); font-weight: 700; }
.carte-h .duree { font-size: 22px; font-weight: 800; flex: none; }
.barre { display: block; height: 10px; border-radius: 6px; background: var(--puce-bg); overflow: hidden; }
.barre i { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.barre.mini { height: 8px; flex: 1; }
.note, .note-ia { color: var(--doux); font-size: 14px; font-weight: 600; margin: 12px 2px; }
.ecran h2 { font-size: 18px; font-weight: 800; margin: 22px 2px 8px; }
.lignes-h, .lignes-r { background: var(--surf); border-radius: 20px; padding: 6px 14px; box-shadow: var(--ombre); }
.lh { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--ligne); }
.lh:last-child { border-bottom: 0; }
.lh .n { width: 96px; flex: none; font-weight: 700; }
.lh .d { width: 78px; flex: none; text-align: right; font-weight: 800; display: flex; flex-direction: column; }
.lh .d small, .lignes-r .d small { font-size: 12px; color: var(--doux); font-weight: 700; }
.lignes-r .l { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--ligne); }
.lignes-r .l:last-child { border-bottom: 0; }
.lignes-r .l .d { text-align: right; font-weight: 800; display: flex; flex-direction: column; }
.lignes-r .tot .n, .lignes-r .tot .d { font-size: 18px; font-weight: 800; }
.lignes-r .sub .n { padding-left: 14px; color: var(--doux); font-weight: 600; }
@media (min-width: 760px) { .cartes-h { display: grid; grid-template-columns: repeat(2, 1fr); } }

/* ───── Porte ───── */
#E24 { position: fixed; inset: 0; z-index: 100; background: var(--fond); display: flex; align-items: center; justify-content: center; }
.porte-c { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px; max-width: 360px; }
.porte-ico { width: 96px; height: 96px; border-radius: 30px; background: var(--bulle); color: var(--on-bulle); display: flex; align-items: center; justify-content: center; box-shadow: var(--ombre-g); }
.porte-c h1 { font-size: 32px; font-weight: 800; }
.porte-c p { color: var(--doux); font-weight: 600; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .mosaique .tuile[data-glisser] { animation: none !important; }
}
