/* ═══════════════════════════════════════════════════════════════════════
   modules-shared.css — Heures planétaires, charpente du thème (accordéon), thématiques HP, barre d'acti
   ─────────────────────────────────────────────────────────
   Extrait de astro_app_V3.8.9.html lignes 1930-3577 (Phase 2 du refactoring).
   Cascade : ce fichier doit être chargé dans l'ordre indiqué dans index.html.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   HEURES PLANÉTAIRES (v3.2)
══════════════════════════════════════════════════════════════════════════ */

/* Bandeau "Maître du jour" — style proche d'une lettrine */
.hp-day-master {
  background: linear-gradient(135deg, var(--ivoire-clair) 0%, rgba(160, 134, 84, 0.06) 100%);
  border: 1px solid var(--ivoire-fonce);
  border-left: 5px solid var(--or-mat);
  border-radius: 4px;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 1.5rem;
}

.hp-day-master.tres-favorable { border-left-color: var(--semantic-favorable); }
.hp-day-master.favorable      { border-left-color: var(--semantic-favorable); }
.hp-day-master.vigilance      { border-left-color: var(--semantic-vigilance); }

.hp-day-master-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--encre);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.hp-day-master-title .hp-day-planet {
  color: var(--terracotta);
  font-style: italic;
}

.hp-day-master-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--encre);
  margin: 0;
}

/* Encadré "Heure en cours" — très visible */
.hp-current {
  background: var(--ivoire-clair);
  border: 2px solid var(--terracotta);
  border-radius: 6px;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 1.5rem;
  box-shadow: 0 3px 10px rgba(184, 85, 63, 0.12);
}

.hp-current.tres-favorable { border-color: var(--semantic-favorable); }
.hp-current.favorable      { border-color: var(--semantic-favorable); }
.hp-current.vigilance      { border-color: var(--semantic-vigilance); }

.hp-current-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.6rem;
}

.hp-current-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hp-current-symbol {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--terracotta);
}

.hp-current-text {
  flex: 1;
}

.hp-current-planet {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--encre);
}

.hp-current-quality {
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--encre-clair);
}

.hp-current-time {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--encre-clair);
  margin-top: 0.2rem;
}

.hp-current-advice {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--encre);
  margin: 0.8rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--ivoire-fonce);
}

/* Sections jour/nuit */
.hp-section {
  margin: 1.5rem 0;
}

/* Grille de cartes : 3 colonnes par défaut, 2 sur tablette, 1 sur mobile */
.hp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
  margin-top: 0.8rem;
}

/* Carte d'heure planétaire */
.hp-card {
  background: var(--ivoire-clair);
  border: 1px solid var(--ivoire-fonce);
  border-left: 4px solid var(--encre-clair);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hp-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* ─── Code couleur favorable/neutre/défavorable visible immédiatement (v3.4) ─── */
/* Bordure gauche colorée + bordure haute légère pour signal visuel renforcé */
.hp-card.qualite-tres-favorable {
  border-left-color: var(--semantic-favorable);
  border-left-width: 6px;
}
.hp-card.qualite-favorable {
  border-left-color: #7a9181;  /* sauge plus clair */
  border-left-width: 5px;
}
.hp-card.qualite-vigilance {
  border-left-color: var(--semantic-vigilance);
  border-left-width: 5px;
}

/* ═══════════════════════════════════════════════════════════════════════
   V3.9.1 — Toggle "afficher les créneaux passés" (S1 #6.3)
   ─────────────────────────────────────────────────
   - Par défaut, .hp-card-past est masquée
   - Si l'utilisateur coche le toggle (qui pose la classe .hp-show-past sur
     le wrapper), les cards passées réapparaissent avec un style atténué
     pour qu'on identifie immédiatement qu'elles sont du passé
═══════════════════════════════════════════════════════════════════════ */

/* Bandeau de la case à cocher, posé entre les blocs amont et la grille */
.hp-passed-toggle {
  margin: 1rem 0 0.6rem;
  padding: 0.65rem 0.9rem;
  background: rgba(83, 158, 218, 0.06);
  border: 1px dashed rgba(83, 158, 218, 0.3);
  border-radius: 4px;
}
.hp-passed-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--encre);
  user-select: none;
}
.hp-passed-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--terracotta);
}
.hp-passed-toggle-label:hover {
  color: var(--terracotta-fonce);
}

