/* Emploi du temps : chaque jour dans une couleur de l'ambiance (le porteur, 21 octobre 2026 : « c'est
   bien si on colore chaque jour »). Du lundi au vendredi, les cinq couleurs de l'ambiance (--p1 à
   --p5, posées par src/charter.mjs) ; le samedi et le dimanche reprennent les deux premières. Une
   teinte douce pour l'en-tête, un trait plus franc sous le nom du jour, la colonne à peine teintée ;
   les cartes gardent la couleur de leur matière. Les anciennes règles de src/refinement.css lisent
   --day-head, --day-line et --day-body. La frise (.fz-rows) prend les mêmes couleurs. */
.timetable-calendar > [data-timetable-day='1'],
.timetable-calendar > [data-timetable-day='6'],
.fz-rows > [data-fz-day='1'],
.fz-rows > [data-fz-day='6'] {
  --day-color: var(--p1, #7c7bff);
}
.timetable-calendar > [data-timetable-day='2'],
.timetable-calendar > [data-timetable-day='0'],
.fz-rows > [data-fz-day='2'],
.fz-rows > [data-fz-day='0'] {
  --day-color: var(--p2, #ffb703);
}
.timetable-calendar > [data-timetable-day='3'],
.fz-rows > [data-fz-day='3'] {
  --day-color: var(--p3, #2ec98a);
}
.timetable-calendar > [data-timetable-day='4'],
.fz-rows > [data-fz-day='4'] {
  --day-color: var(--p4, #3b9bff);
}
.timetable-calendar > [data-timetable-day='5'],
.fz-rows > [data-fz-day='5'] {
  --day-color: var(--p5, #ff5fa2);
}
.timetable-calendar > [data-timetable-day],
.fz-rows > [data-fz-day] {
  --day-head: color-mix(in srgb, var(--day-color) 32%, var(--t-panel, #fff));
  --day-line: color-mix(in srgb, var(--day-color) 85%, #000);
  --day-body: color-mix(in srgb, var(--day-color) 5%, var(--t-panel, #fff));
}
/* Une ambiance a souvent deux couleurs presque blanches : la clarté est fixée, la teinte gardée. */
@supports (color: oklch(from red l c h)) {
  .timetable-calendar > [data-timetable-day],
  .fz-rows > [data-fz-day] {
    --day-head: oklch(from var(--day-color) 0.88 clamp(0.045, c, 0.1) h);
    --day-line: oklch(from var(--day-color) 0.64 clamp(0.08, c, 0.16) h);
    --day-body: oklch(from var(--day-color) 0.985 clamp(0.006, c, 0.018) h);
  }
}

/* Emploi du temps et agenda : une plage vide dans tous les jours montrés (la pause de midi) est
   une bande fine, rayée, avec ses heures (src/calendarfolds.mjs, src/workspaceui.mjs). Elle laisse
   passer le clic : on peut encore y poser une séance. */
.calendar-fold {
  position: absolute;
  left: 34px;
  right: 2px;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
  color: var(--ox-quiet, #6b6478);
  background: repeating-linear-gradient(
    135deg,
    transparent 0 6px,
    color-mix(in srgb, var(--day-color, var(--primary)) 12%, transparent) 6px 12px
  );
  pointer-events: none;
}

/* La semaine en frise (src/views/timetable-frieze.mjs ; gestes : src/friezegestures.mjs),
   présentation « gestion de projet » choisie par le porteur (G1) : un tableau à gauche (jour,
   nombre de séances, durée), la ligne du temps à droite avec la grille des demi-heures et le trait
   de l'heure qu'il est. Une séance est une barre teintée de sa matière, sa bande à gauche et son
   rond posé dessus, comme les cartes des colonnes ; l'horaire puis le titre. --fz-zoom : pixels par
   minute ; --fz-row : hauteur d'une ligne ; tous deux réglables et gardés sur l'appareil. */
.tt-layout {
  margin: 0 0 10px;
}
.tt-layout svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}
.fz-week {
  --fz-label: 236px;
  --fz-line: var(--ox-rule, #e6dcef);
  --fz-now: #e5484d;
  position: relative;
}
.fz-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--fz-line);
  border-radius: 14px;
  background: var(--panel, #fff);
}
.fz-scale,
.fz-row {
  display: grid;
  grid-template-columns: var(--fz-label) auto;
  width: max-content;
  min-width: 100%;
}
.fz-scale {
  border-bottom: 1px solid var(--fz-line);
}
.fz-hours,
.fz-track {
  position: relative;
  width: calc(var(--fz-span) * var(--fz-zoom) * 1px);
  margin: 0 20px 0 18px;
}
.fz-hours {
  height: 34px;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}
.fz-hours:hover,
.fz-hours:focus-visible {
  background: color-mix(in srgb, var(--c-primary, var(--primary)) 7%, transparent);
}
.fz-hours > span {
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ox-quiet, #6b6478);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fz-row {
  border-bottom: 1px solid var(--fz-line);
  background: var(--day-body, var(--t-panel, #fff));
}
.fz-row:last-child {
  border-bottom: 0;
}
/* Le tableau de gauche ; il reste à gauche quand la frise défile (téléphone). */
.fz-day {
  position: sticky;
  left: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 62px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-right: 1px solid var(--fz-line);
  background: var(--day-head, var(--panel, #fff));
  box-shadow: inset 4px 0 0 var(--day-line, transparent);
}
.fz-name {
  font-size: 13.5px;
  font-weight: 600;
}
.fz-name > small {
  display: block;
  font-size: 11px;
  font-weight: 400;
}
.fz-num {
  font-size: 12.5px;
  color: var(--ox-quiet, #6b6478);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.fz-day.fz-head {
  background: var(--panel, #fff);
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ox-quiet, #6b6478);
}
.fz-head > span + span {
  text-align: right;
}
.fz-track {
  height: calc(var(--fz-lanes, 1) * var(--fz-row) + 10px);
  cursor: copy;
}
/* La grille des demi-heures (l'heure pleine plus marquée), la pause repliée, l'heure qu'il est. */
.fz-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fz-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--ink, #3a2b52) 6%, transparent);
}
.fz-tick-hour {
  background: color-mix(in srgb, var(--ink, #3a2b52) 13%, transparent);
}
.fz-fold {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 5px,
    color-mix(in srgb, var(--day-color, var(--primary)) 16%, transparent) 5px 10px
  );
  pointer-events: none;
}
.fz-now {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--fz-now);
  pointer-events: none;
}
.fz-now > span {
  position: absolute;
  top: 1px;
  left: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fz-now);
}
/* La séance : teintée de sa matière, sa bande à gauche, son rond posé dessus. */
.fz-slot {
  position: absolute;
  top: calc(5px + var(--fz-lane-index, 0) * var(--fz-row));
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: calc(var(--fz-row) - 6px);
  min-width: 14px;
  min-height: 0;
  margin: 0;
  padding: 3px 8px 3px 17px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--discipline-color, var(--primary)) 20%, var(--panel, #fff));
  box-shadow: inset 4px 0 0 var(--discipline-color, var(--primary));
  color: var(--ink, #3a2b52);
  font: inherit;
  text-align: left;
  cursor: grab;
  container-type: inline-size;
  touch-action: pan-y;
}
.fz-slot[data-fz-fixed] {
  cursor: pointer;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 6px,
    color-mix(in srgb, var(--discipline-color, var(--primary)) 14%, transparent) 6px 12px
  );
}
.fz-slot[aria-expanded='true'],
.fz-slot:focus-visible {
  box-shadow:
    inset 4px 0 0 var(--discipline-color, var(--primary)),
    0 0 0 2px var(--panel, #fff),
    0 0 0 4px var(--discipline-color, var(--primary));
}
.fz-slot.fz-dragging {
  z-index: 5;
  cursor: grabbing;
  opacity: 0.88;
  box-shadow:
    inset 4px 0 0 var(--discipline-color, var(--primary)),
    0 10px 24px rgb(40 20 60 / 22%);
}
/* Le rond de la matière : plein, l'icône en blanc ; sur une séance, à cheval sur sa bande. */
.fz-med {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--discipline-color, var(--primary));
  color: var(--c2-sur-couleur, #fff);
}
.fz-med > svg {
  width: 14px;
  height: 14px;
}
.fz-slot > .fz-med {
  position: absolute;
  top: 50%;
  left: -9px;
  z-index: 1;
  width: 22px;
  height: 22px;
  box-shadow: 0 0 0 2px var(--panel, #fff);
  translate: 0 -50%;
}
.fz-slot > .fz-med > svg {
  width: 13px;
  height: 13px;
}
.fz-txt {
  display: grid;
  min-width: 0;
  gap: 1px;
  overflow: hidden;
}
.fz-time {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  color: var(--ox-quiet, #6b6478);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fz-title {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Une séance étroite perd d'abord son heure de fin, puis son titre, puis tout sauf son rond. */
@container (max-width: 116px) {
  .fz-end {
    display: none;
  }
}
@container (max-width: 60px) {
  .fz-title {
    display: none;
  }
}
@container (max-width: 30px) {
  .fz-txt {
    display: none;
  }
}
@media (max-width: 700px) {
  .fz-week {
    --fz-label: 92px;
  }
  .fz-day {
    grid-template-columns: minmax(0, 1fr);
  }
  .fz-num,
  .fz-head > span + span {
    display: none;
  }
}
.fz-stretch {
  position: absolute;
  top: 18%;
  right: 0;
  bottom: 18%;
  width: 8px;
  border-radius: 4px;
  cursor: ew-resize;
}
.fz-slot:hover .fz-stretch {
  background: color-mix(in srgb, var(--discipline-color, var(--primary)) 35%, transparent);
}
.fz-grip {
  height: 12px;
  margin: 3px 0 0 var(--fz-label);
  border-radius: 99px;
  background: linear-gradient(var(--ox-rule, #e6dcef), var(--ox-rule, #e6dcef)) center / 46px 3px
    no-repeat;
  cursor: ns-resize;
  touch-action: none;
}
.fz-grip:hover,
.fz-grip:focus-visible {
  background-color: color-mix(in srgb, var(--c-primary, var(--primary)) 8%, transparent);
}
/* La fiche d'une séance, ouverte sur place. */
.fz-card {
  position: absolute;
  z-index: 20;
  width: 290px;
  max-width: calc(100% - 8px);
  padding: 12px 14px 10px;
  border: 1px solid var(--ox-rule, #e6dcef);
  border-top: 5px solid var(--discipline-color, var(--primary));
  border-radius: 14px;
  background: var(--panel, #fff);
  box-shadow: 0 16px 36px rgb(40 20 60 / 22%);
}
.fz-card-when {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.fz-card h3 {
  margin: 6px 0 2px;
  font-size: 15px;
}
.fz-card-who {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ox-quiet, #6b6478);
}
.fz-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--ox-rule, #e6dcef);
}
.fz-tools > button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c-primary, var(--primary)) 9%, var(--panel, #fff));
  color: var(--ink, #3a2b52);
  cursor: pointer;
}
.fz-tools > button.fz-tool-main {
  background: var(--c-primary, var(--primary));
  color: var(--c-onprimary, #fff);
}
.fz-tools > button:disabled {
  opacity: 0.4;
  cursor: default;
}
.fz-tools svg {
  width: 18px;
  height: 18px;
}
.fz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
}
.fz-legend > li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.fz-legend .fz-med {
  width: 20px;
  height: 20px;
}
.fz-legend .fz-med > svg {
  width: 12px;
  height: 12px;
}
.fz-legend small {
  color: var(--ox-quiet, #6b6478);
}
