/* Ragnagna — feuille de style des utilisatrices (JM 22/10).
   RÈGLE TRÈS IMPORTANTE : pensé d'abord pour le téléphone (360-430 px),
   cibles tactiles >= 48 px, champs en 16 px (pas de zoom iPhone), barre d'onglets en bas. */

:root {
    --fond: #faf5f7;
    --surface: #ffffff;
    --surface-douce: #f4eaee;
    --texte: #2b1d22;
    --doux: #6e5860;
    --ligne: #e6d6dc;
    --accent: #a3364f;
    --accent-fort: #88283e;
    --accent-clair: #f9e6eb;
    --ok: #1f6f46;
    --ok-fond: #e6f5ed;
    --ko: #a62639;
    --ko-fond: #fce8eb;
    --ombre: 0 6px 20px rgba(60, 20, 32, 0.06);
    --decor: url("fonds/jour.jpg");
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --fond: #171114;
        --surface: #22191d;
        --surface-douce: #2d2127;
        --texte: #f5ebee;
        --doux: #b8a3ab;
        --ligne: #3b2c33;
        --accent: #e27892;
        --accent-fort: #eca0b3;
        --accent-clair: #382028;
        --ok: #5cd095;
        --ok-fond: #183226;
        --ko: #f28291;
        --ko-fond: #3a1c22;
        --ombre: 0 6px 22px rgba(0, 0, 0, 0.35);
        --decor: url("fonds/nuit.jpg");
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background-color: var(--fond);
}

/* (JM 23/10 v44) la page ne glisse jamais de droite à gauche, même si un élément dépasse */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

/* Photo du thème, collée à l'écran (pas à la hauteur de la page). */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--fond);
    background-image: var(--decor, none);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    pointer-events: none;
}

body {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--texte);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Porte d'entrée (non connectée) ---------- */

.porte {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
}

.colonne-mobile {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entete-marque {
    text-align: center;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--ombre);
}

.marque {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

.goutte {
    width: 15px;
    height: 20px;
    background: var(--accent);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(180deg);
    display: inline-block;
    flex-shrink: 0;
}

.accroche {
    margin: 8px 0 0;
    color: var(--doux);
    font-size: 0.95rem;
    line-height: 1.45;
}

.accroche strong {
    color: var(--texte);
}

/* ---------- Cartes ---------- */

.carte {
    width: 100%;
    background: var(--surface);
    /* (JM 23/10 v44) un peu de transparence pour voir la photo du thème ; réglable dans Compte */
    background: color-mix(in srgb, var(--surface) calc(100% - var(--transp, 15%)), transparent);
    border: 1px solid var(--ligne);
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: var(--ombre);
}

h1, h2, h3 {
    margin: 0 0 6px;
    line-height: 1.25;
}

h1 { font-size: 1.35rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.08rem; }

.aide {
    color: var(--doux);
    margin: 0 0 8px;
    font-size: 0.94rem;
}

.note-discrete {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-douce);
    color: var(--doux);
    font-size: 0.88rem;
}

/* ---------- Sélecteurs d'onglets (Me connecter / Créer mon compte) ---------- */

.choix-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--surface-douce);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.choix-mode button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--doux);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 10px;
}

.choix-mode button[aria-selected="true"] {
    background: var(--surface);
    color: var(--texte);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ---------- Formulaires et champs (16 px minimum, cibles >= 48 px) ---------- */

.bloc-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.champ-groupe {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.94rem;
}

.champ-groupe small {
    font-weight: 400;
    color: var(--doux);
}

.champ-groupe input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1.5px solid var(--ligne);
    border-radius: 12px;
    background: var(--fond);
    color: var(--texte);
    font: inherit;
    font-size: 16px; /* empêche le zoom automatique sur iPhone */
}

.champ-groupe input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-clair);
}