/* Comportement par défaut : on masque les cards passées */
.hp-card-past {
  display: none;
}
/* Quand le wrapper est en mode .hp-show-past, on les réaffiche
   avec un style atténué (opacité + désaturation légère).
   Important : on remet `display: block` (et PAS `flex`) pour que la
   carte conserve sa mise en page interne d'origine. C'est la grid
   parente .hp-cards qui gère la disposition en colonnes. */
.hp-results-wrapper.hp-show-past .hp-card-past {
  display: block;
  opacity: 0.55;
  filter: grayscale(0.35);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.hp-results-wrapper.hp-show-past .hp-card-past:hover {
  opacity: 0.92;
  filter: grayscale(0);
}

/* ═══════════════════════════════════════════════════════════════════════
   CHARPENTE DU THÈME (v3.5)
══════════════════════════════════════════════════════════════════════════ */

/* Container accordéon principal */
.charpente-accordion {
  margin: 1rem 0 1.8rem;
  background: var(--ivoire-clair);
  border: 1px solid var(--ivoire-fonce);
  border-left: 5px solid var(--encre);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(26, 34, 56, 0.05);
}

/* Sommaire (toujours visible, cliquable) */
.charpente-summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.4rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--encre);
  background: linear-gradient(135deg, rgba(26, 34, 56, 0.04) 0%, rgba(184, 85, 63, 0.04) 100%);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.01em;
  list-style: none;
  position: relative;
}

.charpente-summary::-webkit-details-marker { display: none; }

.charpente-summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 1rem;
  color: var(--terracotta);
  transition: transform 0.25s ease;
}

.charpente-accordion[open] > .charpente-summary::after {
  transform: rotate(180deg);
}

.charpente-summary-icon {
  font-size: 1.4rem;
  color: var(--terracotta);
}

.charpente-summary-hint {
  margin-left: auto;
  margin-right: 0.5rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-clair);
  font-style: italic;
}

@media (max-width: 540px) {
  .charpente-summary {
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
  }
  .charpente-summary-hint { display: none; }
}

/* Contenu déplié */
.charpente-content {
  padding: 1.2rem 1.4rem 1.5rem;
}

@media (max-width: 540px) {
  .charpente-content {
    padding: 1rem;
  }
}

.charpente-intro {
  font-size: 0.9rem;
  color: var(--encre-clair);
  font-style: italic;
  margin: 0 0 1.3rem 0;
  padding: 0.6rem 0.9rem;
  background: rgba(160, 134, 84, 0.06);
  border-left: 3px solid var(--or-mat);
  border-radius: 2px;
  line-height: 1.6;
}

/* Bloc d'étape de la charpente */
.charpente-bloc {
  margin: 0 0 1.4rem 0;
  padding: 1rem 1.2rem;
  background: var(--ivoire);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 3px;
}

.charpente-bloc-titre {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--encre);
  margin: 0 0 0.6rem 0;
  letter-spacing: 0.01em;
}

.charpente-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--encre);
  color: var(--ivoire);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.charpente-bloc-explication {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--encre);
  margin: 0 0 0.8rem 0;
}

/* === BLOC 1 : Triangle fondamental === */
.bloc-triangle { border-left: 4px solid var(--encre); }

.triangle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 0.8rem;
}

@media (max-width: 720px) {
  .triangle-grid { grid-template-columns: 1fr; }
}

.triangle-cell {
  background: var(--ivoire-clair);
  border: 1px solid var(--ivoire-fonce);
  border-top: 3px solid var(--terracotta);
  padding: 0.7rem 0.85rem;
  border-radius: 2px;
}

.triangle-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.3rem;
}

