/* ==================================================================
   Yoldez & Yara — feuille de style v1.2
   Direction : le cahier scolaire. Filets plutôt qu'ombres, marge
   colorée par élève, chiffres en romain pour les notes et les dates.
   ================================================================== */

:root {
  /* Encre et papier */
  --ink:        #17233A;
  --ink-2:      #44506B;
  --ink-3:      #6E7890;
  --paper:      #FFFFFF;
  --paper-2:    #F6F6F1;
  --bg:         #EEEFEA;
  --rule:       #DCDCD2;
  --rule-firm:  #C3C4B8;

  /* Accents */
  --teal:       #177A6E;
  --navy:       #2E4482;
  --olive:      #6B7245;
  --rouge:      #B3332C;
  --ambre:      #9A6414;

  --teal-wash:  #E6F1EF;
  --navy-wash:  #E8ECF7;
  --olive-wash: #EFF1E4;
  --rouge-wash: #FAECEA;
  --ambre-wash: #FBF2E2;

  /* Couleur de l'élève courant, surchargée par --who en ligne */
  --who: var(--navy);

  /* Échelle typographique (tierce mineure) */
  --t-xs: .75rem;
  --t-sm: .8125rem;
  --t-md: .9375rem;
  --t-lg: 1.0625rem;
  --t-xl: 1.3125rem;
  --t-2xl: 1.6875rem;
  --t-3xl: 2.125rem;

  --sans:  "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "IBM Plex Serif", ui-serif, Georgia, "Times New Roman", serif;
  --arab:  "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Traditional Arabic", serif;

  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --tabbar-h: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #E7E7E0;
    --ink-2:     #B3B8C4;
    --ink-3:     #878EA0;
    --paper:     #1B1F27;
    --paper-2:   #232833;
    --bg:        #14171D;
    --rule:      #333944;
    --rule-firm: #474E5C;

    --teal:      #4FB3A4;
    --navy:      #7D95D8;
    --olive:     #A8B072;
    --rouge:     #E2776D;
    --ambre:     #D5A047;

    --teal-wash:  #17302E;
    --navy-wash:  #1D2540;
    --olive-wash: #272B1C;
    --rouge-wash: #34201E;
    --ambre-wash: #322715;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.55;
  padding-bottom: var(--tabbar-h);
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"], [lang="ar"] { font-family: var(--arab); }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .4em; font-weight: 600; letter-spacing: -.012em; line-height: 1.22; }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
p  { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }

/* Les nombres portent l'information : romain, tabulaire, jamais approximatif. */
.fig, .figure, .stat-num, .gval, td.num, .ribbon-time {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.muted  { color: var(--ink-2); }
.quiet  { color: var(--ink-3); font-size: var(--t-sm); }
.nowrap { white-space: nowrap; }

/* Accessibilité ---------------------------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: .7rem 1rem; border-radius: 0 0 var(--r-md) 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==================================================================
   En-tête
   ================================================================== */
.topbar {
  background: var(--ink);
  color: var(--paper-2);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 60;
}
@media (prefers-color-scheme: dark) {
  .topbar { background: #0F1219; color: var(--ink); }
}
.topbar-inner {
  width: min(1140px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  min-height: 60px;
  display: flex; align-items: center; gap: 1.25rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: var(--r-sm);
  font-family: var(--serif); font-size: var(--t-sm); letter-spacing: .04em;
}
.brand-name { font-size: var(--t-md); white-space: nowrap; }
.brand-amp { font-family: var(--serif); font-style: italic; opacity: .7; }

.mainnav { display: flex; gap: .15rem; flex: 1; }
.mainnav a {
  color: rgba(255,255,255,.72);
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  font-size: var(--t-md);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.07); }
.mainnav a.is-active { color: #fff; border-bottom-color: var(--teal); border-radius: var(--r-sm) var(--r-sm) 0 0; }

.usermenu { position: relative; }
.usermenu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.85); padding: .3rem;
  border-radius: var(--r-md);
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: rgba(255,255,255,.08); }
.avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--teal); color: #fff;
  font-size: var(--t-sm); font-weight: 600;
}
.usermenu-name { font-size: var(--t-sm); }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 70;
  min-width: 15rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-firm); border-radius: var(--r-md);
  padding: .3rem;
}
.usermenu-panel a, .usermenu-logout button {
  display: block; width: 100%; text-align: left;
  padding: .55rem .7rem; border-radius: var(--r-sm);
  color: var(--ink); font: inherit; background: none; border: 0; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-logout button:hover { background: var(--paper-2); text-decoration: none; }
.usermenu-logout { margin: .3rem 0 0; border-top: 1px solid var(--rule); padding-top: .3rem; }
.usermenu-logout button { color: var(--rouge); }

/* ==================================================================
   Mise en page
   ================================================================== */
.container {
  width: min(1140px, 100% - 2 * var(--gutter));
  margin: 1.75rem auto 3rem;
}

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--rule-firm);
}
.page-head h1 { margin: 0; }
.page-head .page-sub { color: var(--ink-2); font-size: var(--t-md); margin: .2rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.stack > * + * { margin-top: 1.1rem; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.1rem; }

.footer {
  width: min(1140px, 100% - 2 * var(--gutter));
  margin: 0 auto 2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-3); font-size: var(--t-xs);
  border-top: 1px solid var(--rule); padding-top: .9rem;
}

