@font-face { font-family: Jost; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Jost; font-weight: 500; font-display: swap; src: url(fonts/jost-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Jost; font-weight: 600; font-display: swap; src: url(fonts/jost-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 500; font-display: swap; src: url(fonts/playfair-display-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 600; font-display: swap; src: url(fonts/playfair-display-latin-600-normal.woff2) format('woff2'); }

:root {
  --t: #4F5E4C;          /* couleur du thème (sauge par défaut) */
  --t-clair: #E8EDE4;
  --fond: #F5F1E8;
  --carte: #FFFFFF;
  --bord: #E7E0D2;
  --bord-fort: #D9D2C3;
  --texte: #2E2A25;
  --doux: #5E574D;
  --terra: #9A5A4B;
  --alerte: #8E3B2E;
  --ok: #3B6B3A;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: Jost, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: #8E4F41; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
.chargement { padding: 40px 20px; text-align: center; color: var(--doux); }
.page { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* En-tête */
.entete { background: var(--t); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.entete .sur { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.entete .ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entete p { margin: 0; opacity: .9; font-size: 15px; }
.btn-entete { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,.6); background: transparent; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }

.contenu { padding: 12px 14px 110px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

/* Cartes */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.carte.douce { background: var(--t-clair); border-color: transparent; }
.carte.vide { background: transparent; border-style: dashed; }
.petit { font-size: 13px; color: var(--doux); }
.tres-petit { font-size: 12px; color: var(--doux); }
.titre-section { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 8px 2px 0; }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }

/* Boutons */
.btn { min-height: 48px; padding: 0 20px; border-radius: 24px; border: none; background: var(--t); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.terra { background: var(--terra); }
.btn.second { background: #fff; color: var(--texte); border: 1.5px solid var(--bord-fort); font-weight: 500; }
.btn.lien { background: transparent; color: var(--doux); font-weight: 500; text-decoration: underline; padding: 0 6px; min-height: 44px; }
.btn.petit-btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { background: #E3DCCD; color: #6B6458; cursor: not-allowed; border: none; }
.btn.large { width: 100%; }
.puce { min-height: 44px; padding: 8px 14px; border-radius: 22px; font-size: 15px; font-weight: 500; cursor: pointer; background: #fff; color: var(--texte); border: 1.5px solid var(--bord-fort); }
.puce[aria-pressed="true"] { background: var(--t); color: #fff; border-color: var(--t); }
.puce.carree { padding: 0; width: 48px; }

/* Formulaires */
label.champ { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], textarea, select {
  min-height: 48px; border-radius: 12px; border: 1.5px solid var(--bord-fort); padding: 10px 12px; font-size: 16px; background: #fff; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #C8A96B; outline-offset: 2px; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.case input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--t); }
.case.fond { background: var(--fond); border-radius: 12px; padding: 10px; }
.erreur { color: var(--alerte); font-size: 14px; }
.code-input { font-size: 28px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Humeur */
.humeurs { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.humeur { min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 14px; font-size: 12px; font-weight: 500; cursor: pointer; padding: 6px 2px; background: #fff; border: 1.5px solid var(--bord); }
.humeur .pastille { width: 22px; height: 22px; border-radius: 11px; }
.humeur[aria-pressed="true"] { background: var(--t-clair); border: 2px solid var(--t); }

/* Accordéons des suivis */
.suivi { background: #fff; border: 1px solid var(--bord); border-radius: 16px; overflow: hidden; }
.suivi > button.tete { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: transparent; border: none; cursor: pointer; text-align: left; font-size: 16px; font-weight: 500; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: #EFE9DC; color: var(--doux); white-space: nowrap; }
.badge.ok { background: #E1EBDD; color: var(--ok); }
.suivi .corps { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.compteur { display: flex; align-items: center; gap: 12px; }
.compteur .val { min-width: 90px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.verres { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 4px; }
.verre { height: 44px; border-radius: 6px 6px 10px 10px; cursor: pointer; padding: 0; background: #fff; border: 1.5px solid var(--bord-fort); }
.verre[aria-pressed="true"] { background: #7FA3B8; border-color: #5C8299; }

/* Navigation du bas */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--bord); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav .dedans { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); width: 100%; max-width: 560px; }
.nav button { min-height: 60px; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--doux); cursor: pointer; padding: 4px 2px; }
.nav button[aria-current="page"] { color: var(--t); font-weight: 600; }
.nav svg { width: 24px; height: 24px; }
.onglets { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 6px; }
.onglets .puce { white-space: nowrap; flex-shrink: 0; }

/* Calendrier */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal .jsem { text-align: center; font-size: 12px; color: var(--doux); }
.cal button { position: relative; min-height: 44px; border-radius: 10px; border: 1px solid #EFE9DC; background: #fff; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.cal button.aujourdhui { border: 2px solid var(--t); }
.cal button[aria-pressed="true"] { background: var(--t); color: #fff; border-color: var(--t); }
.cal button[disabled] { color: #B9B09E; background: transparent; border-color: transparent; cursor: default; }
.cal .point { width: 6px; height: 6px; border-radius: 3px; background: transparent; }
.cal .point.on { background: var(--terra); }
.cal button[aria-pressed="true"] .point.on { background: #fff; }
.cal .lune { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; }
.cal .lune.nouvelle { background: #2E2A25; }
.cal .lune.pleine { background: #FFF6DE; border: 1.5px solid #B08A3E; }
.bande { display: grid; grid-template-columns: repeat(30, minmax(0,1fr)); gap: 2px; }
.bande span { height: 26px; border-radius: 3px; background: #EFE9DC; }
.legende { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--doux); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 4px; vertical-align: -1px; }

/* Cohérence cardiaque */
.voile { position: fixed; inset: 0; background: var(--fond); z-index: 20; overflow-y: auto; }
.cercle-zone { height: 260px; display: flex; align-items: center; justify-content: center; }
.cercle { border-radius: 50%; background: var(--t-clair); border: 3px solid var(--t); display: flex; align-items: center; justify-content: center; color: var(--t); font-weight: 600; font-size: 18px; transition-property: width, height; transition-timing-function: ease-in-out; }

/* Étiquettes */
.etiquette { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: #EFE9DC; color: #5E4B22; white-space: nowrap; }
.etiquette.inscription { background: #EFE6F3; color: #4E3A5C; }
.etiquette.partage { background: #E8EDE4; color: #3B4839; }
.etiquette.conseil { background: #F7E9E4; color: #6E3C31; }
.etiquette.evenement { background: #E3ECF1; color: #2E4A58; }
.etiquette.suggestion { background: #F5ECD8; color: #5E4B22; }
.voyant { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; display: inline-block; }
.ligne-personne { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; background: #fff; border: 1px solid var(--bord); border-radius: 14px; padding: 8px 12px; cursor: pointer; text-align: left; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; text-align: center; }
.chiffres div { background: var(--fond); border-radius: 12px; padding: 8px 4px; }
.chiffres b { display: block; font-size: 22px; }
.chiffres span { font-size: 12px; color: var(--doux); }
.encadre { background: #FBF6EC; border: 1px solid #EADFC6; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.lien-copie { background: var(--fond); border-radius: 10px; padding: 10px; font-size: 14px; word-break: break-all; }
details.acc { background: #fff; border: 1px solid var(--bord); border-radius: 16px; }
details.acc > summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; cursor: pointer; font-weight: 500; list-style: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: '+'; font-size: 20px; color: var(--doux); }
details.acc[open] > summary::after { content: '−'; }
details.acc > div { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
details.acc p { margin: 0; }
.pied { text-align: center; font-size: 12px; color: var(--doux); padding: 10px 0 0; }
.pied a { color: var(--doux); }

#toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2E2A25; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 32px); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.visible { opacity: 1; }
.cache { display: none !important; }
@media (prefers-reduced-motion: reduce) { .cercle { transition: none !important; } }

/* Carnet d'évolution */
.evo { --t: #8E4F41; --t-clair: #F3E6E1; }
.evo .entete { background: #6E3C31; }
.bascule { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.14); border-radius: 22px; padding: 4px; margin-top: 8px; }
.bascule button { min-height: 40px; border: none; border-radius: 18px; background: transparent; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.bascule button[aria-pressed="true"] { background: #fff; color: #2E2A25; font-weight: 600; }
.grille4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.grille4 .puce { padding: 6px 4px; font-size: 13px; }
.citation { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.35; }
.curseur { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--bord); }
input[type=range] { width: 100%; height: 36px; accent-color: var(--t); margin: 0; }
input[type=range].vide { opacity: .45; }
.pomo-zone { display: flex; justify-content: center; padding: 8px 0; }
.pomo { width: 190px; height: 190px; border-radius: 50%; border: 6px solid #EFE9DC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pomo.travail { border-color: var(--t); }
.pomo.pause { border-color: #7D8D79; }
.pomo-temps { font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.barre { height: 10px; border-radius: 5px; background: #EFE9DC; overflow: hidden; margin-top: 4px; }
.barre span { display: block; height: 100%; background: var(--t); border-radius: 5px; }
.objectif { display: flex; gap: 10px; align-items: center; }
.objectif input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--t); flex-shrink: 0; margin: 0; }
details.acc > summary > span { flex: 1; }