.triangle-value {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--encre);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.triangle-meaning {
  font-size: 0.78rem;
  color: var(--encre-clair);
  line-height: 1.5;
  font-style: italic;
}

/* === BLOC 2 : Sect === */
.bloc-sect { border-left: 4px solid var(--or-mat); }

.sect-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.6rem;
}

.sect-icon {
  font-size: 4rem;
  text-align: center;
  color: var(--or-mat);
  line-height: 1;
}

.sect-explanation {
  font-size: 0.88rem;
  line-height: 1.6;
}

.sect-explanation p { margin: 0; }

@media (max-width: 540px) {
  .sect-grid { grid-template-columns: 1fr; text-align: center; }
}

/* === BLOC 3 : Maître de l'Ascendant === */
.bloc-maitre-asc { border-left: 4px solid var(--terracotta); }

.maitre-asc-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, rgba(184, 85, 63, 0.06) 0%, rgba(160, 134, 84, 0.05) 100%);
  border-radius: 3px;
}

.maitre-asc-symbole {
  font-size: 4rem;
  text-align: center;
  color: var(--terracotta);
  line-height: 1;
}

.maitre-asc-nom {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--encre);
  margin-bottom: 0.2rem;
}

.maitre-asc-position {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--encre);
  margin-bottom: 0.5rem;
}

.maitre-asc-statut {
  font-size: 0.83rem;
  color: var(--encre-clair);
  margin-bottom: 0.7rem;
}

.maitre-asc-lecture {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--encre);
  margin: 0;
}

@media (max-width: 540px) {
  .maitre-asc-grid { grid-template-columns: 1fr; text-align: center; }
}

/* === BLOC 4 : Bénéfiques / Maléfiques selon la sect === */
.bloc-sect-planetes { border-left: 4px solid var(--vert-sauge); }

.sect-planetes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 0.6rem;
}

@media (max-width: 540px) {
  .sect-planetes-grid { grid-template-columns: 1fr; }
}

.sect-planete-cell {
  padding: 0.7rem 0.85rem;
  background: var(--ivoire-clair);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 3px;
  text-align: center;
}

.sect-planete-cell.sp-benef-sect    { border-top: 3px solid var(--vert-sauge); background: rgba(94, 114, 100, 0.05); }
.sect-planete-cell.sp-benef-horssect { border-top: 3px solid #7a9181; }
.sect-planete-cell.sp-malef-sect    { border-top: 3px solid var(--or-mat); }
.sect-planete-cell.sp-malef-horssect { border-top: 3px solid var(--terracotta); background: rgba(184, 85, 63, 0.04); }

.sp-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-clair);
  margin-bottom: 0.4rem;
}

.sp-symbol {
  font-size: 1.8rem;
  color: var(--encre);
  margin-bottom: 0.2rem;
  line-height: 1;
}

.sp-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--encre);
  margin-bottom: 0.2rem;
}

.sp-position {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--encre-clair);
  margin-bottom: 0.4rem;
}

.sp-meaning {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--encre-clair);
  line-height: 1.4;
}

/* === BLOC 5 : Planètes angulaires === */
.bloc-angulaires { border-left: 4px solid var(--terracotta); }

.angulaires-liste {
  list-style: none;
  margin: 0.7rem 0 0 0;
  padding: 0;
}

.angulaire-item {
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.4rem;
  background: var(--ivoire-clair);
  border-left: 3px solid var(--terracotta);
  border-radius: 2px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.angulaire-symbol {
  font-size: 1.1rem;
  color: var(--terracotta);
  margin-right: 0.3rem;
}

.angulaire-nom {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--encre);
}

.angulaire-orbe {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--encre-clair);
  margin-left: 0.3rem;
}

/* === BLOC 6 : Aspects serrés === */
.bloc-aspects-serres { border-left: 4px solid #7a9181; }

.aspects-serres-liste {
  list-style: none;
  margin: 0.7rem 0 0 0;
  padding: 0;
}

.aspect-serre-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.3rem;
  background: var(--ivoire-clair);
  border-radius: 2px;
  font-size: 0.85rem;
}

.aspect-serre-paire {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--encre);
}