/* ==================================================================
   Panneaux — le filet de marge porte la couleur de l'élève
   ================================================================== */
.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-tight { padding: 0; overflow: hidden; }

.marge {
  border-left: 3px solid var(--who);
  padding-left: 1.1rem;
}
[dir="rtl"] .marge { border-left: 0; border-right: 3px solid var(--who); padding: 0 1.1rem 0 0; }

.who-name { color: var(--who); font-weight: 600; }

/* Sélecteur d'élève ------------------------------------------------ */
.switcher {
  display: flex; gap: .4rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.switcher-item {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .85rem;
  border: 1px solid var(--rule-firm); border-radius: 999px;
  background: var(--paper); color: var(--ink-2);
  font-size: var(--t-md);
}
.switcher-item:hover { text-decoration: none; border-color: var(--who); color: var(--ink); }
.switcher-item.is-active {
  border-color: var(--who); color: var(--who);
  box-shadow: inset 0 0 0 1px var(--who);
  font-weight: 600;
}
.switcher-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--who); flex: none; }

/* ==================================================================
   Ruban du jour — la journée de chaque élève, heure par heure
   ================================================================== */
.daygrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.1rem; }

.day-panel { --who: var(--navy); }
.day-head {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding-bottom: .7rem; margin-bottom: .2rem;
  border-bottom: 1px solid var(--rule);
}
.day-head h2 { margin: 0; font-size: var(--t-lg); color: var(--who); }
.day-head .day-level { color: var(--ink-3); font-size: var(--t-sm); }

.ribbon { list-style: none; margin: 0; padding: 0; }
.ribbon-row {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: .9rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.ribbon-row:last-child { border-bottom: 0; }
.ribbon-time {
  font-size: var(--t-sm); color: var(--ink-2);
  display: flex; flex-direction: column; line-height: 1.3;
  padding-top: .1rem;
}
.ribbon-time .to { color: var(--ink-3); font-size: var(--t-xs); }
.ribbon-subject { font-weight: 500; }
.ribbon-meta { color: var(--ink-3); font-size: var(--t-sm); }
.ribbon-row.is-now {
  background: var(--teal-wash);
  border-radius: var(--r-md);
  padding-inline: .6rem;
  margin-inline: -.6rem;
  border-bottom-color: transparent;
}
.ribbon-row.is-now .ribbon-time { color: var(--teal); font-weight: 600; }
.ribbon-row.is-past { opacity: .5; }
.now-tag {
  font-size: var(--t-xs); color: var(--teal);
  border: 1px solid currentColor; border-radius: 999px;
  padding: 0 .4rem; margin-left: .4rem; white-space: nowrap;
}

/* Résumé chiffré en pied de colonne */
.daystats { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.daystat { display: flex; flex-direction: column; gap: .1rem; }
.daystat .stat-num { font-size: var(--t-xl); line-height: 1; }
.daystat .stat-lab { font-size: var(--t-xs); color: var(--ink-3); }
.daystat.alerte .stat-num { color: var(--rouge); }

/* ==================================================================
   Grille hebdomadaire — proportionnelle au temps réel
   ================================================================== */
.week {
  display: grid;
  /* Le nombre de colonnes est posé en ligne par PHP : repeat() n'accepte pas var(). */
  grid-template-columns: 3.4rem repeat(6, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--rule-firm);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper);
}
.week-corner, .week-dayhead {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-firm);
  padding: .5rem .4rem;
  font-size: var(--t-sm); font-weight: 600; text-align: center;
}
.week-dayhead { border-left: 1px solid var(--rule); }
.week-hours, .week-day { position: relative; }
.week-hours { border-right: 1px solid var(--rule-firm); background: var(--paper-2); }
.week-day { border-left: 1px solid var(--rule); }
.week-hour {
  position: absolute; left: 0; right: 0;
  font-size: var(--t-xs); color: var(--ink-3);
  text-align: right; padding-right: .35rem;
  transform: translateY(-.55em);
  font-family: var(--serif); font-variant-numeric: tabular-nums;
}
.week-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--rule); }
.week-slot {
  /* left/width sont toujours fournis en ligne par PHP, même pour un
     créneau seul : cela permet à deux groupes de la même heure de se
     partager la largeur de la cellule plutôt que de se superposer. */
  position: absolute;
  background: var(--paper-2);
  border: 1px solid var(--rule-firm);
  border-left: 3px solid var(--who);
  border-radius: var(--r-sm);
  padding: .2rem .35rem;
  font-size: var(--t-xs); line-height: 1.25;
  overflow: hidden;
}
.week-slot strong {
  display: block; font-weight: 600; font-size: var(--t-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week-slot span { color: var(--ink-3); }

/* ==================================================================
   Boutons
   ================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .5rem 1rem;
  border: 1px solid var(--ink); border-radius: var(--r-md);
  background: var(--ink); color: var(--bg);
  font: inherit; font-weight: 500; cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; background: var(--ink-2); border-color: var(--ink-2); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--rule-firm); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-danger { background: var(--paper); color: var(--rouge); border-color: var(--rouge); }
.btn-danger:hover { background: var(--rouge-wash); }
.btn-sm { min-height: 34px; padding: .25rem .6rem; font-size: var(--t-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ==================================================================
   Formulaires
   ================================================================== */
.field { display: block; margin-bottom: .9rem; }
.field > span, .field-label {
  display: block; margin-bottom: .3rem;
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
}
.field-hint { display: block; margin-top: .3rem; font-size: var(--t-xs); color: var(--ink-3); }

input, select, textarea {
  width: 100%;
  padding: .55rem .7rem;
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-firm);
  border-radius: var(--r-md);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy);
}
textarea { resize: vertical; min-height: 4.5rem; }
input[type="date"], input[type="time"] { min-height: 42px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 5rem; }