.champ-mdp {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.champ-mdp input {
    flex: 1;
}

.btn-oeil {
    min-width: 58px;
    min-height: 48px;
    border: 1.5px solid var(--ligne);
    border-radius: 12px;
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0 12px;
}

.champ-code {
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 700;
    letter-spacing: 0.22em;
    font-variant-numeric: tabular-nums;
}

.champ-mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Boutons ---------- */

.btn {
    min-height: 50px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.06s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
    transform: scale(0.99);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.plein {
    width: 100%;
}

.btn.principal {
    background: var(--accent);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .btn.principal { color: #191114; }
}
:root[data-theme="nuit"] .btn.principal,
:root[data-theme="encre"] .btn.principal { color: #191114; }

.btn.secondaire {
    background: var(--surface-douce);
    border-color: var(--ligne);
    color: var(--texte);
}

.btn.danger {
    background: var(--ko-fond);
    border-color: var(--ko);
    color: var(--ko);
}

.btn-lien {
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    text-align: center;
}

.grille-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---------- Messages, compte à rebours et clé de secours ---------- */

.message {
    margin: 0;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    background: var(--surface-douce);
}

.message.ok {
    background: var(--ok-fond);
    color: var(--ok);
}

.message.ko {
    background: var(--ko-fond);
    color: var(--ko);
}

.bandeau-chrono {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--accent-clair);
    color: var(--texte);
    text-align: center;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.boite-secours {
    padding: 16px 12px;
    border-radius: 14px;
    border: 2px dashed var(--accent);
    background: var(--accent-clair);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.12rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.06em;
    word-break: break-all;
    user-select: all;
}

.case-cocher {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-douce);
    cursor: pointer;
    font-size: 0.93rem;
}

.case-cocher input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.alerte-danger {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ko-fond);
    color: var(--ko);
    font-size: 0.92rem;
}

.pied-porte {
    text-align: center;
    background: var(--surface);
    border-radius: 14px;
    padding: 4px 10px;
}

/* ---------- Espace connecté (barre du haut + contenu + barre d'onglets du bas) ---------- */

.appli {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

.barre-haut {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--ligne);
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.barre-haut .marque {
    font-size: 1.18rem;
}

.barre-haut-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-plein-site {
    min-height: 48px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--ligne);
    background: var(--surface);
    color: var(--texte);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.entete-marque .btn-plein-site {
    margin-top: 8px;
}

.btn-plein-site[aria-pressed="true"] {
    background: var(--accent);
    color: var(--surface);
    border-color: transparent;
}

.carte-install {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.ligne-install {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.icone-install {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(43, 29, 34, 0.18);
}
.ligne-install strong {
    display: block;
    font-size: 1.05rem;
}
.ligne-install .aide { margin: 0; }
.carte-install .btn { width: 100%; }

.btn-burger {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--ligne);
    background: var(--surface);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}
.btn-burger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--texte);
}
.voile-burger {
    align-items: stretch;
    justify-content: flex-end;
    /* (JM 23/10 v44) panneau flottant, décollé des bords, arrondi aux 4 coins */
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
    z-index: 55;
}
.panneau-burger {
    width: min(320px, 86vw);
    height: 100%;
    background: var(--surface);
    color: var(--texte);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(20, 8, 14, 0.35);
    overflow: auto;
}
.entete-burger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.entete-burger strong { font-size: 1.15rem; }
.liste-burger {
    display: flex;
    flex-direction: column;
    gap: 0;
}
/* (JM 23/10 v44) ouverture du menu : le fond s'assombrit, le panneau glisse depuis la droite */
@keyframes rg-voile-entre { from { opacity: 0; } to { opacity: 1; } }
@keyframes rg-panneau-entre { from { transform: translateX(calc(100% + 16px)); } to { transform: none; } }
.voile-burger:not([hidden]) { animation: rg-voile-entre 0.35s ease-out; }
.voile-burger:not([hidden]) .panneau-burger { animation: rg-panneau-entre 0.5s cubic-bezier(.2,.8,.2,1); }
.voile-burger.sans-glisse,
.voile-burger.sans-glisse .panneau-burger { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .voile-burger:not([hidden]),
    .voile-burger:not([hidden]) .panneau-burger { animation: none; }
}

/* (JM 23/10 v44) chapitres du menu : camaïeu de la couleur du thème, du plus clair (Aujourd'hui) au plus soutenu (Compte) */
.chap-1 { --chap: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.chap-2 { --chap: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.chap-3 { --chap: color-mix(in srgb, var(--accent) 32%, var(--surface)); }
.chap-4 { --chap: color-mix(in srgb, var(--accent) 44%, var(--surface)); }
.chapitre-burger {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--accent-clair);
    background: var(--chap, var(--accent-clair));
    color: var(--texte);
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
}
/* (JM 23/10 v44) lignes séparées, taille d'origine, avec une ombre bien visible */
.chapitre-burger {
    position: relative;
    box-shadow: 0 4px 12px rgba(40, 15, 25, 0.26);
}
/* chevauchement léger, sans changer la taille : chaque ligne recouvre le bas de la précédente */
.chapitre-burger + .chapitre-burger { margin-top: -8px; }
/* La page en cours : couleur pleine du thème, posée sur la pile */
.chapitre-burger.est-actif {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 7px 20px rgba(40, 15, 25, 0.38);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .chapitre-burger.est-actif { color: #191114; }
}
:root[data-theme="nuit"] .chapitre-burger.est-actif,
:root[data-theme="encre"] .chapitre-burger.est-actif { color: #191114; }
.icone-chapitre {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}
.sections-burger {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: -12px 10px 0; /* accroché sous la ligne ouverte */
    padding: 20px 6px 6px;
    border-radius: 0 0 18px 18px;
    background: var(--surface-douce);
    border: 2px solid var(--accent);
    border-top: 0;
}
.btn-burger-deconnexion {
    min-height: 48px;
    margin-top: auto;
    border: 0;
    border-radius: 999px;
    background: var(--ko-fond);
    color: var(--ko);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.lien-burger {
    min-height: 48px;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--texte);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.lien-burger-sous {
    padding-left: 28px;
    font-weight: 600;
    color: var(--doux);
}
[data-menu] { scroll-margin-top: 76px; }

.prenom-Pastille {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-clair);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
}

.contenu-appli {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.liste-infos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.liste-infos li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ligne);
    font-size: 0.95rem;
}

.liste-infos li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.liste-infos span {
    color: var(--doux);
}

.badge-ok {
    color: var(--ok);
}

.zone-suppression {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--ligne);
}

/* Barre de navigation fixée en bas (smartphone) */
.barre-bas {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--surface);
    border-top: 1px solid var(--ligne);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* (JM 23/10 v44) jamais plus large que l'écran */
    gap: 2px;
    max-width: 520px;
    margin: 0 auto;
}

@media (min-width: 521px) {
    .barre-bas {
        border-left: 1px solid var(--ligne);
        border-right: 1px solid var(--ligne);
        border-radius: 16px 16px 0 0;
    }
}

.barre-bas button {
    min-width: 0;
    min-height: 52px;
    padding: 4px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--doux);
    font: inherit;
    font-size: clamp(0.68rem, 3.3vw, 0.82rem);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
}

.barre-bas button[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-clair);
    font-weight: 700;
}

.icone-nav {
    font-size: 1.2rem;
    line-height: 1;
}
.barre-bas button > span:not(.icone-nav) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Modale Confidentialité (RGPD) ---------- */

