/* ============================================================
   CrossFit HEKA - Planning lecture seule
   Bande de dates + journee en frise · charte navy claire
   Typo alignée heka-trial : Barlow + Bebas Neue (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

heka-planning { display: block; }

.hkp-root {
  --blue: #1a2b6b;
  --blue-d: #121f4f;
  --blue-light: #e8eefc;
  --blue-ghost: #eef2fb;
  --blue-border: rgba(26, 43, 107, 0.28);
  --text: #0d0f12;
  --text2: #374151;
  --muted: #4b5563;
  --dim: #9ca3af;
  --bg: #ffffff;
  --bg2: #f7f8fa;
  --surface: #f3f4f6;
  --border: #e5e7eb;
  --green: #059669;
  --green-bg: #d1fae5;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --tr: 0.15s ease;
  /* Pleine largeur de la colonne qui l'accueille, sans retrait : les bords alignent le widget sur le contenu de la page. */
  --pad-x: 0;
  --pad-y: 20px;
  /* Floor lisibilité aligné trial native (--text-min: 18px) */
  --text-min: 18px;
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--text-min);
  line-height: 1.45;
  color: var(--text);
  /* Transparent : le widget prend le fond de la strate qui l'accueille (blanc, gris ou bleu de la page). */
  background: transparent;
  display: block;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  /* La mise en page suit la largeur de la colonne qui accueille le widget, pas celle de l'ecran. */
  container-type: inline-size;
}

.hkp-root *,
.hkp-root *::before,
.hkp-root *::after {
  box-sizing: border-box;
}

.hkp-wrap {
  padding: var(--pad-y) var(--pad-x) 28px;
}