fieldset { border: 1px solid var(--rule); border-radius: var(--r-md); padding: .9rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }

/* ==================================================================
   Messages, badges, états vides
   ================================================================== */
.alert {
  border: 1px solid var(--rule-firm);
  border-left: 3px solid var(--ink-3);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: .7rem .9rem; margin: 0 0 1rem;
  background: var(--paper);
  font-size: var(--t-md);
}
.alert-success { border-left-color: var(--olive); background: var(--olive-wash); color: var(--ink); }
.alert-error   { border-left-color: var(--rouge); background: var(--rouge-wash); }
.alert-warning { border-left-color: var(--ambre); background: var(--ambre-wash); }
.alert-info    { border-left-color: var(--navy);  background: var(--navy-wash); }

.badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: var(--t-xs); font-weight: 500; white-space: nowrap;
}
.badge-neutre  { color: var(--ink-3); }
.badge-bientot { color: var(--ambre);  background: var(--ambre-wash); }
.badge-urgent  { color: var(--rouge);  background: var(--rouge-wash); font-weight: 600; }
.badge-retard  { color: #fff; background: var(--rouge); border-color: var(--rouge); font-weight: 600; }
.badge-fait    { color: var(--olive);  background: var(--olive-wash); }
.badge-verifie { color: var(--teal);   background: var(--teal-wash); }

.empty {
  border: 1px dashed var(--rule-firm);
  border-radius: var(--r-lg);
  padding: 1.8rem 1.2rem;
  text-align: center;
  background: var(--paper);
}
.empty-title { font-weight: 600; margin-bottom: .25rem; }
.empty-text  { color: var(--ink-2); max-width: 34rem; margin-inline: auto; }

/* Notes ------------------------------------------------------------ */
.gval { font-size: var(--t-lg); font-weight: 600; }
.gval-bon    { color: var(--olive); }
.gval-moyen  { color: var(--ambre); }
.gval-faible { color: var(--rouge); }

.gbar {
  display: block; width: 100%; max-width: 8rem; height: 5px;
  background: var(--rule); border-radius: 999px; overflow: hidden; margin-top: .3rem;
}
.gbar-fill { display: block; height: 100%; background: var(--ink-3); }
.gbar-bon    .gbar-fill { background: var(--olive); }
.gbar-moyen  .gbar-fill { background: var(--ambre); }
.gbar-faible .gbar-fill { background: var(--rouge); }

.avg-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.avg-row:last-child { border-bottom: 0; }
.avg-big { font-family: var(--serif); font-size: var(--t-3xl); line-height: 1; font-variant-numeric: tabular-nums; }

/* ==================================================================
   Tableaux — cartes empilées sur téléphone
   ================================================================== */
.table-wrap {
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--paper); overflow-x: auto;
}
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  padding: .65rem .8rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
[dir="rtl"] table.data th, [dir="rtl"] table.data td { text-align: right; }
table.data thead th {
  background: var(--paper-2);
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-2);
  border-bottom: 1px solid var(--rule-firm);
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--paper-2); }
table.data td.num { text-align: right; white-space: nowrap; }
table.data td.actions { white-space: nowrap; }
.row-late { border-left: 3px solid var(--rouge); }
.row-done td:not(.actions) { color: var(--ink-3); }

