/* ==========================================================================
   Mes journées : sélecteur de période et card à période (parts/periode.html).
   Couleurs : uniquement les variables de tokens.css. La couleur ne porte
   jamais l'information seule : formes (rond, carré, barre, pointillé),
   position et mots font la lecture (doc produit v0.6, § 2).
   ========================================================================== */

/* --- Sélecteur Jour / Semaine / 4 semaines ---------------------------------- */
.vues {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; margin-top: 14px;
  background: var(--surface-douce);
  border-radius: var(--rayon-cible);
}
.vues__lien {
  display: grid; place-items: center;
  height: var(--cible-min);
  border-radius: calc(var(--rayon-cible) - 3px);
  color: var(--texte-onglet); text-decoration: none; font-size: var(--taille-petit);
}
.vues__lien[aria-current="page"] {
  background: var(--surface); color: var(--accent-profond); font-weight: 700;
  box-shadow: var(--ombre-douce);
}

/* --- Barre de la période : ‹ dates › ------------------------------------------ */
.periode-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; }
.periode-barre__textes { text-align: center; min-width: 0; }
.periode-barre__titre { font-family: var(--police-titre); font-weight: 400; font-size: 22px; line-height: 1.2; margin: 0; }
.periode-barre__aide { font-size: var(--taille-legende); color: var(--texte-discret); margin: 2px 0 0; }

/* --- La card à période --------------------------------------------------------- */
.periode__rien { margin: 0; color: var(--texte-doux); }
.periode__resume { font-family: var(--police-titre); font-size: 19px; line-height: 1.3; margin: 0; text-wrap: pretty; }
.periode__fait { font-size: var(--taille-petit); color: var(--texte-second); margin: 0; }
.periode__liste { display: flex; flex-direction: column; gap: 16px; }
.periode__element { display: flex; flex-direction: column; gap: 6px; }
.periode__nom { font-size: var(--taille-petit); font-weight: 700; color: var(--texte-second); margin: 0; }
.periode__nom .doux { font-weight: 400; }

/* Légende sous un graphique */
.legende-g { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--taille-legende); color: var(--texte-second); }
.legende-g > span { display: inline-flex; align-items: center; gap: 6px; }
.pastille { width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; }
.pastille--pleine { background: var(--accent-fort); }
.pastille--vide { border: 2px solid var(--encre); }

/* --- Graphiques (SVG) ------------------------------------------------------------ */
.graphique { display: block; width: 100%; height: auto; overflow: visible; }
/* Textes des dessins : 12 px au moins à l'écran (15/11) ; le PDF garde ses tailles (.carte--large, plus bas) */
.graphique text, .g-graduation { font-family: var(--police-texte); font-size: 12px; fill: var(--texte-onglet); }

.g-separateur { stroke: var(--surface-calme); stroke-width: 1; fill: none; }
.g-grille { stroke: var(--separateur); stroke-width: 1; fill: none; }
.g-palier { stroke: var(--rond-vide); stroke-width: 1; fill: none; }
.g-palier--milieu { stroke-dasharray: 3 3; }
.g-palier--fin { stroke: var(--separateur); }