.voile {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(20, 10, 15, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

@media (min-width: 520px) {
    .voile {
        align-items: center;
    }
}

.modale {
    width: 100%;
    max-width: 460px;
    max-height: 88svh;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 20px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--ombre);
}

.entete-modale {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-fermer {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-douce);
    color: var(--texte);
    font-size: 1.1rem;
    cursor: pointer;
}

.corps-modale {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.corps-modale h3 {
    margin: 6px 0 2px;
    font-size: 1rem;
}

.corps-modale p {
    margin: 0;
    color: var(--doux);
    font-size: 0.93rem;
}


/* ---------- Étape 1 : Carte Phase du jour, ruban des phases et prochaines règles ---------- */

.carte-cycle {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.entete-phase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pastille-phase {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    background: var(--accent-clair);
    color: var(--accent);
}

.pastille-phase.phase-regles {
    background: #fce4ea;
    color: #9f2442;
}

.pastille-phase.phase-folliculaire {
    background: #e6f4ee;
    color: #1f6b4a;
}

.pastille-phase.phase-ovulation {
    background: #fef3d9;
    color: #945d10;
}

.pastille-phase.phase-luteale {
    background: #efe9fb;
    color: #553588;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .pastille-phase.phase-regles { background: #431b26; color: #f7a8bc; }
    :root:not([data-theme]) .pastille-phase.phase-folliculaire { background: #163829; color: #8ee0b8; }
    :root:not([data-theme]) .pastille-phase.phase-ovulation { background: #3f2d0f; color: #f6ce7b; }
    :root:not([data-theme]) .pastille-phase.phase-luteale { background: #2c1f44; color: #cdb6f6; }
}
:root[data-theme="nuit"] .pastille-phase.phase-regles,
:root[data-theme="encre"] .pastille-phase.phase-regles { background: #431b26; color: #f7a8bc; }
:root[data-theme="nuit"] .pastille-phase.phase-folliculaire,
:root[data-theme="encre"] .pastille-phase.phase-folliculaire { background: #163829; color: #8ee0b8; }
:root[data-theme="nuit"] .pastille-phase.phase-ovulation,
:root[data-theme="encre"] .pastille-phase.phase-ovulation { background: #3f2d0f; color: #f6ce7b; }
:root[data-theme="nuit"] .pastille-phase.phase-luteale,
:root[data-theme="encre"] .pastille-phase.phase-luteale { background: #2c1f44; color: #cdb6f6; }

.date-jour {
    font-size: 0.85rem;
    color: var(--doux);
    font-weight: 600;
}

.titre-jour-cycle {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.resume-phase {
    margin: 0;
    color: var(--doux);
    font-size: 0.95rem;
}

.ruban-cycle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.barre-phases {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: var(--surface-douce);
    display: flex;
    overflow: visible;
}

.seg-phase {
    height: 100%;
    display: block;
}

.seg-phase:first-child {
    border-radius: 999px 0 0 999px;
}

.seg-phase.seg-luteale {
    border-radius: 0 999px 999px 0;
}

.seg-regles { background: #d64b6a; }
.seg-folliculaire { background: #d9cfc4; } /* (JM 23/10 v43) mêmes couleurs que l'anneau et sa légende */
.seg-ovulation { background: #e9a83b; }
.seg-luteale { background: #1f8a8a; }

.curseur-jour {
    position: absolute;
    top: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--texte);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
    transform: translateX(-50%);
    pointer-events: none;
}

.legende-ruban {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--doux);
    font-weight: 600;
}

.grille-previsions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.boite-prevision {
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.etiq-prev {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--doux);
    font-weight: 700;
}

.boite-prevision strong {
    font-size: 1rem;
    line-height: 1.25;
}

.boite-prevision small {
    font-size: 0.82rem;
    color: var(--doux);
}

.actions-rapides-regles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Étape 2 : Cartes de suggestions du jour (sport, alimentation, humeur) ---------- */

.liste-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carte-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    border-radius: 14px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
}

.sug-icone {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sug-corps {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sug-categorie {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.sug-corps strong {
    font-size: 0.98rem;
}

.sug-corps p {
    margin: 0;
    font-size: 0.91rem;
    color: var(--doux);
    line-height: 1.4;
}

/* ---------- Étape 3 : Journal des symptômes, pastilles tactiles, calendrier et statistiques ---------- */

.entete-symptomes {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.champ-date-court {
    min-height: 42px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1.5px solid var(--ligne);
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
}

.champ-groupe textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--ligne);
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 16px;
    resize: vertical;
}

.champ-groupe textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

.groupe-pastilles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.titre-pastilles {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--doux);
}

.grille-pastilles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pastille-choix {
    min-height: 40px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1.5px solid var(--ligne);
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.pastille-choix[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .pastille-choix[aria-pressed="true"] { color: #191114; }
}
:root[data-theme="nuit"] .pastille-choix[aria-pressed="true"],
:root[data-theme="encre"] .pastille-choix[aria-pressed="true"] { color: #191114; }

/* Calendrier mensuel tactile */
.barre-mois {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.barre-mois h2 {
    margin: 0;
    font-size: 1.12rem;
    text-transform: capitalize;
}

.btn-mois {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--ligne);
    background: var(--surface-douce);
    color: var(--texte);
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
}

.jours-semaine {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--doux);
}

.grille-calendrier {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.case-jour {
    position: relative;
    min-height: 44px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
}

.case-jour.hors-mois {
    opacity: 0.32;
}

.case-jour.est-regles {
    background: #d64b6a;
    color: #fff;
    font-weight: 700;
}

.case-jour.est-prevue {
    border: 1.5px dashed #d64b6a;
    background: var(--accent-clair);
    color: var(--accent);
}

.case-jour.est-ovu {
    background: #fef3d9;
    color: #945d10;
    border-color: #e9a83b;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .case-jour.est-ovu {
        background: #3f2d0f;
        color: #f6ce7b;
    }
}
:root[data-theme="nuit"] .case-jour.est-ovu,
:root[data-theme="encre"] .case-jour.est-ovu {
    background: #3f2d0f;
    color: #f6ce7b;
}

.case-jour.est-aujourdhui {
    box-shadow: inset 0 0 0 2px var(--texte);
}

.case-jour.est-choisi {
    outline: 2.5px solid var(--accent);
    outline-offset: 1px;
}

.point-symp {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-top: 2px;
}

.legende-calendrier {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--doux);
    justify-content: center;
    padding-top: 4px;
}

.legende-calendrier span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.puce-leg {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.puce-regles { background: #d64b6a; }
.puce-prevues { border: 1.5px dashed #d64b6a; background: var(--accent-clair); }
.puce-ovu { background: #e9a83b; }
.puce-symp { width: 7px; height: 7px; background: var(--texte); }

.encart-jour-cal {
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entete-encart-jour {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Liste des périodes & statistiques */
.liste-periodes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ligne-periode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
}

.ligne-periode-infos {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ligne-periode-infos strong {
    font-size: 0.95rem;
}

.ligne-periode-infos small {
    font-size: 0.83rem;
    color: var(--doux);
}

.btn-mini-suppr {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--ligne);
    background: var(--surface);
    color: var(--ko);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.grille-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.boite-stat {
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.etiq-stat {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--doux);
    font-weight: 700;
}

.boite-stat strong {
    font-size: 1.32rem;
    color: var(--accent);
}

.boite-stat small {
    font-size: 0.8rem;
    color: var(--doux);
}

.liste-barres-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ligne-barre-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entete-barre-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.entete-barre-stat span:last-child {
    color: var(--doux);
    font-size: 0.84rem;
}

.piste-barre-stat {
    height: 9px;
    border-radius: 999px;
    background: var(--surface-douce);
    overflow: hidden;
}

.rempli-barre-stat {
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.boite-stat { position: relative; }
.badge-stat {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}
.stat-ok .badge-stat { background: #d8f3e4; color: #1f6b4a; }
.stat-alerte .badge-stat { background: #fde8c8; color: #945d10; }

.lectures-simples {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lecture-carte {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
}
.lecture-carte h3 { margin: 0; font-size: 1.02rem; }
.lecture-carte .aide { margin: 0; }
.axe-jours, .ligne-flux {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 6px;
    align-items: center;
}
.axe-jours { font-size: 0.72rem; color: var(--doux); font-weight: 700; }
.rangee-cases, .rangee-num {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 3px;
}
.rangee-num span { text-align: center; }
.case-flux {
    height: 16px;
    border-radius: 6px;
    background: transparent;
}
.case-flux.flux-note { background: #f4a4b8; }
.case-flux.flux-leger { background: #fb7185; }
.case-flux.flux-moyen { background: #e11d48; }
.case-flux.flux-abondant { background: #9f1239; }
.case-flux.flux-spotting { background: #fecdd3; }
.legende-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.78rem;
    color: var(--doux);
    font-weight: 600;
}
.legende-points i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 99px;
    margin-right: 4px;
}
.barres-douleur {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 112px;
}
.col-douleur {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}
.baton-douleur {
    width: 100%;
    max-width: 16px;
    border-radius: 6px 6px 3px 3px;
    background: var(--ligne);
    height: 8%;
}
.baton-douleur.n1 { background: #93c5fd; height: 36%; }
.baton-douleur.n2 { background: #3b82f6; height: 64%; }
.baton-douleur.n3 { background: #1e3a8a; height: 92%; }
.col-douleur small { font-size: 0.68rem; color: var(--doux); font-weight: 700; }
.barre-phase-type {
    display: flex;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface);
}
.barre-phase-type span { display: block; height: 100%; }
.barre-phase-type .seg-regles { background: #d64b6a; }
.barre-phase-type .seg-folliculaire { background: #d9cfc4; }
.barre-phase-type .seg-ovulation { background: #e9a83b; }
.barre-phase-type .seg-luteale { background: #1f8a8a; }
.noms-phases-type {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--doux);
    font-weight: 700;
}
.ligne-piste {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 600;
}
.piste-cycle {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: var(--surface);
}
.marque-cycle {
    position: absolute;
    top: 1px;
    width: 12px;
    height: 12px;
    border-radius: 99px;
    transform: translateX(-50%);
}

.anneau-cycle { width: min(100%, 280px); margin: 0 auto; }
.anneau-cycle svg { width: 100%; height: auto; display: block; }
.anneau-cycle .piste { fill: none; stroke: var(--ligne); }
.anneau-cycle .txt-doux, .anneau-cycle .txt-fort, .anneau-cycle .txt-jour {
    font-family: system-ui, sans-serif;
}
.anneau-cycle .txt-doux { fill: var(--doux); font-size: 13px; font-weight: 700; }
.anneau-cycle .txt-fort { fill: var(--texte); font-size: 18px; font-weight: 800; }
.anneau-cycle .txt-jour { fill: var(--texte); font-size: 12px; font-weight: 800; }
.legende-anneau {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: center;
    margin: 0;
    font-size: 0.78rem;
    color: var(--doux);
    font-weight: 600;
}
.puce-anneau {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    display: inline-block;
    margin-right: 4px;
}
.puce-a-regles { background: #d64b6a; }
.puce-a-foll { background: #d9cfc4; }
.puce-a-ovu { background: #e9a83b; }
.puce-a-lut { background: #1f8a8a; }

.picto-section, .picto-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}
.picto-section {
    width: 40px;
    height: 40px;
    border-radius: 13px;
}
.picto-section svg { width: 22px; height: 22px; display: block; }
.etape-repas-entete .picto-section {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}
.etape-repas-entete .picto-section svg { width: 20px; height: 20px; }
.picto-mini {
    width: 28px;
    height: 28px;
    border-radius: 9px;
}
.picto-mini svg { width: 16px; height: 16px; display: block; }
.titre-pastilles { display: flex; align-items: center; gap: 8px; }
.entete-symptomes > div:has(.picto-section) {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 10px;
    align-items: center;
}
.entete-symptomes > div:has(.picto-section) .picto-section { grid-row: 1 / span 2; }
.entete-symptomes > div:has(.picto-section) h2,
.entete-symptomes > div:has(.picto-section) .aide { grid-column: 2; margin: 0; }
h2:has(> .picto-section), h3:has(> .picto-section) {
    display: flex;
    align-items: center;
    gap: 10px;
}
.p-rose { background: #d64b6a; }
.p-orange { background: #e07a3d; }
.p-vert { background: #2f9e6b; }
.p-bleu { background: #3b6fd8; }
.p-violet { background: #7b5ea7; }
.p-teal { background: #1c8a86; }
.p-encre { background: #3d4a5c; }


/* ---------- Fonctionnalités avancées : Contraception, Récurrences, Sélecteurs & Fiche Médecin ---------- */

.champ-select {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--ligne);
    background: var(--surface-douce);
    color: var(--texte);
    font: inherit;
    font-size: 16px;
}

.champ-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

.encart-info-doux {
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    font-size: 0.9rem;
    color: var(--texte);
}

.encart-recurrence {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-clair);
    border: 1px solid var(--ligne);
    font-size: 0.91rem;
    color: var(--texte);
    line-height: 1.4;
}

.modale-medecin {
    max-width: 520px;
}

.fiche-medecin-corps {
    font-size: 0.92rem;
    gap: 12px;
}

.fiche-medecin-entete {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ligne);
}

.fiche-medecin-entete h3 {
    margin: 0 0 4px;
    font-size: 1.12rem;
}

.tableau-medecin {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.tableau-medecin th,
.tableau-medecin td {
    text-align: left;
    padding: 7px 6px;
    border-bottom: 1px solid var(--ligne);
}

.tableau-medecin th {
    color: var(--doux);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.pile-boutons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tableau-scroll {
    overflow: auto;
    max-height: 420px;
}

.repas-photo-ligne {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -2px 0 12px;
}

.apercu-repas {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--ligne);
    background: var(--surface-douce);
}

.proposition-repas {
    flex: 1 1 180px;
    margin: 0;
}

.btn-photo {
    position: relative;
    min-height: 44px;
    padding: 8px 14px;
}

.btn-photo input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.carte.bloc-repas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid var(--accent);
}
.liste-etapes-repas { display: flex; flex-direction: column; gap: 14px; }
.etape-repas {
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    border-radius: 16px;
    padding: 14px;
}
.etape-repas-entete {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
}
.etape-repas-entete h2,
.etape-repas-entete h3 { margin: 0; font-size: 1.12rem; }
.carte.bloc-jour { display: flex; flex-direction: column; gap: 12px; }
.etape-repas-entete p { margin: 0; color: var(--doux); font-size: 0.88rem; }
.etape-repas-num {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--surface);
    font-weight: 800;
    font-size: 1.05rem;
}
.slot-repas { margin: 0 0 8px; }
.slot-repas input[readonly] { background: var(--surface-douce); }
.slot-photo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.slot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.slot-actions .btn { min-height: 40px; padding: 8px 12px; font-size: 0.88rem; }
.inp-fichier-clip {
    position: fixed;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.splash-repas { z-index: 60; align-items: center; }
.splash-vignette { width: 168px; height: 168px; object-fit: cover; border-radius: 16px; border: 1px solid var(--ligne); background: #fff; }
.splash-repas .modale { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; }
.splash-repas .btn { margin-top: 4px; }

.photo-rapport {
    display: block;
    width: min(100%, 280px);
    height: auto;
    margin: 6px 0 8px;
    border-radius: 10px;
}

.jour-rapport {
    padding-top: 10px;
    border-top: 1px solid var(--ligne);
}

.avertissement-rapport {
    font-size: 0.9rem;
}

@media print {
    body > *:not(#voileMedecin) {
        display: none !important;
    }
    #voileMedecin {
        position: static !important;
        background: #fff !important;
        padding: 0 !important;
        display: block !important;
    }
    .modale-medecin {
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }
    .corps-modale {
        overflow: visible !important;
    }
    .no-print {
        display: none !important;
    }
    .tableau-scroll {
        max-height: none !important;
        overflow: visible !important;
    }
    .photo-rapport {
        width: 220px !important;
    }
}

/* ---------- Journal de journée et graphiques (sport, repas, poids, sommeil, montre) ---------- */

.liste-graphiques {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.carte-graphique {
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-douce);
    border: 1px solid var(--ligne);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carte-graphique strong {
    font-size: 0.98rem;
}

.carte-graphique small {
    color: var(--doux);
    font-size: 0.82rem;
}

.svg-courbe {
    width: 100%;
    height: auto;
    display: block;
    touch-action: pan-y;
    color: var(--doux);
}

.svg-courbe .grille {
    stroke: var(--ligne);
    stroke-width: 1;
}

.svg-courbe .axe {
    stroke: var(--doux);
    stroke-width: 1.25;
}

.svg-courbe .axe-zero {
    stroke: var(--accent);
    stroke-width: 1.3;
    stroke-dasharray: 4 3;
}

.svg-courbe .curseur-x {
    stroke: var(--accent);
    stroke-width: 1.5;
}

.svg-courbe .brosse {
    fill: var(--accent);
    opacity: 0.22;
}

.lecture-jour {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.svg-courbe .legende-axe {
    fill: var(--doux);
    font-size: 12px;
    font-family: inherit;
}

.commandes-courbe {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.curseur-graph {
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 8px;
    color: var(--doux);
    font-size: 0.84rem;
    font-weight: 600;
}

.curseur-graph input[type="range"] {
    width: 100%;
    height: 36px;
    margin: 0;
    accent-color: var(--accent);
}

.lecture-courbe {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.modale-graph {
    width: 100%;
    max-width: 560px;
    max-height: 94svh;
    overflow: auto;
}

#voileGraph {
    z-index: 70;
}

.carte-graphique.est-grande {
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
}

.bande-phases-graphe {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    gap: 1px;
}

.bande-phases-graphe span {
    flex: 1;
}

.ligne-seance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ligne);
}

.svg-courbe-haute {
    height: auto;
}

.barre-phase {
    display: grid;
    grid-template-columns: 92px 1fr auto;
    gap: 8px;
    align-items: center;
}

.barre-phase span,
.barre-phase strong {
    font-size: 0.82rem;
}

.piste-phase {
    height: 10px;
    border-radius: 999px;
    background: var(--ligne);
    overflow: hidden;
}

.piste-phase div {
    height: 100%;
    border-radius: 999px;
}

.boite-lien {
    padding: 12px;
    border-radius: 14px;
    border: 2px dashed var(--accent);
    background: var(--accent-clair);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    word-break: break-all;
    user-select: all;
    margin-bottom: 8px;
}

.partage-phrase {
    margin: 12px 0;
    font-size: 1.05rem;
    line-height: 1.4;
}

#cartePartage .case-cocher {
    margin-bottom: 8px;
}

#cartePartage .grille-2 {
    margin: 8px 0 14px;
}

/* ---------- Quinze thèmes : couleurs + photo ---------- */

:root[data-theme="jour"],
.puce-theme[data-theme="jour"] {
    --fond: #faf5f7; --surface: #ffffff; --surface-douce: #f4eaee;
    --texte: #2b1d22; --doux: #6e5860; --ligne: #e6d6dc;
    --accent: #a3364f; --accent-fort: #88283e; --accent-clair: #f9e6eb;
    --ok: #1f6f46; --ok-fond: #e6f5ed; --ko: #a62639; --ko-fond: #fce8eb;
    --ombre: 0 6px 20px rgba(60, 20, 32, 0.06);
    --decor: url("fonds/jour.jpg");
    color-scheme: light;
}

:root[data-theme="nuit"],
.puce-theme[data-theme="nuit"] {
    --fond: #171114; --surface: #22191d; --surface-douce: #2d2127;
    --texte: #f5ebee; --doux: #b8a3ab; --ligne: #3b2c33;
    --accent: #e27892; --accent-fort: #eca0b3; --accent-clair: #382028;
    --ok: #5cd095; --ok-fond: #183226; --ko: #f28291; --ko-fond: #3a1c22;
    --ombre: 0 6px 22px rgba(0, 0, 0, 0.35);
    --decor: url("fonds/nuit.jpg");
    color-scheme: dark;
}

:root[data-theme="aurore"],
.puce-theme[data-theme="aurore"] {
    --fond: #fff3e8; --surface: #fffaf5; --surface-douce: #ffe8d4;
    --texte: #3a2418; --doux: #7a5b48; --ligne: #f0d2bc;
    --accent: #c45c2a; --accent-fort: #9a431c; --accent-clair: #ffe1cc;
    --ok: #2d7a45; --ok-fond: #e7f6ea; --ko: #a33b2a; --ko-fond: #fde8e2;
    --ombre: 0 8px 22px rgba(120, 60, 20, 0.08);
    --decor: url("fonds/aurore.jpg");
    color-scheme: light;
}

:root[data-theme="lin"],
.puce-theme[data-theme="lin"] {
    --fond: #f4f0e6; --surface: #fbf8f2; --surface-douce: #efe8da;
    --texte: #3a342c; --doux: #6f675c; --ligne: #e2d8c8;
    --accent: #8a6a3b; --accent-fort: #6d5228; --accent-clair: #f3e6cf;
    --ok: #3d6b45; --ok-fond: #e8f3ea; --ko: #8d4038; --ko-fond: #f8e8e4;
    --ombre: 0 6px 18px rgba(70, 50, 20, 0.06);
    --decor: url("fonds/lin.jpg");
    color-scheme: light;
}

:root[data-theme="zen"],
.puce-theme[data-theme="zen"] {
    --fond: #e8e4da; --surface: #f7f5f0; --surface-douce: #ece7dc;
    --texte: #2c2a26; --doux: #5e5a54; --ligne: #d9d3c6;
    --accent: #3f4f49; --accent-fort: #2c3834; --accent-clair: #e3ebe7;
    --ok: #2f6a4a; --ok-fond: #e5f3eb; --ko: #8a3e3e; --ko-fond: #f8e8e6;
    --ombre: 0 8px 20px rgba(40, 40, 30, 0.06);
    --decor: url("fonds/zen.jpg");
    color-scheme: light;
}

:root[data-theme="brume"],
.puce-theme[data-theme="brume"] {
    --fond: #e6ebef; --surface: #f7f9fa; --surface-douce: #e8eef2;
    --texte: #243038; --doux: #5c6b74; --ligne: #d3dde3;
    --accent: #4d6d82; --accent-fort: #355266; --accent-clair: #e1ebf1;
    --ok: #2c6d52; --ok-fond: #e5f4ec; --ko: #8b4550; --ko-fond: #f8e8ea;
    --ombre: 0 8px 22px rgba(30, 50, 60, 0.07);
    --decor: url("fonds/brume.jpg");
    color-scheme: light;
}

:root[data-theme="foret"],
.puce-theme[data-theme="foret"] {
    --fond: #e7f0e4; --surface: #f7fbf5; --surface-douce: #e3f0df;
    --texte: #1c2e22; --doux: #4e6554; --ligne: #cfe0cb;
    --accent: #2f6b45; --accent-fort: #1f4d31; --accent-clair: #ddf0e3;
    --ok: #1f6b3d; --ok-fond: #e3f6e8; --ko: #8d4038; --ko-fond: #f8e7e4;
    --ombre: 0 8px 20px rgba(20, 50, 30, 0.07);
    --decor: url("fonds/foret.jpg");
    color-scheme: light;
}

:root[data-theme="prairie"],
.puce-theme[data-theme="prairie"] {
    --fond: #f3f6e4; --surface: #fbfcf4; --surface-douce: #eef3dc;
    --texte: #2a3318; --doux: #5d6848; --ligne: #dde6c4;
    --accent: #6b8f3a; --accent-fort: #4f6c28; --accent-clair: #e7f0cc;
    --ok: #3d7a32; --ok-fond: #e6f5e2; --ko: #8d4038; --ko-fond: #f8e7e4;
    --ombre: 0 8px 20px rgba(50, 60, 20, 0.06);
    --decor: url("fonds/prairie.jpg");
    color-scheme: light;
}

:root[data-theme="ocean"],
.puce-theme[data-theme="ocean"] {
    --fond: #e7f3f4; --surface: #f4fbfb; --surface-douce: #dceff0;
    --texte: #0e2c33; --doux: #3e646c; --ligne: #c5e0e3;
    --accent: #0f6e78; --accent-fort: #0b525a; --accent-clair: #d5eef0;
    --ok: #1d7a58; --ok-fond: #e4f6ee; --ko: #9a4050; --ko-fond: #f8e6ea;
    --ombre: 0 8px 22px rgba(10, 50, 60, 0.08);
    --decor: url("fonds/ocean.jpg");
    color-scheme: light;
}

:root[data-theme="lagon"],
.puce-theme[data-theme="lagon"] {
    --fond: #e5f7f6; --surface: #f4fffe; --surface-douce: #daf4f2;
    --texte: #123c3c; --doux: #3e6a68; --ligne: #c5e6e3;
    --accent: #1a9a92; --accent-fort: #12756f; --accent-clair: #d7f5f2;
    --ok: #1d7a58; --ok-fond: #e4f6ee; --ko: #9a4050; --ko-fond: #f8e6ea;
    --ombre: 0 8px 22px rgba(10, 70, 70, 0.07);
    --decor: url("fonds/lagon.jpg");
    color-scheme: light;
}

:root[data-theme="lune"],
.puce-theme[data-theme="lune"] {
    --fond: #e7e8f0; --surface: #f7f7fb; --surface-douce: #e6e7f2;
    --texte: #1e2030; --doux: #5c6078; --ligne: #d4d6e4;
    --accent: #5c6494; --accent-fort: #434a74; --accent-clair: #e4e6f4;
    --ok: #2f6d58; --ok-fond: #e6f4ee; --ko: #8d4560; --ko-fond: #f8e8ee;
    --ombre: 0 8px 22px rgba(30, 30, 60, 0.08);
    --decor: url("fonds/lune.jpg");
    color-scheme: light;
}

:root[data-theme="terre"],
.puce-theme[data-theme="terre"] {
    --fond: #f3e6d8; --surface: #fbf6f0; --surface-douce: #f0e0d0;
    --texte: #3a2416; --doux: #7a5c48; --ligne: #e6d0bc;
    --accent: #a0522d; --accent-fort: #7c3e22; --accent-clair: #f8e4d4;
    --ok: #3d6b40; --ok-fond: #e8f3e6; --ko: #8d3830; --ko-fond: #f8e6e2;
    --ombre: 0 8px 20px rgba(80, 40, 20, 0.08);
    --decor: url("fonds/terre.jpg");
    color-scheme: light;
}

:root[data-theme="encre"],
.puce-theme[data-theme="encre"] {
    --fond: #14120f; --surface: #1e1b17; --surface-douce: #2a261f;
    --texte: #f4efe6; --doux: #c4b8a6; --ligne: #3a342c;
    --accent: #d24b4b; --accent-fort: #f0a0a0; --accent-clair: #3a2222;
    --ok: #7dcea0; --ok-fond: #1c3326; --ko: #f0a0a0; --ko-fond: #3a2222;
    --ombre: 0 8px 24px rgba(0, 0, 0, 0.4);
    --decor: url("fonds/encre.jpg");
    color-scheme: dark;
}

:root[data-theme="petale"],
.puce-theme[data-theme="petale"] {
    --fond: #fde8ef; --surface: #fff; --surface-douce: #fad7e3;
    --texte: #3a1824; --doux: #7a4d5c; --ligne: #f3c9d6;
    --accent: #c43b6e; --accent-fort: #9c2d56; --accent-clair: #fde3ec;
    --ok: #2d7a4e; --ok-fond: #e7f6ec; --ko: #a62639; --ko-fond: #fce8eb;
    --ombre: 0 8px 22px rgba(120, 30, 60, 0.08);
    --decor: url("fonds/petale.jpg");
    color-scheme: light;
}

:root[data-theme="sable"],
.puce-theme[data-theme="sable"] {
    --fond: #f8e7c9; --surface: #fff8ee; --surface-douce: #f8ecd4;
    --texte: #3a2a14; --doux: #7a6244; --ligne: #efd7b0;
    --accent: #c47b2b; --accent-fort: #9a5e1c; --accent-clair: #fde8c8;
    --ok: #3d7a45; --ok-fond: #e8f5e6; --ko: #a33b2a; --ko-fond: #fde8e2;
    --ombre: 0 8px 22px rgba(100, 60, 10, 0.08);
    --decor: url("fonds/sable.jpg");
    color-scheme: light;
}

.grille-themes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.puce-theme {
    min-height: 72px;
    border-radius: 16px;
    border: 2px solid var(--ligne);
    padding: 10px;
    text-align: left;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background-color: var(--fond);
    background-image: var(--decor);
    background-size: cover;
    background-position: center center;
    color: var(--texte);
}

.puce-theme span {
    display: inline-block;
    background: var(--surface);
    color: var(--texte);
    border-radius: 999px;
    padding: 3px 10px;
}

.puce-theme[aria-pressed="true"] {
    box-shadow: 0 0 0 3px var(--accent);
}

/* Tablette : la colonne s'élargit, le fond se voit autour */
@media (min-width: 760px) {
    .colonne-mobile { max-width: 560px; }
    .contenu-appli { max-width: 960px; padding: 22px 24px 28px; }
    .barre-bas { max-width: none; border-radius: 0; border-left: 0; border-right: 0; }
    .vue-onglet {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .vue-onglet > * { min-width: 0; }
    [data-vue="aujourdhui"] > *,
    [data-vue="bilan"] > *,
    [data-vue="calendrier"] > :first-child { grid-column: 1 / -1; }
    .grille-themes { grid-template-columns: repeat(3, 1fr); }
    .modale, .modale-graph { max-width: 720px; }
}

/* PC : navigation à gauche, la photo du thème occupe l'écran */
@media (min-width: 1080px) {
    .appli {
        display: block;
        padding-bottom: 32px;
        padding-left: 228px;
    }
    .barre-haut { padding: 16px 32px; }
    .barre-bas {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        right: auto;
        width: 228px;
        max-width: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 6px;
        border-top: 0;
        border-right: 1px solid var(--ligne);
        border-radius: 0;
        padding: 22px 12px;
    }
    .barre-bas button {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        min-height: 52px;
        padding: 0 14px;
        font-size: 1rem;
    }
    .contenu-appli { max-width: 1120px; padding: 28px 36px 48px; }
    .grille-themes { grid-template-columns: repeat(5, 1fr); }
    .porte { padding-left: 8vw; padding-right: 8vw; }
}

/* ---------- (JM 23/10 v45) En-tête unique des blocs : picto + titre + rond, sur un bandeau plus soutenu ---------- */
.carte.a-entete { padding-top: 0; }
.entete-bloc {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    margin: 0 -16px 14px;
    padding: 8px 12px 8px 16px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, var(--ligne));
    border-radius: 17px 17px 0 0;
}
.entete-bloc > h2,
.entete-bloc > h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.25;
}
.entete-bloc > .picto-section { flex: none; }
.bloc-jour .etape-repas-num { display: none; }
.btn-replier {
    flex: none;
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1.5px solid color-mix(in srgb, var(--accent) 30%, var(--ligne));
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(40, 15, 25, 0.14);
}
.btn-replier::after { /* zone de toucher plus grande que le rond */
    content: "";
    position: absolute;
    inset: -8px;
}
.carte.est-replie { padding-bottom: 0; }
.carte.est-replie > :not(.entete-bloc) { display: none !important; }
.carte.est-replie > .entete-bloc { margin-bottom: 0; border-bottom: 0; border-radius: 17px; }
.carte.est-replie .btn-replier { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* (JM 23/10 v45) Sur téléphone, les champs ne sont jamais côte à côte : l'un sous l'autre */
@media (max-width: 519px) {
    .grille-2:has(> .champ-groupe),
    .grille-2:has(> label) { grid-template-columns: 1fr; }
}
/* Date + explication : la date d'abord, en entier, l'explication dessous */
.entete-symptomes {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
}
.entete-symptomes .champ-date-court { width: 100%; }
/* Mon cycle : la date à droite du bandeau, sur une ligne ; la phase dessous */
.entete-bloc > .date-jour {
    flex: none;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--doux);
}
#cartePhaseJour > .pastille-phase { align-self: flex-start; }

/* (JM 23/10 v46) Plein écran : la barre du haut devient fine et translucide, logée dans la zone de l'encoche.
   « Ragnagna » et ☰ restent ; la photo se devine à travers. */
html.est-plein-ecran .barre-haut {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    min-height: max(env(safe-area-inset-top), 52px); /* même hauteur que la zone de l’encoche */
    padding: 6px 12px 6px 16px;
    background: color-mix(in srgb, var(--surface) 62%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 0;
}
html.est-plein-ecran .barre-haut .marque { font-size: 1.05rem; }
html.est-plein-ecran .btn-burger {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
html.est-plein-ecran .appli { padding-top: max(env(safe-area-inset-top), 52px); }
@media (min-width: 1080px) {
    html.est-plein-ecran .barre-haut { left: 228px; }
}

/* (JM 23/10 v46) Prochaines règles et fenêtre d’ovulation : l’une sous l’autre sur téléphone */
@media (max-width: 519px) {
    #grillePrevisions { grid-template-columns: 1fr !important; }
}

/* (JM 23/10 v47) Titre et petit sous-titre l'un sous l'autre dans le bandeau */
.titres-bloc {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.titres-bloc > h2,
.titres-bloc > h3 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.25;
}
.sous-titre-bloc {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--doux);
}

/* (JM 23/10 v48) numéro de version dans Paramètres de l'appli */
.version-appli {
    margin: 4px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--ligne);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--doux);
}