.aspect-serre-nom {
  font-style: italic;
  color: var(--encre-clair);
  flex: 1;
}

.aspect-serre-orbe {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--encre-clair);
}

.aspect-symbol-mini {
  font-size: 1rem;
}

.aspect-symbol-mini.harmonique { color: var(--vert-sauge); }
.aspect-symbol-mini.tension    { color: var(--terracotta); }

/* === BLOC 7 : Configurations === */
.bloc-configurations { border-left: 4px solid var(--or-mat); }

.config-sous-bloc {
  margin: 0.7rem 0 0 0;
  padding: 0.7rem 0.9rem;
  background: var(--ivoire-clair);
  border-radius: 3px;
}

.config-sous-titre {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--or-mat);
}

.config-item {
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0 0 0.5rem 0;
}

.config-item:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   BLOC THÉMATIQUES Heures planétaires (v3.4)
══════════════════════════════════════════════════════════════════════════ */
.hp-themes-block {
  margin: 1rem 0;
  padding: 0.9rem;
  background: rgba(160, 134, 84, 0.04);
  border: 1px solid var(--ivoire-fonce);
  border-left: 3px solid var(--or-mat);
  border-radius: 4px;
}

.hp-themes-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--encre);
  margin: 0 0 0.4rem 0;
  letter-spacing: 0.01em;
}

.hp-themes-search-wrapper {
  margin: 0.5rem 0 0.7rem 0;
  position: relative;
}

.hp-themes-search-wrapper input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--ivoire-fonce);
  border-radius: 3px;
  background: var(--ivoire-clair);
}

.hp-themes-search-wrapper input:focus {
  outline: none;
  border-color: var(--or-mat);
  box-shadow: 0 0 0 2px rgba(160, 134, 84, 0.15);
}

.hp-themes-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.3rem 0.2rem;
  background: var(--ivoire);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 3px;
  transition: max-height 0.25s ease;
}

.hp-themes-list.collapsed {
  max-height: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}

.hp-themes-partie {
  margin: 0.3rem 0 0.5rem 0;
}

.hp-themes-partie-title {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  padding: 0.4rem 0.5rem 0.3rem;
  margin: 0;
}

.hp-themes-partie:not(:first-child) .hp-themes-partie-title {
  border-top: 1px dashed var(--ivoire-fonce);
  margin-top: 0.3rem;
  padding-top: 0.5rem;
}

.hp-themes-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.83rem;
  line-height: 1.35;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
}

.hp-themes-checkbox:hover {
  background: rgba(160, 134, 84, 0.08);
}

.hp-themes-checkbox input[type="checkbox"] {
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  cursor: pointer;
}

.hp-themes-checkbox.hidden {
  display: none;
}

.hp-themes-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.btn-mini-link {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--terracotta);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  letter-spacing: 0.03em;
}

.btn-mini-link:hover {
  text-decoration: underline;
}

/* ─── Bordures colorées sur les cartes selon thématiques cochées (v3.4) ─── */
.hp-card.theme-favorable {
  border: 2px solid var(--semantic-favorable);
  box-shadow: 0 2px 8px rgba(94, 114, 100, 0.15);
}

.hp-card.theme-defavorable {
  border: 2px solid var(--semantic-vigilance);
  box-shadow: 0 2px 8px rgba(184, 85, 63, 0.15);
}

/* Liste des thèmes affectés au sein de chaque carte */
.hp-card-themes {
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.hp-card-theme-tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.hp-card-theme-tag.tag-favorable {
  background: var(--semantic-favorable-bg-strong);
  color: var(--semantic-favorable);
  border: 1px solid var(--semantic-favorable);
}

.hp-card-theme-tag.tag-defavorable {
  background: var(--semantic-vigilance-bg-strong);
  color: var(--semantic-vigilance);
  border: 1px solid var(--semantic-vigilance);
}

/* ═══════════════════════════════════════════════════════════════════════
   BARRE D'ACTIONS EN HAUT DE PAGE (v3.4)
   ─────────────────────────────────────
   Petite barre fixée en haut de chaque résultat avec un bouton "Exporter en PDF"
   qui réplique l'action du bouton dans la colonne de gauche.
══════════════════════════════════════════════════════════════════════════ */
.results-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--ivoire-fonce);
}