/* Série principale : trait plein + ronds */
.g-courbe { stroke: var(--accent-profond); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.g-courbe--fine { stroke-width: 1.5; }
.g-point { stroke: var(--accent-profond); stroke-width: 7; stroke-linecap: round; fill: none; }
/* Douleur de fond sur 4 semaines à l'écran : un trait par jour, du plus bas au plus haut */
.g-etendue { stroke: var(--accent-profond); stroke-width: 3; stroke-linecap: round; fill: none; }
/* Seconde série (diastolique) : pointillé + carrés */
.g-courbe--seconde { stroke: var(--texte-discret); stroke-dasharray: 4 2; }
.g-point--carre { stroke: var(--texte-discret); stroke-width: 6; stroke-linecap: square; }
/* Pics : barres verticales */
.g-pic { stroke: var(--accent); stroke-width: 3; fill: none; }
/* Prises : rond plein = pris ; anneau foncé épais = pas pris (la forme et le contraste, pas la teinte) */
.g-prise { stroke: var(--accent-fort); stroke-width: 12; stroke-linecap: round; fill: none; }
.g-prise--manquee { stroke: var(--encre); stroke-width: 2; stroke-linecap: butt; fill: var(--surface); }
/* Où, ressenti : un carré plein les jours où c'est noté (taille posée par js/periode.js) */
.g-marque { fill: var(--accent-profond); stroke: none; }
/* Noms des lignes et nombre de prises */
.graphique .g-nom { fill: var(--encre); font-size: 12px; }
.graphique .g-compte { fill: var(--encre); font-weight: 700; }

/* 4 semaines : 28 colonnes, des marques plus fines */
.carte--serree .graphique .g-courbe { stroke-width: 1.5; }
.carte--serree .graphique .g-point { stroke-width: 5; }
.carte--serree .graphique .g-pic { stroke-width: 2.5; }
.carte--serree .graphique .g-prise { stroke-width: 7; }
.carte--serree .graphique .g-prise--manquee { stroke-width: 2; }

/* Dessin en grand pour le PDF (largeur 1050) : des marques à l'échelle des colonnes */
.carte--large .graphique .g-prise { stroke-width: 11; }
.carte--large .graphique .g-prise--manquee { stroke-width: 2.5; }
.carte--large .graphique .g-pic { stroke-width: 3.5; }
.carte--large .graphique text { font-size: 11px; }
.carte--large .graphique .g-compte { font-size: 11px; }
.carte--large .graphique .g-nom { font-size: 11px; }

/* État général, autres symptômes : « nom  réponses », la réponse peut passer à la ligne */
.ligne--fait { display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 2px 12px; align-items: baseline; font-size: var(--taille-petit); }
.ligne--fait .ligne__nom { font-weight: 700; color: var(--texte-second); white-space: normal; }
.ligne--fait .ligne__valeur { white-space: normal; text-align: left; }

/* --- Export (export.html) ----------------------------------------------------- */
.export { display: flex; flex-direction: column; gap: 16px; }
.export__formats { display: flex; flex-direction: column; gap: 10px; }
.export__format { width: 100%; }
.export__format:disabled { opacity: .5; cursor: default; }
.export__etat { margin: 0; font-size: var(--taille-petit); color: var(--texte-second); }

/* La card dessinée en grand pour le PDF : hors de l'écran, mais mise en page
   (les styles calculés servent à figer les couleurs et épaisseurs dans le PDF). */
.export__scene { position: absolute; left: -20000px; top: 0; width: 1050px; }

/* Lien « Exporter… » sous la card de Mes journées */
.exporter { display: flex; margin: 18px 0 0; width: 100%; }

/* Dernier export (medecin.html) */
.export__liste { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.export__liste-titre { font-family: var(--police-titre); font-weight: 400; font-size: 22px; margin: 0; }
.export__liste .doux { margin: 0; font-size: var(--taille-petit); }
.export__periode { background: var(--surface); border-radius: var(--rayon-cible); padding: 12px 14px; box-shadow: var(--ombre-douce); }
.export__periode-titre { margin: 0 0 4px; font-weight: 700; }
.export__fichier { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--cible-min); border-top: 1px solid var(--separateur); }
.export__fichier:first-child { border-top: none; }
.export__fichier-detail { font-size: var(--taille-petit); color: var(--texte-second); }
.export__fichier-actions { display: flex; gap: 2px; flex-shrink: 0; }
.export__partager { color: var(--accent-texte); font-weight: 700; }

/* --- Onglet Médecin (medecin.html) ------------------------------------------------ */
.medecin__intro { margin: 8px 0 18px; }
.medecin__periode { background: var(--surface); border-radius: var(--rayon-cible); padding: 14px; box-shadow: var(--ombre-douce); display: flex; flex-direction: column; gap: 8px; }
.medecin__periode .periode-barre { padding: 4px 0; }
.medecin__voir { color: var(--accent-texte); text-decoration: none; font-size: var(--taille-petit); min-height: var(--cible-min); display: flex; align-items: center; }
.medecin .export__formats .bouton { width: 100%; }
