/* Objectigo — styles. Couleurs tirées du logo : turquoise = chemin (interactif), vert = montagne gravie,
   orange = drapeau (sommet atteint), jaune = soleil (séries), ardoise = neutre. */
@font-face { font-family: 'Jakarta'; src: url('polices/jakarta-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('polices/jakarta-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('polices/jakarta-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('polices/jakarta-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('polices/jakarta-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root, html[data-theme="sombre"] {
  --bg: #102733; --card: #173747; --card2: #1C4153; --cardBd: rgba(255,255,255,0.06); --sh: 0 18px 40px rgba(2,10,16,0.45);
  --dv: rgba(255,255,255,0.07); --text: #F2F7F8; --muted: #9CB3BE; --head: #8EA6B1;
  --green: #4FA82A; --greenTx: #6CC244; --forest: #3C9A5A; --red: #E0483E; --redTx: #FF7066; --slate: #5F7A87; --track: rgba(255,255,255,0.10);
  --tTurq: rgba(24,183,212,0.16); --tSlate: rgba(157,179,190,0.14); --tOrange: rgba(255,122,31,0.18); --tGreen: rgba(86,179,48,0.18); --tRed: rgba(224,72,62,0.16);
  --icTurq: #4FD0E6; --icSlate: #AFC3CC; --sun: #FFD96A; --pillTx: #6FDAEC; --orangeTx: #FF9C4A; --turq: #18B7D4; --onTurq: #102733;
  --inputBg: rgba(255,255,255,0.05); --inputBd: rgba(255,255,255,0.16); --segTx: #B5C8D1; --boxBd: rgba(214,232,238,0.38); --ghostBd: rgba(255,255,255,0.18);
  --nav: #0C2230; --navBd: rgba(255,255,255,0.06); --navIdle: #8EA6B1; --navOn: #4FD0E6;
  --fT: rgba(86,179,48,0.20); --fBd: rgba(86,179,48,0.55); --xT: rgba(224,72,62,0.18); --xBd: rgba(224,72,62,0.55); --nT: rgba(157,179,190,0.14); --nBd: rgba(157,179,190,0.40);
  --cF: #56B330; --cX: #B8392F; --cN: #4F6A77; --cO: rgba(255,255,255,0.07); --cFut: rgba(255,255,255,0.16);
  --scrim: rgba(4,14,20,0.72);
  color-scheme: dark;
}
html[data-theme="clair"] {
  --bg: #F8FAF7; --card: #FFFFFF; --card2: #F1F5F4; --cardBd: rgba(16,39,51,0.06); --sh: 0 14px 34px rgba(16,39,51,0.10);
  --dv: rgba(16,39,51,0.08); --text: #102733; --muted: #58707B; --head: #687E88;
  --green: #4FA82A; --greenTx: #3B8A1C; --forest: #1E6B3A; --red: #D8453B; --redTx: #C43D33; --slate: #9AABB3; --track: #E6ECEE;
  --tTurq: rgba(24,183,212,0.12); --tSlate: rgba(88,112,123,0.10); --tOrange: rgba(255,122,31,0.12); --tGreen: rgba(79,168,42,0.12); --tRed: rgba(216,69,59,0.10);
  --icTurq: #0B7F95; --icSlate: #58707B; --sun: #C98A00; --pillTx: #0A7488; --orangeTx: #C2530A; --turq: #18B7D4; --onTurq: #102733;
  --inputBg: #FFFFFF; --inputBd: #C9D5DA; --segTx: #58707B; --boxBd: #BCC9CF; --ghostBd: #C9D5DA;
  --nav: #FFFFFF; --navBd: rgba(16,39,51,0.08); --navIdle: #687E88; --navOn: #0A7488;
  --fT: rgba(79,168,42,0.14); --fBd: rgba(79,168,42,0.50); --xT: rgba(201,69,59,0.10); --xBd: rgba(201,69,59,0.45); --nT: rgba(88,112,123,0.08); --nBd: rgba(88,112,123,0.30);
  --cF: #4FA82A; --cX: #C9453B; --cN: #B3C1C7; --cO: #E7EDEF; --cFut: #D5DFE3;
  --scrim: rgba(16,39,51,0.40);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Jakarta', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
a { color: var(--pillTx); }
svg { display: block; flex-shrink: 0; }
.visuel-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Largeur maximale : tout l'écran d'un Galaxy Z Fold ouvert (~690 px) ou d'une petite tablette */
:root { --largeur-max: 760px; }
#app { max-width: var(--largeur-max); margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
#app.sans-nav { padding-bottom: 0; }

/* ---------- En-tête illustré ---------- */
.hero { position: relative; overflow: hidden; }
/* Montagnes : la hauteur suit la largeur au-delà de 520 px pour garder le sommet et le drapeau visibles */
.hero-jour { height: max(310px, calc(min(100vw, var(--largeur-max)) * .5974)); }
.hero-bilan { height: max(280px, calc(min(100vw, var(--largeur-max)) * .5385)); }
.hero svg.fond { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.hero-haut { position: absolute; left: 0; right: 0; top: 0; padding: calc(18px + env(safe-area-inset-top)) 14px 0 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: #FFE08A; text-shadow: 0 1px 3px rgba(0,0,0,.35); text-transform: uppercase; }
.h1 { margin: 0; font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.28); }
.h1 button { all: unset; cursor: pointer; }
.puce-hero { margin-top: 8px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(8,24,34,.55); color: #fff; font-size: 13px; font-weight: 700; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .4s; }
.puce-hero.bouclee { background: #FF7417; color: #102733; }
.btn-rond { width: 44px; height: 44px; border-radius: 22px; border: none; padding: 0; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); flex-shrink: 0; text-decoration: none; }
.btn-rond:disabled { opacity: .35; }
.btn-rond.fonce { background: rgba(8,24,34,.35); }
.groupe-btn { display: flex; gap: 6px; }

/* ---------- Cartes et listes ---------- */
.carte { margin: 0 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--cardBd); }
.carte.pad { padding: 16px; }
.carte.ombre { box-shadow: var(--sh); }
.carte.remonte { position: relative; margin-top: -20px; }
.carte-liste { padding: 4px 14px; display: flex; flex-direction: column; }
.carte-liste > * + * { border-top: 1px solid var(--dv); }
.h2 { margin: 24px 20px 10px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; color: var(--head); text-transform: uppercase; }
.etiq { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--head); text-transform: uppercase; }
.muted { color: var(--muted); }
.petit { font-size: 12.5px; line-height: 1.45; font-weight: 500; color: var(--muted); }
.note-bas { margin: 8px 20px 0; }
.pile { display: flex; flex-direction: column; gap: 10px; margin: 0 16px; }
.pile > .carte { margin: 0; }
.rangee { display: flex; align-items: center; gap: 10px; }
.espace { flex-grow: 1; min-width: 0; }
.tuile { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; background: var(--tTurq); display: flex; align-items: center; justify-content: center; color: var(--icTurq); }
.tuile.ardoise { background: var(--tSlate); color: var(--icSlate); }
.tuile.orange { background: var(--tOrange); color: var(--orangeTx); }
.tuile.grande { width: 44px; height: 44px; border-radius: 13px; }
.titre { font-size: 16px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.titre.fait { color: var(--muted); }
.meta { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.pastille { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pastille.t { background: var(--tTurq); color: var(--pillTx); }
.pastille.o { background: var(--tOrange); color: var(--orangeTx); }
.pastille.a { background: var(--tSlate); color: var(--muted); }
.pastille.v { background: var(--tGreen); color: var(--greenTx); }
.pastille.fam { background: var(--tTurq); color: var(--pillTx); padding: 2px 8px 2px 6px; }

/* ---------- Journée ---------- */
.journee { position: relative; margin: -14px 16px 0; padding: 2px 10px 4px 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--cardBd); box-shadow: var(--sh); }
.journee-tete { display: flex; align-items: center; height: 36px; }
.journee-tete span { font-size: 12px; font-weight: 700; color: var(--head); }
.journee-tete .col { width: 52px; text-align: center; white-space: nowrap; }
.ligne { display: flex; align-items: center; gap: 10px; min-height: 64px; border-top: 1px solid var(--dv); padding: 6px 0; }
.ligne .corps { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cases { display: flex; flex-shrink: 0; }
.case { width: 52px; height: 48px; display: flex; align-items: center; justify-content: center; padding: 0; border: none; background: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.boite { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--boxBd); display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s, transform .25s; }
.boite svg { opacity: 0; transition: opacity .2s; }
.case[aria-pressed="true"] .boite { transform: scale(1.06); }
.case[aria-pressed="true"] .boite svg { opacity: 1; }
.case.f[aria-pressed="true"] .boite { background: var(--green); border-color: var(--green); }
.case.x[aria-pressed="true"] .boite { background: var(--red); border-color: var(--red); }
.case.p[aria-pressed="true"] .boite { background: #FF8A2A; border-color: #FF8A2A; }
.case:disabled { cursor: default; }
.segs { display: flex; gap: 3px; }
.segs span { display: block; width: 10px; height: 6px; border-radius: 3px; background: var(--track); transition: background .3s; }
.segs span.on { background: var(--turq); }
.segs span.ok { background: var(--forest); }
.segs span.plus { background: #FF8A2A; }
.btn-ligne { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 12px; background: var(--turq); color: var(--onTurq); font-size: 13px; font-weight: 800; white-space: nowrap; margin-right: 4px; }
.btn-ligne.contour { background: transparent; border: 1px solid var(--pillTx); color: var(--pillTx); }
.btn-report { white-space: nowrap; margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: none; background: var(--tTurq); color: var(--pillTx); font-size: 13px; font-weight: 700; align-self: flex-start; }
.vide-jour { padding: 22px 6px 18px; text-align: center; border-top: 1px solid var(--dv); }
.ajout-jour { display: flex; gap: 8px; padding: 12px 0 10px; border-top: 1px solid var(--dv); }
.ajout-jour button { flex: 1 1 0; height: 44px; border-radius: 12px; border: 1px dashed var(--ghostBd); background: transparent; color: var(--pillTx); font-size: 13px; font-weight: 800; }

/* ---------- Barre de navigation ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: var(--largeur-max); height: calc(84px + env(safe-area-inset-bottom)); padding: 10px 6px env(safe-area-inset-bottom); display: flex; justify-content: space-around; align-items: flex-start; background: var(--nav); border-top: 1px solid var(--navBd); z-index: 20; }
.nav a, .nav button { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--navIdle); background: none; border: none; padding: 0; }
.nav [aria-current="page"] { color: var(--navOn); font-weight: 700; }
.nav .plus { width: 60px; height: 60px; margin-top: -32px; border-radius: 30px; border: 4px solid var(--bg); background: var(--turq); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(24,183,212,.35); }

/* ---------- Boutons, champs ---------- */
.btn { height: 54px; border: none; border-radius: 16px; background: var(--turq); color: var(--onTurq); font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.btn:disabled { opacity: .45; }
.btn.fantome { background: transparent; border: 1px solid var(--ghostBd); color: var(--text); }
.btn.danger { background: var(--red); color: #fff; }
.btn.petit-h { height: 48px; font-size: 15px; }
.btn-lien { height: 44px; padding: 0 6px; border: none; background: none; color: var(--pillTx); font-size: 14px; font-weight: 800; }
.btn-lien.rouge { color: var(--redTx); }
.champ { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.champ input, .champ select, .champ textarea { height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--inputBd); background: var(--inputBg); color: var(--text); font-size: 16px; font-weight: 600; width: 100%; }
.champ textarea { height: auto; padding: 12px 14px; line-height: 1.4; resize: none; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid var(--turq); outline-offset: 1px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.segment { padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--cardBd); display: grid; gap: 4px; }
.segment button { height: 44px; border: none; border-radius: 10px; background: transparent; color: var(--segTx); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; }
.segment button[aria-pressed="true"] { background: var(--turq); color: var(--onTurq); }
.defile { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 16px 4px; }
.defile::-webkit-scrollbar { display: none; }
.puce { flex-shrink: 0; height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--ghostBd); background: transparent; color: var(--segTx); font-size: 14px; font-weight: 700; white-space: nowrap; }
.puce[aria-pressed="true"] { background: var(--turq); border-color: var(--turq); color: var(--onTurq); }
.puce.pointille { border-style: dashed; height: 40px; font-size: 13px; }
.option { width: 100%; padding: 12px 14px; min-height: 60px; border-radius: 16px; border: 1.5px solid var(--cardBd); background: var(--card); color: var(--text); text-align: left; display: flex; align-items: center; gap: 12px; }
.option[aria-pressed="true"] { background: var(--tTurq); border-color: var(--turq); }
.radio { width: 22px; height: 22px; flex-shrink: 0; border-radius: 11px; border: 2px solid var(--ghostBd); display: flex; align-items: center; justify-content: center; }
.radio::after { content: ''; width: 10px; height: 10px; border-radius: 5px; background: transparent; }
.option[aria-pressed="true"] .radio { border-color: var(--turq); }
.option[aria-pressed="true"] .radio::after { background: var(--turq); }
.option b { font-size: 15px; font-weight: 800; display: block; }
.option small { font-size: 13px; font-weight: 500; color: var(--muted); display: block; line-height: 1.4; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.grille7 { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.choix { height: 48px; border-radius: 14px; border: 1.5px solid var(--cardBd); background: var(--card); color: var(--text); font-size: 14px; font-weight: 800; }
.choix[aria-pressed="true"] { background: var(--tTurq); border-color: var(--turq); color: var(--pillTx); }
.compteur { display: flex; align-items: center; gap: 12px; }
.compteur button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--inputBd); background: var(--inputBg); color: var(--text); display: flex; align-items: center; justify-content: center; }
.compteur button.plus { border: none; background: var(--turq); color: var(--onTurq); }
.compteur button:disabled { opacity: .4; }
.compteur .val { min-width: 72px; text-align: center; font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.compteur .val input { width: 90px; text-align: center; font-size: 34px; font-weight: 800; border: none; background: transparent; color: var(--text); padding: 0; }
.info { padding: 12px 14px; border-radius: 14px; background: var(--tTurq); display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.info.danger { background: var(--tRed); }
.bascule { width: 52px; height: 44px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.bascule span { width: 46px; height: 28px; padding: 3px; border-radius: 14px; background: var(--track); display: flex; transition: background .2s; }
.bascule span::after { content: ''; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.bascule[aria-pressed="true"] span { background: var(--turq); }
.bascule[aria-pressed="true"] span::after { transform: translateX(18px); }
.item { min-height: 56px; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; border: none; background: none; color: var(--text); text-align: left; text-decoration: none; }
.item .t { font-size: 15px; font-weight: 700; }
.item .d { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.4; }

/* ---------- Écrans de compte ---------- */
.auth { min-height: 100vh; min-height: 100dvh; padding: calc(40px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.auth-accueil { align-items: center; text-align: center; background: linear-gradient(180deg, #16304D 0%, rgba(60,102,137,.55) 34%, var(--bg) 62%); }
html[data-theme="clair"] .auth-accueil { background: linear-gradient(180deg, #235F94 0%, rgba(94,166,214,.85) 34%, var(--bg) 62%); }
.logo { width: 168px; height: 168px; border-radius: 36px; box-shadow: 0 24px 60px rgba(24,183,212,.28), 0 0 0 1px rgba(255,255,255,.08); margin-top: 60px; }
.auth h1 { margin: 28px 0 0; font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.auth-accueil h1 { color: #fff; }
.auth .sig { margin: 10px 0 0; font-size: 17px; font-weight: 600; color: #C9DCE3; }
html[data-theme="clair"] .auth .sig { color: #F2F7F8; }
.piliers { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.auth-bas { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.auth-form h1 { font-size: 28px; margin-top: 26px; }
.auth-form p.sous { margin: 8px 0 0; font-size: 15px; line-height: 1.45; font-weight: 500; color: var(--muted); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.auth-logo img { width: 32px; height: 32px; border-radius: 8px; }
.erreur { color: var(--redTx); font-size: 14px; font-weight: 700; }
.succes { color: var(--greenTx); font-size: 14px; font-weight: 700; }

/* ---------- Feuilles (bas d'écran) ---------- */
.voile { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: apparait .2s ease; }
.feuille { width: 100%; max-width: var(--largeur-max); max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.3); animation: monte .25s cubic-bezier(.2,.8,.2,1); }
.feuille .poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--ghostBd); margin: 0 auto 14px; }
.feuille h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.feuille .form { margin-top: 14px; }
@keyframes monte { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 90%; padding: 12px 16px; border-radius: 14px; background: #0C2230; color: #fff; font-size: 14px; font-weight: 700; z-index: 60; box-shadow: var(--sh); animation: apparait .2s; }
html[data-theme="clair"] .toast { background: #102733; }
.etat-sync { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; padding: 5px 12px; border-radius: 999px; background: rgba(8,24,34,.72); color: #fff; font-size: 12px; font-weight: 700; display: flex; gap: 6px; align-items: center; }

/* ---------- Création ---------- */
.creation { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.creation-haut { padding: calc(10px + env(safe-area-inset-top)) 12px 0 8px; display: flex; align-items: center; gap: 4px; }
.etapes-smart { height: 52px; padding: 0 28px; display: flex; align-items: center; }
.etapes-smart .l { width: 32px; height: 32px; flex-shrink: 0; border-radius: 16px; border: 2px solid var(--ghostBd); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.etapes-smart .l.fait { background: var(--tTurq); border-color: var(--turq); color: var(--pillTx); }
.etapes-smart .l.cours { background: var(--turq); border-color: var(--turq); color: var(--onTurq); box-shadow: 0 0 0 5px var(--tTurq); }
.etapes-smart .t { flex: 1 1 0; height: 3px; margin: 0 6px; border-radius: 2px; background: var(--track); }
.etapes-smart .t.fait { background: var(--turq); }
.creation-corps { flex: 1 1 auto; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.creation-bas { position: sticky; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 10px; border-top: 1px solid var(--dv); background: var(--bg); }
.creation-bas .btn { flex: 2 1 0; }
.creation-bas .btn.fantome { flex: 1 1 0; }
.phrase { margin: 0; font-size: 21px; line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }

/* ---------- Fiches et statistiques ---------- */
.gros { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.gros small { font-size: 26px; color: var(--muted); font-weight: 800; }
.barre { height: 10px; border-radius: 5px; overflow: hidden; background: var(--track); }
.barre > span { display: block; height: 100%; border-radius: 5px; background: var(--turq); transition: width .4s; }
.tuiles { margin: 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.tuile-stat { min-height: 84px; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--cardBd); display: flex; flex-direction: column; gap: 4px; }
.tuile-stat .k { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tuile-stat .v { font-size: 22px; line-height: 1.1; font-weight: 800; }
.tuile-stat .v small { font-size: 13px; font-weight: 700; color: var(--muted); }
.tuile-stat .s { font-size: 11.5px; line-height: 1.35; font-weight: 500; color: var(--muted); }
.histo { height: 150px; display: grid; gap: 6px; align-items: end; }
.histo > div { height: 150px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.histo b { font-size: 11px; font-weight: 800; color: var(--muted); }
.histo span { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--turq); }
.histo-lbl { margin-top: 6px; display: grid; gap: 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-jour { height: 44px; padding: 0; border-radius: 10px; border: 1px solid transparent; background: var(--cO); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; font-weight: 700; }
.cal-jour.f { background: var(--fT); border-color: var(--fBd); }
.cal-jour.p { background: var(--tOrange); border-color: rgba(255,138,42,.55); }
.cal-jour.x { background: var(--xT); border-color: var(--xBd); }
.cal-jour.n { background: var(--nT); border-color: var(--nBd); }
.cal-jour.v { background: transparent; border: 1px dashed var(--cFut); color: var(--muted); }
.cal-jour.np, .cal-jour.pa, .cal-jour.h { color: var(--muted); }
.cal-jour.vide { visibility: hidden; }
.cal-jour.auj { box-shadow: 0 0 0 2px var(--turq); }
.cal-jour:disabled { cursor: default; }
.legende { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mini-mois { display: flex; flex-direction: column; gap: 6px; }
.mini-mois .g { display: grid; grid-template-columns: repeat(7, 12px); grid-auto-rows: 12px; gap: 2px; }
.mini-mois .g i { width: 12px; height: 12px; border-radius: 3px; background: var(--cO); }
.mini-mois .g i.f { background: var(--cF); } .mini-mois .g i.p { background: #FF8A2A; } .mini-mois .g i.x { background: var(--cX); }
.mini-mois .g i.n { background: var(--cN); } .mini-mois .g i.v { background: transparent; box-shadow: inset 0 0 0 1px var(--cFut); } .mini-mois .g i.vide { background: transparent; }
.barre-empilee { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--track); }
.barre-empilee span { display: block; min-width: 0; }
.actions3 { margin: 24px 16px 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.actions3 button { height: 64px; border-radius: 16px; border: 1px solid var(--cardBd); background: var(--card); color: var(--text); font-size: 13px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.actions3 svg { color: var(--icTurq); }
.fil { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.vide-bloc { margin: 20px 16px 0; padding: 28px 20px; border-radius: 20px; border: 1px dashed var(--ghostBd); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.chargement { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.chargement img { width: 96px; height: 96px; border-radius: 22px; animation: respire 1.6s ease-in-out infinite; }
@keyframes respire { 50% { transform: scale(.94); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Compléments de l'application ---------- */
.date-choix { position: relative; display: inline-block; cursor: pointer; }
.date-choix input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.date-choix input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.segs.large { gap: 4px; width: 100%; }
.segs.large span { flex: 1 1 0; width: auto; height: 8px; border-radius: 4px; }
.segs span.rate { background: var(--slate); opacity: .6; }
.case, .btn-ligne, .date-choix { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.choix:has(input:checked) { background: var(--tTurq); border-color: var(--turq); color: var(--pillTx); }
.choix:has(input:focus-visible) { outline: 2px solid var(--turq); outline-offset: 1px; }
.grille7 .choix { height: 44px; }
[hidden] { display: none !important; }
.etat-sync { border: none; cursor: pointer; }
.tuile-stat .v small { margin-left: 2px; }
.item .t { color: var(--text); }
a.item, a.fil { color: inherit; }
.cal-jour span { line-height: 13px; }
.creation-corps .etiq { display: block; }
.feuille .carte-liste { margin: 0; }
.feuille .carte-liste > * + * { border-top: 1px solid var(--dv); }
.feuille .option .tuile { width: 28px; height: 28px; }
.btn[disabled], .btn:disabled { pointer-events: none; }
/* Écrans de compte : formulaire en colonne centrée sur grand écran */
@media (min-width: 600px) { .auth-form { max-width: 560px; margin: 0 auto; } }
@media (min-width: 800px) {
  body { background: var(--bg); }
  #app { box-shadow: 0 0 0 1px var(--cardBd); }
}

/* ---------- Ordinateur (fenêtre large) : barre latérale à gauche, Aujourd'hui en deux colonnes ---------- */
@media (min-width: 1100px) {
  #app { box-shadow: none !important; padding-bottom: 48px; }
  body.avec-nav { padding-left: 232px; }
  body.avec-nav #app { padding-top: 28px; }
  body.avec-nav #app > .hero { border-radius: 28px; }
  body.avec-nav .nav { left: 0; top: 0; bottom: 0; transform: none; width: 232px; max-width: none; height: auto; padding: 26px 16px; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; border-top: none; border-right: 1px solid var(--navBd); }
  body.avec-nav .nav::before { content: 'Objectigo'; order: -2; display: flex; align-items: center; height: 44px; padding-left: 52px; margin: 0 6px 20px; background: url(icones/icone-192.png) no-repeat left center / 40px 40px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
  body.avec-nav .nav a { width: auto; flex-direction: row; gap: 14px; padding: 11px 14px; border-radius: 14px; font-size: 15px; }
  body.avec-nav .nav a:hover { background: var(--dv); }
  body.avec-nav .nav [aria-current="page"] { background: rgba(24,183,212,.14); }
  body.avec-nav .nav .plus { order: -1; width: auto; height: 50px; margin: 0 0 16px; border: none; border-radius: 14px; flex-direction: row; gap: 8px; font-size: 15px; font-weight: 800; color: #102733; }
  body.avec-nav .nav .plus::after { content: 'Ajouter'; }
  /* Aujourd'hui : la montagne à gauche (fixe au défilement), la journée à droite */
  #app[data-vue="aujourdhui"] { max-width: 1240px; padding-left: 32px; padding-right: 32px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  #app[data-vue="aujourdhui"] .hero-jour { height: auto; aspect-ratio: 390 / 310; position: sticky; top: 28px; }
  #app[data-vue="aujourdhui"] .journee { margin: 0; }
  #app[data-vue="aujourdhui"] .hero-jour svg rect[y="250"] { display: none; } /* pas de fondu vers le fond : la montagne est une carte */
  /* Fenêtres : au centre de l'écran plutôt qu'en bas */
  .voile { align-items: center; }
  .feuille { max-width: 560px; border-radius: 24px; max-height: 86vh; }
  .feuille .poignee { display: none; }
}