/* ==================================================================
   Connexion
   ================================================================== */
.page-login .container { width: min(30rem, 100% - 2 * var(--gutter)); margin-top: 3rem; }
.login-panel { background: var(--paper); border: 1px solid var(--rule-firm); border-radius: var(--r-lg); padding: 1.6rem 1.5rem; }
.login-panel h1 { font-size: var(--t-xl); }
.login-intro { color: var(--ink-2); margin-bottom: 1.4rem; }
.login-rule { height: 3px; width: 2.5rem; background: var(--teal); border-radius: 999px; margin-bottom: 1.1rem; }

/* Pages d'erreur --------------------------------------------------- */
.page-error { display: grid; place-items: center; min-height: 100vh; margin: 0; }
.error-shell {
  background: var(--paper); border: 1px solid var(--rule-firm); border-radius: var(--r-lg);
  padding: 2rem; max-width: 32rem; width: calc(100% - 2rem);
}
.error-code { font-family: var(--serif); font-size: var(--t-3xl); color: var(--ink-3); margin: 0; }

/* ==================================================================
   Barre d'onglets (téléphone)
   ================================================================== */
.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --tabbar-h: calc(58px + env(safe-area-inset-bottom, 0px)); }

  .mainnav, .usermenu-name, .brand-name { display: none; }
  .topbar-inner { justify-content: space-between; min-height: 52px; }
  .usermenu-panel { right: 0; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 80;
    background: var(--paper);
    border-top: 1px solid var(--rule-firm);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tabbar a {
    display: grid; justify-items: center; gap: .1rem;
    padding: .45rem .2rem .5rem;
    color: var(--ink-3); font-size: 10px;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.is-active { color: var(--teal); }
  .tabbar svg {
    width: 21px; height: 21px;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
  }

  /* Tableaux en cartes : plus de défilement horizontal au pouce */
  .table-wrap { border: 0; background: none; overflow: visible; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tr {
    background: var(--paper);
    border: 1px solid var(--rule); border-radius: var(--r-md);
    padding: .7rem .85rem; margin-bottom: .6rem;
  }
  table.data tr:hover { background: var(--paper); }
  table.data td { border: 0; padding: .18rem 0; text-align: left !important; }
  table.data td[data-label]::before {
    content: attr(data-label) " ";
    display: inline-block; min-width: 6.5rem;
    color: var(--ink-3); font-size: var(--t-xs);
  }
  table.data td.actions { margin-top: .5rem; display: flex; gap: .4rem; }
  table.data td.actions::before { content: none; }

  /* La grille hebdo devient une liste par jour */
  .week { display: block; border: 0; background: none; }
  .week-corner, .week-hours, .week-line, .week-hour { display: none; }
  .week-dayhead {
    border: 1px solid var(--rule-firm); border-bottom: 0;
    border-radius: var(--r-md) var(--r-md) 0 0; text-align: left;
  }
  .week-day {
    position: static; min-height: 0 !important;
    border: 1px solid var(--rule-firm); border-radius: 0 0 var(--r-md) var(--r-md);
    background: var(--paper); padding: .3rem .5rem; margin-bottom: .7rem;
  }
  .week-slot {
    position: static; height: auto !important;
    margin-bottom: .3rem; padding: .35rem .5rem;
    font-size: var(--t-sm);
  }
}

/* ==================================================================
   Impression — l'emploi du temps sur le frigo
   ================================================================== */
@media print {
  :root { --bg: #fff; --paper: #fff; --paper-2: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; --rule: #bbb; --rule-firm: #888; }
  .topbar, .tabbar, .footer, .switcher, .page-actions, .no-print, form { display: none !important; }
  body { padding: 0; }
  .container { width: 100%; margin: 0; }
  .panel, .week, .table-wrap { border-color: #888; break-inside: avoid; }
  .week-slot { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  h1 { font-size: 16pt; }
}
