/* Écrans : accueil, agenda, jour, listes, voyage, réglages. */

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille-7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.carte-titre { display: flex; justify-content: space-between; align-items: center; }
.etiquette { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--texte-discret); }
.point { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.point-teal { background: var(--teal-2); }
.point-indigo { background: var(--indigo-2); }

.lien-carte { color: inherit; font-weight: inherit; text-decoration: none; }
.lien-carte:hover { color: inherit; }
.carte-discrete p:last-child { font-weight: 600; color: var(--accent); }

/* ----- Boutons complémentaires ----- */
.bouton-contour { background: transparent; border-color: var(--accent); color: var(--accent); }
.bouton-large { width: 100%; }
.bouton-lien { min-height: 36px; padding: 0 10px; background: transparent; color: var(--accent); font-size: 13px; }
.bouton-icone {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--rayon-controle);
  background: var(--carte); color: var(--texte); box-shadow: var(--ombre);
  cursor: pointer;
}
.bouton-plein { background: var(--degrade-info-1); color: #ffffff; box-shadow: none; }
.bouton-supprimer { background: transparent; box-shadow: none; color: var(--texte-discret); font-size: 22px; }
.bouton-supprimer:hover { color: var(--danger); }

/* ----- Accueil ----- */
.photo-accueil { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--rayon-carte); box-shadow: var(--ombre); display: block; }
.photo-vide {
  height: 170px; border: 2px dashed var(--pointilles); border-radius: var(--rayon-carte);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--texte-discret); font-size: 14px; font-weight: 600;
}
.photo-vide:hover { color: var(--accent); }