.results-actions-bar .btn-export-pdf {
  /* Variante compacte pour la barre du haut */
  display: inline-flex;
  width: auto;
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
}

@media (max-width: 540px) {
  .results-actions-bar {
    justify-content: stretch;
  }
  .results-actions-bar .btn-export-pdf {
    width: 100%;
    justify-content: center;
  }
}

/* ─── Activations mundanes colorées (v3.4) ─── */
.hp-activation-list {
  list-style: none;
  margin: 0.4rem 0;
  padding: 0;
}

.hp-activation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  margin-bottom: 0.3rem;
  border-radius: 3px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.hp-activation-item.hp-activation-favorable {
  background: var(--semantic-favorable-bg);
  border-left: 3px solid var(--semantic-favorable);
}

.hp-activation-item.hp-activation-vigilance {
  background: var(--semantic-vigilance-bg);
  border-left: 3px solid var(--semantic-vigilance);
}

.hp-activation-item.hp-activation-tension {
  background: var(--semantic-tension-bg);
  border-left: 3px solid var(--semantic-tension);
}

.hp-activation-item.hp-activation-neutre {
  background: var(--semantic-neutre-bg);
  border-left: 3px solid var(--semantic-neutre);
}

.hp-activation-dot {
  flex-shrink: 0;
  margin-top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.hp-activation-section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--encre);
  margin: 1rem 0 0.5rem 0;
  letter-spacing: 0.01em;
}

.hp-activation-section-triple {
  color: var(--semantic-favorable);
}

.hp-activation-section-double {
  color: var(--terracotta);
}

.hp-activation-details {
  margin-top: 0.5rem;
  background: rgba(26, 34, 56, 0.03);
  border-radius: 3px;
  padding: 0.5rem 0.8rem;
}

.hp-activation-details summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--terracotta);
  list-style: none;
  user-select: none;
  padding: 0.2rem 0;
}

.hp-activation-details summary::-webkit-details-marker { display: none; }

.hp-activation-details[open] summary {
  margin-bottom: 0.3rem;
  border-bottom: 1px dashed var(--ivoire-fonce);
  padding-bottom: 0.4rem;
}

.hp-activation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  margin-top: 0.8rem;
  background: rgba(26, 34, 56, 0.03);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--encre-clair);
  letter-spacing: 0.02em;
}

.hp-activation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hp-activation-legend .dot {
  width: 8px;
  height: 8px;
}

/* Bandeau de qualité au-dessus du contenu : signal visuel immédiat */
.hp-quality-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.9rem -1rem 0.6rem -1rem;
  padding: 0.4rem 1rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hp-quality-banner .hp-quality-icon {
  font-size: 0.95rem;
}

.qualite-tres-favorable .hp-quality-banner {
  background: var(--semantic-favorable-bg-strong);
  color: var(--semantic-favorable);
  border-bottom: 1px solid var(--semantic-favorable);
}

.qualite-favorable .hp-quality-banner {
  background: rgba(122, 145, 129, 0.15);
  color: #5e7264;
  border-bottom: 1px solid #7a9181;
}

.qualite-vigilance .hp-quality-banner {
  background: var(--semantic-vigilance-bg-strong);
  color: var(--semantic-vigilance);
  border-bottom: 1px solid var(--semantic-vigilance);
}

/* Heure en cours : highlight terracotta */
.hp-card-current {
  border: 2px solid var(--terracotta);
  background: rgba(184, 85, 63, 0.04);
  box-shadow: 0 2px 8px rgba(184, 85, 63, 0.12);
}

/* Heure doublement renforcée : encadré doré */
.hp-card-doubled {
  border: 2px solid var(--or-mat);
  background: linear-gradient(135deg, rgba(160, 134, 84, 0.08) 0%, rgba(184, 85, 63, 0.05) 100%);
}