.hkp-filters {
  margin-bottom: 16px;
  padding: 14px 14px 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.hkp-filter-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.hkp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.hkp-chip {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}

.hkp-chip:hover {
  border-color: var(--blue-border);
}

.hkp-chip:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.hkp-chip.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.hkp-chip.is-outline.is-active {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

/* -- Texte reserve aux lecteurs d'ecran -- */
.hkp-root .hkp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* La bande des jours placee avant les filtres : l'enveloppe n'a pas de boite, la bande reste fixee sur tout le planning. */
.hkp-days-slot { display: contents; }

/* -- Bande de dates : une seule rangee. Les jours defilent (doigt ou fleches) tant que la colonne est trop etroite pour les 14. -- */
.hkp-root .hkp-strip {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.hkp-root .hkp-strip legend {
  padding: 0;
}

.hkp-strip-row {
  display: flex;
  align-items: stretch;
  background: var(--blue-d);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.hkp-strip-grid {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 6px;
  padding: 8px 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hkp-strip-grid::-webkit-scrollbar {
  display: none;
}

.hkp-root .hkp-step {
  flex: 0 0 36px;
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.hkp-root .hkp-step[aria-disabled='true'] {
  color: #6b79ad;
  cursor: default;
}

.hkp-root .hkp-step:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: -3px;
}

.hkp-root .hkp-date {
  position: relative;
  display: flex;
  flex: 0 0 66px;
  margin: 0;
  cursor: pointer;
  scroll-snap-align: center;
}

.hkp-root .hkp-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.hkp-date-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 2px 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-sm);
  color: #fff;
  line-height: 1.15;
  pointer-events: none;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}

.hkp-date-week,
.hkp-date-month {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c7d0ee;
}

.hkp-date-num {
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: 32px;
  line-height: 1;
}

.hkp-date-count {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Le survol ne touche jamais le jour choisi : sur son fond blanc, un voile bleu rendrait le texte illisible. */
.hkp-date-input:enabled:not(:checked):hover + .hkp-date-box {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.hkp-date-input:checked + .hkp-date-box {
  background: #fff;
  border-color: #fff;
  color: var(--blue-d);
}

.hkp-date-input:checked + .hkp-date-box .hkp-date-week,
.hkp-date-input:checked + .hkp-date-box .hkp-date-month {
  color: var(--blue);
}

.hkp-date-input:focus-visible + .hkp-date-box {
  outline: 3px solid #facc15;
  outline-offset: 1px;
}

.hkp-date.is-closed,
.hkp-date.is-over {
  cursor: default;
}

.hkp-date.is-closed .hkp-date-box,
.hkp-date.is-over .hkp-date-box {
  border-style: dashed;
  color: #aab4d8;
}

.hkp-date.is-closed .hkp-date-week,
.hkp-date.is-closed .hkp-date-month,
.hkp-date.is-over .hkp-date-week,
.hkp-date.is-over .hkp-date-month {
  color: #aab4d8;
}

/* -- Journee choisie : le geste horizontal passe d'un jour a l'autre, le navigateur garde le defilement vertical et le zoom -- */
.hkp-day-panel {
  touch-action: pan-y pinch-zoom;
}

.hkp-day-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue-d);
}

.hkp-root .hkp-day-heading-label {
  margin: 0;
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.4px;
  line-height: 1.1;
  color: var(--blue-d);
}

.hkp-root .hkp-day-heading-count {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.hkp-cols-head {
  display: none;
}

.hkp-root .hkp-period {
  margin: 0 0 20px;
  padding: 0;
}

.hkp-root .hkp-period-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--blue);
}

.hkp-period-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hkp-root .hkp-slots {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hkp-root .hkp-slot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
}

.hkp-slot-time {
  padding-top: 9px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hkp-slot-cells {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hkp-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hkp-cell.is-blank {
  display: none;
}

/* -- Un cours : le liseret dit la salle, le fond distingue les specialites du WOD -- */
.hkp-root :is(a, div).hkp-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 62px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--salle-line, var(--blue));
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: box-shadow var(--tr), transform var(--tr), border-color var(--tr);
}

.hkp-root a.hkp-tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.hkp-root a.hkp-tile:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.hkp-root :is(a, div).hkp-tile.is-special {
  background: var(--blue-light);
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.hkp-tile-discipline {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.hkp-tile-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--blue-d);
  overflow-wrap: anywhere;
}

.is-special .hkp-tile-title {
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.hkp-tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.hkp-tile-salle {
  color: var(--salle-fg, var(--blue));
  font-weight: 700;
}

.hkp-next {
  margin-bottom: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-d);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* Colonnes par salle quand la colonne de la page est assez large. */
@container (min-width: 860px) {
  /* Les 14 jours tiennent d'un coup : plus de defilement ni de fleches. */
  .hkp-strip-grid {
    display: grid;
    grid-template-columns: repeat(var(--hkp-days, 14), minmax(0, 1fr));
    padding: 8px;
    overflow: visible;
  }

  .hkp-root .hkp-step {
    display: none;
  }

  .hkp-day-panel:not([data-cols='1']) .hkp-cols-head {
    display: grid;
    grid-template-columns: 62px repeat(var(--hkp-cols, 3), minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .hkp-col-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    background: var(--salle-bg, var(--blue-ghost));
    color: var(--salle-fg, var(--blue));
    font-size: 15px;
    font-weight: 700;
  }

  .hkp-day-panel:not([data-cols='1']) .hkp-slot-cells {
    display: grid;
    grid-template-columns: repeat(var(--hkp-cols, 3), minmax(0, 1fr));
    gap: 10px;
  }

  .hkp-day-panel:not([data-cols='1']) .hkp-cell.is-blank {
    display: flex;
    border-radius: var(--r-sm);
    background: rgba(26, 43, 107, 0.03);
  }

  /* La salle est deja en tete de colonne : elle reste lue, sans etre repetee a l'ecran. */
  .hkp-day-panel:not([data-cols='1']) .hkp-tile-salle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .hkp-day-panel[data-cols='1'] .hkp-cell {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* -- Panneau des disciplines et son bouton : ecrans etroits seulement -- */
.hkp-root .hkp-sheet-trigger {
  display: none;
}

.hkp-root .hkp-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--bg);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.25);
}

.hkp-root .hkp-sheet::backdrop {
  background: rgba(13, 15, 18, 0.55);
}

.hkp-sheet-box {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 0;
}

.hkp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hkp-root .hkp-sheet-title {
  margin: 0;
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--blue-d);
}

.hkp-root .hkp-sheet-close {
  appearance: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.hkp-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hkp-root .hkp-sheet-grid .hkp-chip {
  min-height: 52px;
  border-radius: var(--r);
  line-height: 1.2;
}

.hkp-sheet-grid .hkp-chip:first-child {
  grid-column: 1 / -1;
}

/* Le bouton de validation reste visible meme si la liste defile. */
.hkp-root .hkp-sheet-apply {
  position: sticky;
  bottom: 0;
  appearance: none;
  min-height: 54px;
  margin: 14px 0 0;
  margin-bottom: max(14px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: var(--r);
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 0 8px var(--bg);
  cursor: pointer;
}

.hkp-root .hkp-sheet-close:focus-visible,
.hkp-root .hkp-sheet-apply:focus-visible,
.hkp-root .hkp-sheet-trigger:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* Telephone : trois salles de meme largeur, un bouton pour les disciplines, la bande des jours fixee. */
@container (max-width: 559px) {
  .hkp-filters {
    padding: 12px 10px;
  }

  .hkp-salle-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 0;
  }

  .hkp-root .hkp-chip-salle {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 58px;
    padding: 8px 2px;
    border-radius: var(--r);
    font-size: 15px;
    line-height: 1.15;
  }

  .hkp-salle-full {
    display: none;
  }

  .hkp-root .hkp-salle-short {
    display: inline;
  }

  .hkp-disc-label,
  .hkp-root .hkp-disc-chips {
    display: none;
  }

  .hkp-root .hkp-sheet-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 50px;
    margin: 8px 0 0;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    background: var(--bg);
    color: var(--text2);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .hkp-root .hkp-sheet-trigger.is-active {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
  }

  .hkp-sheet-trigger-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 800;
  }

  .hkp-root .hkp-sheet-trigger::after {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin: -4px 4px 0 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .hkp-root .hkp-strip {
    position: sticky;
    top: var(--hkp-sticky-top, 0px);
    z-index: 5;
    margin-bottom: 14px;
    padding: 6px 0;
    background: var(--bg);
  }

  /* Le titre « Jour » reste lu, sans prendre de hauteur dans la bande fixee. */
  .hkp-root .hkp-strip legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Un cours atteint au clavier ne se cache pas sous la bande. */
  .hkp-root :is(a, div).hkp-tile {
    scroll-margin-top: calc(var(--hkp-sticky-top, 0px) + 130px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hkp-root * {
    transition: none !important;
  }

  .hkp-root a.hkp-tile:hover {
    transform: none;
  }
}

.hkp-status {
  font-size: var(--text-min);
  color: var(--muted);
  margin: 0 0 12px;
}

.hkp-status.is-error { color: var(--red); }

.hkp-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 12px;
}

/* Variante « prochains » (pages d'activite) : le jour et l'heure au-dessus de chaque cours. */
.hkp-upcoming {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hkp-root .hkp-upcoming-when {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  line-height: 1.1;
}

.hkp-upcoming-time {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hkp-upcoming-day {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
}

.hkp-upcoming a.hkp-tile {
  flex: 1;
}

/* Une couleur par salle, texte fonce sur fond clair (contraste AA). */
.hkp-salle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--salle-dot, var(--salle-fg, var(--blue)));
  flex-shrink: 0;
}

/* Part-Dieu 1 (Lavoisier) et Part-Dieu 2 (Desaix) : rouge ; Croix-Rousse : jaune. */
.hkp-salle-desaix,
.hkp-salle-part-dieu { --salle-bg: #fee2e2; --salle-fg: #b91c1c; --salle-line: #b91c1c; }
.hkp-salle-croix-rousse { --salle-bg: #fef08a; --salle-fg: #713f12; --salle-dot: #eab308; --salle-line: #ca8a04; }

.hkp-chip-salle { display: inline-flex; align-items: center; gap: 8px; }
.hkp-salle-short { display: none; }
.hkp-chip-salle:not(.is-active) .hkp-salle-dot { opacity: 0.45; }

/* Salle ou discipline sans cours pour la selection : grisee, non cliquable. */
.hkp-root .hkp-chip.is-empty,
.hkp-root .hkp-chip.is-empty:hover {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg2, #f3f4f6);
  border-color: var(--border, #e5e7eb);
  color: var(--muted, #6b7280);
}

.hkp-chip-salle.is-empty .hkp-salle-dot { background: var(--dim, #9ca3af); }

.hkp-empty p {
  margin: 0 0 12px;
}

.hkp-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-size: var(--text-min);
  background: var(--bg2);
  border-radius: var(--r);
  border: 1px dashed var(--border);
}

/* -- Attente : barre d'halteres, mise en page et animations sont dans la bibliotheque partagee (mu-plugin heka-hekaflow,
   assets/heka-loader.css). Ici : le repli en texte quand elle est absente, et les silhouettes. -- */
.hkp-load-fallback {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.hkp-load-fallback > * { grid-area: 1 / 1; }

.hkp-load-note {
  position: sticky;
  top: calc(50vh - 80px);
  bottom: calc(50vh - 80px);
  z-index: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
}

.hkp-load-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hkp-load-failed .hkp-status { margin: 0; }

/* Silhouettes invisibles : elles ne font que reserver la hauteur du contenu attendu. */
.hkp-load-skeleton,
.hkp-sk-chip { visibility: hidden; }

.hkp-sk-chip { height: 44px; }

/* La bande des jours reste une seule rangee, coupee au bord comme la vraie. */
.hkp-sk-strip { margin-bottom: 24px; }

.hkp-sk-legend {
  width: 48px;
  height: 19px;
  margin-bottom: 10px;
}

.hkp-sk-days {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
  padding: 8px 0;
}

.hkp-sk-day {
  flex: 0 0 66px;
  height: 104px;
}

.hkp-sk-heading {
  width: 70%;
  height: 71px;
  margin-bottom: 14px;
}

.hkp-sk-period {
  width: 90px;
  height: 19px;
  margin-bottom: 10px;
}

.hkp-sk-slot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.hkp-sk-time {
  align-self: start;
  width: 52px;
  height: 22px;
  margin-top: 9px;
}

.hkp-sk-cells { min-width: 0; }

.hkp-sk-tile { height: 90px; }

/* En colonne etroite, une carte par horaire suffit a donner la forme. */
.hkp-sk-cells .hkp-sk-tile + .hkp-sk-tile { display: none; }

.hkp-sk-when {
  width: 130px;
  height: 25px;
}

.hkp-load-skeleton .hkp-upcoming .hkp-sk-tile { flex: 1 0 auto; }

@container (max-width: 559px) {
  /* Sur telephone le titre « Jour » ne prend pas de hauteur. */
  .hkp-sk-strip {
    margin-bottom: 14px;
    padding: 6px 0;
  }

  .hkp-sk-legend { display: none; }
}

@container (min-width: 860px) {
  .hkp-sk-days {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    padding: 8px;
  }

  .hkp-sk-cells {
    display: grid;
    grid-template-columns: repeat(var(--hkp-cols, 3), minmax(0, 1fr));
    gap: 10px;
  }

  .hkp-sk-cells .hkp-sk-tile + .hkp-sk-tile { display: block; }

  /* En large, le titre du jour tient sur une ligne, suivi des en-tetes de salle. */
  .hkp-sk-heading {
    height: 43px;
    margin-bottom: 57px;
  }
}

/* Desktop : aere, les prochains cours sur 2 puis 3 colonnes */
@media (min-width: 640px) {
  .hkp-root {
    --pad-y: 28px;
  }

  .hkp-list {
    grid-template-columns: 1fr 1fr;
  }
}

@container (min-width: 860px) {
  .hkp-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Copie de repli : Hekaflow n'a pas pu etre interroge, le dernier planning connu est affiche. */
.hkp-stale {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #14286e;
  background: #f3f4f8;
  color: #2b2b2b;
  font-size: 14px;
  line-height: 1.4;
}

/* -- Drop-in : bandeau au-dessus des filtres et actions discretes a droite de chaque cours -- */
.hkp-root .hkp-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; padding: 12px 14px; background: var(--blue-light); border-radius: var(--r-lg); }
.hkp-root .hkp-banner-text { display: flex; flex: 1 1 220px; flex-direction: column; gap: 2px; min-width: 0; }
.hkp-root .hkp-banner-text strong { font-size: 17px; font-weight: 800; color: var(--blue-d); }
.hkp-root .hkp-banner-text span { font-size: 15px; color: var(--text2); }
.hkp-root .hkp-banner-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 0 auto; padding: 8px 16px;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; text-transform: none; letter-spacing: 0; white-space: nowrap;
  color: #fff; background: var(--blue); border: 1.5px solid var(--blue); border-radius: 999px; cursor: pointer;
}
.hkp-root .hkp-banner.is-active { background: var(--blue-d); }
.hkp-root .hkp-banner.is-active .hkp-banner-text strong, .hkp-root .hkp-banner.is-active .hkp-banner-text span { color: #fff; }
.hkp-root .hkp-banner.is-active .hkp-banner-btn { color: var(--blue-d); background: #fff; border-color: #fff; }
.hkp-root .hkp-banner-btn:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.hkp-root :is(a, div).hkp-tile.has-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.hkp-root .hkp-tile-text { display: flex; flex: 1 1 124px; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.hkp-root .hkp-places { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 3px 8px; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; border-radius: 999px; }
.hkp-places::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hkp-root .hkp-places.is-open { color: #047857; background: var(--green-bg); }
.hkp-root .hkp-places.is-full { color: var(--red); background: var(--red-bg); }
.hkp-root .hkp-actions { display: flex; flex: none; flex-direction: column; align-items: stretch; gap: 6px; margin-left: auto; }
.hkp-root .hkp-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 104px; min-height: 36px; margin: 0; padding: 6px 12px;
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; text-transform: none; letter-spacing: 0; white-space: nowrap;
  color: var(--blue); background: var(--blue-light); border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.hkp-root a.hkp-btn:hover { color: var(--blue-d); border-color: var(--blue); }
.hkp-root .hkp-btn.is-quiet { background: transparent; border-color: var(--border); }
.hkp-root .hkp-tile.is-special .hkp-btn:not(.is-off) { background: #fff; }
.hkp-root .hkp-btn.is-off, .hkp-root .hkp-btn:disabled { color: var(--muted); background: var(--surface); border-color: transparent; font-weight: 600; cursor: default; }
.hkp-root .hkp-btn.is-off .hkp-arrow { opacity: 0.4; }
.hkp-arrow { font-size: 18px; line-height: 1; }
.hkp-root a.hkp-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.hkp-root .hkp-dropin-alt { margin: 18px 0 0; text-align: center; font-size: 16px; }
.hkp-root .hkp-dropin-alt a { color: var(--blue); font-weight: 700; text-decoration: underline; }

/* -- Page planning sur mobile : les boutons flottants du site passent a gauche, hors des actions des cartes, au-dessus
   du bouton de consentement. -- */
@media (max-width: 767px) {
  body:has(heka-planning[variant="liste"]) #heka-float-wrap { right: auto; left: 8px; bottom: 76px; align-items: flex-start; }
  body:has(heka-planning[variant="liste"]) :is(#heka-wa-btn, #heka-reopen) { width: 44px; height: 44px; }
}