.mot-texte { font-size: 16px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.ecrire-mot > summary { list-style: none; align-self: flex-start; display: inline-flex; min-height: 44px; }
.ecrire-mot > summary::-webkit-details-marker { display: none; }
.ecrire-mot[open] > summary { margin-bottom: 12px; }

.carte-degrade {
  border-radius: var(--rayon-carte); padding: 20px; color: #ffffff; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 14px;
}
.carte-degrade:hover { color: #ffffff; }
.degrade-1 { background: var(--degrade-info-1); }
.degrade-2 { background: var(--degrade-info-2); }

.meteo-haut, .voyage-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.meteo-lieu { font-size: 13px; font-weight: 600; opacity: 0.92; }
.meteo-temp { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.meteo-libelle { font-size: 14px; font-weight: 600; }
.meteo-jour { background: rgba(255, 255, 255, 0.16); border-radius: var(--rayon-controle); padding: 10px 12px; }
.meteo-jour-nom { font-size: 12px; font-weight: 700; opacity: 0.92; }
.meteo-jour-temp { font-size: 15px; font-weight: 700; }
.meteo-jour-libelle { font-size: 12px; font-weight: 500; }

.ligne-planning { display: flex; align-items: center; gap: 12px; }
.barre-personne { width: 6px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.barre-teal { background: var(--degrade-teal); }
.barre-indigo { background: var(--degrade-indigo); }
.ligne-planning-texte { flex-grow: 1; min-width: 0; }
.ligne-planning-nom { font-size: 13px; font-weight: 700; color: var(--texte-discret); }
.ligne-planning-heures { font-size: 15px; font-weight: 700; }

.voyage-etiquette { font-size: 13px; font-weight: 700; opacity: 0.92; }
.voyage-nom { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.voyage-dates { font-size: 13px; font-weight: 600; opacity: 0.92; }
.voyage-compteur { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.voyage-compteur-grand { font-size: 44px; }
.voyage-checklist { font-size: 12px; font-weight: 600; }
.progression { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.progression-barre { display: block; height: 100%; width: 0; border-radius: 4px; background: #ffffff; transition: width 0.25s ease; }

.raccourci { gap: 2px; padding: 16px; }
.raccourci-titre { font-size: 13px; font-weight: 700; color: var(--texte-discret); }
.raccourci-valeur { font-size: 20px; font-weight: 800; }

/* ----- Agenda ----- */
.agenda { display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; }
.agenda-entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agenda-entete h1 { font-size: 22px; text-align: center; }

.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--rayon-controle); background: var(--bordure); }
.segment { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 11px; color: var(--texte-discret); font-size: 14px; font-weight: 600; }
.segment.actif { background: var(--carte); color: var(--texte); font-weight: 700; box-shadow: 0 2px 6px rgba(28, 60, 70, 0.1); }

.carte-mois { padding: 12px 8px; gap: 6px; }
.jours-semaine { text-align: center; font-size: 12px; font-weight: 700; color: var(--texte-discret); }
.case-jour {
  height: 62px; padding: 6px 5px; border-radius: 12px; border: 2px solid transparent;
  background: var(--champ-fond); color: var(--texte);
  display: flex; flex-direction: column; justify-content: space-between;
}
.case-jour:hover { color: var(--texte); }
.case-jour.passe .case-num { color: var(--texte-discret); font-weight: 600; }
.case-jour.hors-mois { opacity: 0.35; }
.case-jour.aujourdhui { border-color: var(--accent); }
.case-jour.aujourdhui .case-num { color: var(--accent); font-weight: 800; }
.case-haut { display: flex; justify-content: space-between; align-items: center; }
.case-num { font-size: 13px; font-weight: 700; }
.case-barres { display: flex; flex-direction: column; gap: 3px; }
.point-note { width: 6px; height: 6px; border-radius: 50%; background: #e0a526; display: inline-block; }

.micro-barre { display: block; height: 6px; border-radius: 3px; }
.micro-barre.travail.teal { background: var(--degrade-teal); }
.micro-barre.travail.indigo { background: var(--degrade-indigo); }
.micro-barre.teletravail { border: 1.5px solid; background: transparent; }
.micro-barre.teletravail.teal { border-color: var(--teal-2); }
.micro-barre.teletravail.indigo { border-color: var(--indigo-2); }
.micro-barre.repos { background: transparent; }
.micro-barre.non_saisi { background: repeating-linear-gradient(45deg, var(--pointilles) 0 3px, transparent 3px 6px); }

.legende { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--texte-discret); }
.legende > span { display: inline-flex; align-items: center; gap: 6px; }
.legende .micro-barre { width: 18px; }

.liste-semaine { display: flex; flex-direction: column; gap: 10px; }
.jour-semaine { gap: 6px; padding: 14px 16px; border: 2px solid transparent; }
.jour-semaine.aujourdhui { border-color: var(--accent); }
.jour-semaine-titre { font-size: 15px; font-weight: 800; }
.jour-semaine-ligne { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.jour-semaine-nom { color: var(--texte-discret); min-width: 64px; }
.jour-semaine-note { font-size: 13px; color: var(--texte-discret); }
.pastille-petite { padding: 2px 8px; font-size: 11px; }

/* ----- Édition du jour ----- */
.barre-jour { display: flex; justify-content: space-between; align-items: center; }
.barre-jour-nav { display: flex; gap: 8px; }
.lien-retour { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; }
.titre-jour { padding: 0 4px; }
.formulaire-jour { display: flex; flex-direction: column; gap: 14px; }

.section-personne-entete { display: flex; align-items: center; gap: 10px; }
.section-personne-entete h2 { flex-grow: 1; }
.avatar-petit { width: 34px; height: 34px; font-size: 14px; border-width: 0; }

.liste-creneaux { display: flex; flex-direction: column; gap: 10px; }
.creneau { border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--champ-fond); }
.creneau-heures { display: flex; align-items: center; gap: 8px; }
.creneau-heures input {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px;
  border: 1px solid var(--bordure); border-radius: 12px; background: var(--carte);
  font-size: 16px; font-weight: 600;
}
.creneau-heures > span { font-weight: 700; color: var(--texte-discret); }

.interrupteur { display: flex; justify-content: space-between; align-items: center; min-height: 36px; font-size: 14px; font-weight: 600; }
.interrupteur input {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 52px; height: 32px; border-radius: 16px; background: var(--bordure);
  position: relative; cursor: pointer; transition: background 0.15s;
}
.interrupteur input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: #ffffff; transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.interrupteur input:checked { background: var(--accent); }
.interrupteur input:checked::after { transform: translateX(20px); }
.teinte-indigo .interrupteur input:checked { background: var(--indigo-2); }
.teinte-teal .interrupteur input:checked { background: var(--teal-2); }

.bouton-ajout { min-height: 44px; border: 1.5px dashed var(--pointilles); background: transparent; color: var(--accent); font-size: 14px; }
.teinte-indigo .bouton-ajout { color: var(--indigo-2); }
.texte-repos[hidden] { display: none; }

/* ----- Listes à cocher (courses, todo, checklist) ----- */
.liste-cases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ligne-case { display: flex; align-items: center; gap: 4px; }
.ligne-case + .ligne-case { border-top: 1px solid var(--bordure); }
.case-bouton {
  flex-grow: 1; min-width: 0; min-height: 48px; padding: 0; border: none; background: transparent;
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
}
.case-rond {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--pointilles); display: inline-flex; align-items: center; justify-content: center;
}
.case-bouton[aria-pressed="true"] .case-rond { background: var(--accent); border-color: var(--accent); }
.case-bouton[aria-pressed="true"] .case-rond::after {
  content: ""; width: 7px; height: 12px; margin-top: -3px;
  border: solid #ffffff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.case-texte { flex-grow: 1; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.case-bouton[aria-pressed="true"] .case-texte { font-weight: 500; color: var(--texte-discret); text-decoration: line-through; }
.case-quantite { font-size: 13px; font-weight: 600; color: var(--texte-discret); white-space: nowrap; }
.case-bouton:disabled { cursor: progress; }

.carte-rayon { padding: 12px 14px; gap: 2px; }
.titre-rayon { font-size: 13px; font-weight: 800; color: var(--texte-discret); margin-bottom: 4px; }
.liste-rayons { display: flex; flex-direction: column; gap: 12px; }

.ajout-article { display: flex; flex-direction: column; gap: 10px; }
.ajout-ligne { display: flex; gap: 8px; align-items: center; }
.ajout-ligne input[type="text"] {
  flex-grow: 1; min-width: 0; min-height: 46px; padding: 0 14px;
  border: 1.5px solid var(--bordure); border-radius: var(--rayon-controle);
  background: var(--champ-fond); font-size: 16px;
}
.ajout-ligne input[type="text"]:focus { border-color: var(--accent); outline: none; }
.ajout-ligne .champ-quantite { flex: 0 0 72px; }

.suggestions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bordure); border-radius: var(--rayon-controle); overflow: hidden; }
.suggestions li + li { border-top: 1px solid var(--bordure); }
.suggestion {
  width: 100%; min-height: 44px; padding: 0 14px; border: none; background: var(--carte);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; cursor: pointer;
}
.suggestion:hover { background: var(--champ-fond); }
.suggestion-libelle { font-weight: 700; }
.suggestion-rayon { font-size: 12px; font-weight: 600; color: var(--texte-discret); }

.rayons { border: 0; margin: 0; min-width: 0; padding: 0 0 4px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.rayons::-webkit-scrollbar { display: none; }
.rayon-pastille { flex-shrink: 0; position: relative; }
.rayon-pastille input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.rayon-pastille span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border: 1.5px solid var(--bordure); border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--texte-discret); white-space: nowrap;
}
.rayon-pastille input:checked + span { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rayon-pastille input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ----- Réglages ----- */
.choix-palette {
  border: none; background: transparent; padding: 4px 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--texte-discret);
}
.choix-palette.actif { color: var(--texte); font-weight: 800; }
.pastille-palette { width: 64px; height: 64px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 4px var(--carte); }
.choix-palette.actif .pastille-palette { border-color: var(--accent); }
.pastille-lagon { background: linear-gradient(135deg, #2fb8b0, #4a5fd9); }
.pastille-moderne { background: linear-gradient(135deg, #f6a57f, #d9534f); }
.pastille-prairie { background: linear-gradient(135deg, #e0b83a, #6f7a22); }

.ligne-reglage { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.interrupteur-bouton {
  flex-shrink: 0; width: 52px; height: 32px; border-radius: 16px; border: none; padding: 0;
  background: var(--bordure); position: relative; cursor: pointer;
}
.interrupteur-bouton[aria-checked="true"] { background: var(--accent); }
.interrupteur-rond {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.interrupteur-bouton[aria-checked="true"] .interrupteur-rond { transform: translateX(20px); }

.apercu-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--rayon-controle); }
.bouton-fichier { position: relative; overflow: hidden; }
.bouton-fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

.resume-details { font-size: 17px; font-weight: 800; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
details.carte[open] .resume-details { margin-bottom: 4px; }
