/* Importer mon emploi du temps (src/views/timetable.mjs, importEditor) : classes « tti- ». Deux façons, chacune
   dans un encart blanc bordé (les boutons secondaires du site ont la teinte douce : ils restent visibles) ;
   l'exemple d'écriture dans une petite boîte teintée. */
.tti-intro {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ox-muted, #6b6478);
}
.tti-way {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--c-border, #e2dbe8);
  border-radius: 12px;
  background: var(--panel, #fff);
}
.tti-way > h3 {
  margin: 0;
  font-size: 14px;
}
.tti-help {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ox-muted, #6b6478);
}
.tti-file,
.tti-model {
  justify-self: start;
}
.tti-example {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ox-wash, #f6f2fa);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}
/* L'aperçu modifiable (timetable-import.mjs, importHTML) : une ligne par créneau, un bandeau par jour ;
   une ligne décochée pâlit ; les matières à préciser dans une boîte teintée au-dessus. */
.tti-count {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
}
.tti-unknown {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ox-wash, #f6f2fa);
}
.tti-unknown > h4 {
  margin: 0;
  font-size: 13.5px;
}
.tti-map {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12.5px;
}
.tti-map > span {
  min-width: 11em;
}
.tti-map > select {
  flex: 1 1 14em;
  max-width: 22em;
}
.tti-table-wrap {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--c-border, #e2dbe8);
  border-radius: 10px;
}
.tti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tti-table th,
.tti-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--c-border, #eee8f2);
  text-align: left;
  vertical-align: middle;
}
.tti-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel, #fff);
  font-weight: 500;
}
.tti-table .tti-day th {
  background: var(--ox-wash, #f6f2fa);
  font-size: 12px;
}
.tti-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tti-table td > input:not([type='checkbox']),
.tti-table td > select {
  width: 100%;
  min-width: 7em;
  font-size: 12.5px;
}
.tti-off > td:not(:first-child) {
  opacity: 0.45;
}
/* La matière se lit en entier, quitte à passer sur deux lignes (lot E1). */
.tti-table td:nth-child(4) .select-value {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Sur un écran large, la fenêtre de l'import s'élargit et ses colonnes sont fixes : le titre prend la
   place qui reste (il se lit en entier), le niveau s'écrit en entier (« Les deux ») ; « déjà là » et
   le groupe passent sous l'horaire. */
@media (min-width: 700px) {
  dialog.editor:has(> form > [data-timetable-import]) {
    width: min(820px, calc(100vw - 30px));
    max-width: calc(100vw - 30px);
  }
  .tti-table {
    table-layout: fixed;
  }
  .tti-table thead th:nth-child(1) {
    width: 28px;
  }
  .tti-table thead th:nth-child(2) {
    width: 92px;
  }
  .tti-table thead th:nth-child(4) {
    width: 216px;
  }
  .tti-table thead th:nth-child(5) {
    width: 132px;
  }
  .tti-time > small {
    display: block;
  }
}
/* En tête du tableau : « Remplacer mon emploi du temps actuel », et ce qui partirait, en clair. */
.tti-replace {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--c-border, #e2dbe8);
  border-radius: 10px;
}
.tti-replace > .checkline {
  margin: 0;
}
.tti-leaves {
  margin: 4px 0 0 28px;
  font-size: 13px;
  line-height: 1.5;
}
/* Le second aperçu, résumé : ce qui est ajouté et ce qui part en tête, le détail replié. */
.tti-summary {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.5;
}
.tti-detail {
  margin: 10px 0 0;
}
.tti-detail > summary {
  cursor: pointer;
  font-size: 13px;
}
/* Au téléphone, chaque créneau tient sur deux lignes : la case, l'horaire (sur deux lignes) et la matière, qui
   se lit en entier (sur deux lignes s'il le faut) ; puis le titre, sur toute la largeur. En classe double, le
   niveau, écrit en entier, a sa ligne entre les deux (lot E1 : à côté du niveau, la matière se resserrait en
   « F… »). */
@media (max-width: 640px) {
  .tti-table thead {
    display: none;
  }
  .tti-table tr[data-tti-row] {
    display: grid;
    grid-template-columns: 28px min-content minmax(0, 1fr);
    grid-template-areas: 'keep time subject' 'title title title';
    align-items: center;
    border-bottom: 1px solid var(--c-border, #eee8f2);
  }
  .tti-table.tti-levels tr[data-tti-row] {
    grid-template-areas: 'keep time subject' '. level level' 'title title title';
  }
  .tti-table tr[data-tti-row] > td {
    border: 0;
  }
  .tti-table .tti-time {
    white-space: normal;
  }
  .tti-table tr[data-tti-row] > td:nth-child(1) {
    grid-area: keep;
  }
  .tti-table tr[data-tti-row] > td:nth-child(2) {
    grid-area: time;
  }
  .tti-table tr[data-tti-row] > td:nth-child(3) {
    grid-area: title;
  }
  .tti-table tr[data-tti-row] > td:nth-child(4) {
    grid-area: subject;
  }
  .tti-table tr[data-tti-row] > td:nth-child(5) {
    grid-area: level;
    justify-self: start;
  }
}