.hp-card-doubled.hp-card-current {
  /* Si à la fois en cours ET doublement renforcée : combinaison or + terracotta */
  border-color: var(--terracotta);
  box-shadow: 0 2px 12px rgba(160, 134, 84, 0.25);
}

.hp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.hp-card-time {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--encre);
}

.hp-card-num {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-clair);
}

.hp-card-planet {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hp-card-symbol {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--terracotta);
}

.hp-card-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--encre);
}

.hp-card-quality {
  font-size: 0.8rem;
  color: var(--encre-clair);
  font-style: italic;
  margin-left: auto;
}

.hp-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  margin-bottom: 0.5rem;
  background: var(--or-mat);
  color: var(--ivoire);
}

.hp-card-badge-current {
  background: var(--terracotta);
}

.hp-card-conseil {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--encre);
  margin-bottom: 0.5rem;
}

/* Détails repliables (favorisé / à éviter / recommandation) */
.hp-card-details {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--ivoire-fonce);
  padding-top: 0.5rem;
}

.hp-card-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--terracotta);
  letter-spacing: 0.04em;
  list-style: none;
  user-select: none;
}

.hp-card-details summary::-webkit-details-marker { display: none; }
.hp-card-details summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.hp-card-details[open] summary::before {
  content: '▾ ';
}

.hp-card-details-content {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.hp-card-row {
  margin-bottom: 0.6rem;
}

.hp-card-row strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
  color: var(--encre);
}

.hp-card-row ul {
  margin: 0 0 0 1.2rem;
  padding: 0;
}

.hp-card-row ul li {
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Bloc "Pour vous personnellement" — lecture contextualisée selon le thème natal (v3.3) */
.hp-card-personal {
  background: linear-gradient(135deg, rgba(160, 134, 84, 0.10) 0%, rgba(184, 85, 63, 0.06) 100%);
  border: 1px solid rgba(160, 134, 84, 0.25);
  border-left: 3px solid var(--or-mat);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  margin: 0.6rem 0 0.5rem;
}

.hp-card-personal strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--or-mat);
  margin-bottom: 0.3rem;
}

.hp-card-personal p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--encre);
}

.hp-card-personal p strong {
  display: inline;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--terracotta);
  margin-bottom: 0;
}

.hp-card-personal p em {
  font-style: italic;
  color: var(--encre-clair);
}

.hp-card-recommendation {
  background: rgba(184, 85, 63, 0.08);
  border-left: 3px solid var(--terracotta);
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.hp-card-recommendation strong {
  color: var(--terracotta);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Responsive heures planétaires */
@media (max-width: 720px) {
  .hp-cards {
    grid-template-columns: 1fr;
  }

  .hp-current-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .hp-current-symbol {
    font-size: 2rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE COMPLET (v3.1)
   ─────────────────────────
   Système de breakpoints :
   - Tablette large    (≤ 1024px) : ajustement des marges, header plus dense
   - Tablette          (≤ 900px)  : 1 colonne (formulaire au-dessus)
   - Mobile large      (≤ 720px)  : tableaux scrollables, onglets compacts
   - Mobile            (≤ 540px)  : tableaux en cartes, form-panel non-sticky
   - Mobile petit      (≤ 380px)  : adaptations finales
══════════════════════════════════════════════════════════════════════════ */

/* ───── Tablette large (≤ 1024px) ───────────────────────────────── */
@media (max-width: 1024px) {
  .header { padding: 1.5rem; }
  .main { padding: 1.5rem; max-width: 100%; }
  .tabs { padding: 0 1.5rem; }
  .title-block h1 { font-size: 2.4rem; }
}

/* ───── Tablette (≤ 900px) — passe en 1 colonne ─────────────────── */
@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Formulaire ne doit plus être sticky en mode mobile (gêne le scroll) */
  .form-panel {
    position: relative !important;
    top: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Horoscope passe en 1 colonne pour tablette portrait */
  .horoscope-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* ───── Mobile large (≤ 720px) ──────────────────────────────────── */
@media (max-width: 720px) {

  /* Header plus compact */
  .header {
    padding: 1rem 1.25rem;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .title-block h1 { font-size: 1.8rem; }
  .title-block .subtitle { font-size: 0.85rem; }

  .header-meta {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .mode-selector {
    margin: 0;
  }

  .mode-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .version {
    font-size: 0.7rem;
  }

  /* Onglets : scroll horizontal avec indicateur visuel */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 0 1rem;
    gap: 0.5rem;
    /* Permettre de scroller sans rebondir */
    scroll-snap-type: x proximity;
    /* Masque dégradé sur les bords pour suggérer le scroll */
    mask-image: linear-gradient(90deg, transparent, black 1rem, black calc(100% - 1rem), transparent);
  }

  .tab {
    flex-shrink: 0;
    padding: 0.7rem 1rem;
    font-size: 0.78rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .main {
    padding: 1rem;
  }

  /* Form-panel : padding réduit */
  .form-panel {
    padding: 1.25rem;
  }

  .form-panel h2 {
    font-size: 1.2rem;
  }

  /* Champs de formulaire : taille de police adaptée mobile (≥ 16px pour éviter le zoom auto sur iOS) */
  .field-group input,
  .field-group select,
  .field-group textarea {
    font-size: 16px !important;  /* Empêche le zoom auto iOS */
  }

  .field-row,
  .field-row-date-heure {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  /* Tableaux : permettre le scroll horizontal pour préserver les colonnes */
  .astro-table {
    font-size: 0.78rem;
  }

  .astro-table th,
  .astro-table td {
    padding: 0.5rem 0.4rem;
  }

  /* Sections : padding réduit */
  .section {
    margin: 1.2rem 0;
  }

  .section-title {
    font-size: 1.05rem;
    flex-wrap: wrap;
  }

  .section-title .count {
    font-size: 0.7rem;
  }

  /* Encadrés interprétation : padding réduit */
  .interp-box {
    padding: 1rem 1.1rem;
    margin: 0.8rem 0 1.2rem;
  }

  .interp-box-title {
    font-size: 1.05rem;
  }

  .interp-box p {
    font-size: 0.88rem;
  }

  /* Portrait synthétique */
  .portrait-synthetique {
    padding: 1.2rem 1.3rem;
  }

  .portrait-synthetique p {
    font-size: 0.92rem;
  }

  /* Theme header : recentrage texte */
  .theme-header {
    padding: 1rem 0;
    text-align: center;
  }

  .theme-header .person-name {
    font-size: 1.6rem;
  }

  .theme-header .person-data {
    font-size: 0.82rem;
  }

  .theme-header .signature {
    font-size: 0.72rem;
    flex-direction: column;
    gap: 0.3rem;
  }

  /* Bouton PDF : pleine largeur dans tous les contextes */
  .btn-export-pdf {
    width: 100%;
    justify-content: center;
  }

  /* Empty states : padding réduit */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state .symbol {
    font-size: 3rem;
  }

  /* Distribution boxes : 1 colonne */
  .distribution {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Synthèse personnelle : padding interne réduit */
  .results-panel .section h4 {
    font-size: 1.1rem !important;
  }

  /* Suggestions de villes : optimisé pour tactile */
  .city-suggestions li {
    padding: 0.7rem 0.9rem;
    min-height: 44px;  /* Touch target minimum */
  }

  /* Horoscope cards : 1 colonne pleine largeur */
  .horoscope-grid {
    grid-template-columns: 1fr;
  }

  /* Footer note */
  .footer-note {
    font-size: 0.75rem;
    padding: 1rem;
  }
}

/* ───── Mobile (≤ 540px) — Tableaux en cartes empilées ────────────── */
@media (max-width: 540px) {

  /* Tableaux marqués .astro-table-responsive deviennent des cartes */
  .astro-table-responsive {
    display: block;
    border: none;
  }

  .astro-table-responsive thead {
    display: none;  /* Cacher l'en-tête sur mobile */
  }

  .astro-table-responsive tbody {
    display: block;
  }

  .astro-table-responsive tr {
    display: block;
    background: var(--ivoire-clair);
    border: 1px solid var(--ivoire-fonce);
    border-radius: 4px;
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 2px rgba(26, 34, 56, 0.04);
  }

  .astro-table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.4rem 0;
    border: none;
    text-align: right;
  }

  .astro-table-responsive td::before {
    content: attr(data-label);
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--encre-clair);
    flex-shrink: 0;
    text-align: left;
    min-width: 70px;
  }

  /* La cellule "Lecture" prend toute la largeur (trop longue pour la disposition côte à côte) */
  .astro-table-responsive td[data-label="Lecture"] {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    border-top: 1px dashed var(--ivoire-fonce);
    margin-top: 0.5rem;
    padding-top: 0.6rem;
  }

  .astro-table-responsive td[data-label="Lecture"]::before {
    margin-bottom: 0.4rem;
  }

  /* Header plus compact */
  .header {
    padding: 0.9rem 1rem;
  }

  .title-block h1 {
    font-size: 1.5rem;
  }

  .title-block .subtitle {
    font-size: 0.78rem;
  }

  /* Padding général réduit */
  .main {
    padding: 0.9rem;
  }

  .form-panel {
    padding: 1rem;
  }

  /* Boutons des modes plus serrés */
  .mode-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
  }

  /* Tabs : flex-direction column si trop nombreux */
  .tabs {
    padding: 0 0.7rem;
  }

  .tab {
    font-size: 0.74rem;
    padding: 0.6rem 0.85rem;
  }

  /* Section de results */
  .results-panel {
    padding: 1rem;
  }

  /* Theme header centré */
  .theme-header .person-name {
    font-size: 1.4rem;
  }

  /* Portrait synthétique : encore plus compact */
  .portrait-synthetique {
    padding: 1rem;
  }

  .portrait-synthetique p {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  /* Encadrés interprétation : icônes plus petites */
  .interp-box {
    padding: 0.9rem 1rem;
  }

  .interp-box-title {
    font-size: 1rem;
    flex-wrap: wrap;
  }

  .interp-box-icon {
    font-size: 1.1rem;
  }

  .interp-box p {
    font-size: 0.85rem;
  }

  /* Horoscope cards */
  .horoscope-card {
    padding: 0.9rem 1rem;
  }

  .horoscope-card-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.4rem 0.6rem;
  }

  .horoscope-stars {
    grid-column: 1 / -1;
    text-align: left;
    padding-top: 0.2rem;
    border-top: 1px dashed rgba(26, 34, 56, 0.08);
  }

  /* Synthèse personnelle */
  .results-panel .section h4 {
    font-size: 1.05rem !important;
  }

  /* Field row : on peut empiler date+heure si trop serré */
  .field-row-date-heure {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Mode-selector en haut, en ligne */
  .header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  /* Theme recent chips : plein largeur si nécessaire */
  .themes-recents-list {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-recent-chip {
    justify-content: space-between;
  }

  /* Portrait header : élément/maison en colonne */
  .signature {
    font-size: 0.7rem;
  }
}

/* ───── Mobile très petit (≤ 380px) ──────────────────────────────── */
@media (max-width: 380px) {
  .title-block h1 {
    font-size: 1.3rem;
  }

  .tab {
    font-size: 0.72rem;
    padding: 0.55rem 0.7rem;
  }

  .form-panel {
    padding: 0.8rem;
  }

  .form-panel h2 {
    font-size: 1.1rem;
  }

  .interp-box {
    padding: 0.8rem;
  }

  .horoscope-card {
    padding: 0.8rem;
  }
}

/* ───── Améliorations tactiles globales ──────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Sur écrans tactiles, agrandir les zones cliquables */
  .tab,
  .mode-btn,
  .btn-primary,
  .btn-secondary,
  .btn-export-pdf,
  .city-suggestions li,
  .theme-recent-chip {
    min-height: 44px;
  }

  /* Annuler les effets hover qui ne sont pas pertinents tactile */
  .horoscope-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
  }
}

