/* =====================================================================
   Tableaux lisibles sur mobile (WSL Academy)
   Sous 640 px, chaque ligne de tableau devient une carte :
   l'intitulé de la colonne s'affiche devant chaque valeur.
   Les libellés sont posés par assets/js/tables-mobile.js.
   ===================================================================== */
.tw td .mono, .tw td b.mono { white-space: nowrap; }

@media (max-width: 640px) {
  .tw.tw-cards { overflow: hidden; }
  .tw.tw-cards table { min-width: 0; width: 100%; }
  .tw.tw-cards thead, .tw.tw-cards tr.tw-head { display: none; }
  .tw.tw-cards tbody, .tw.tw-cards tr { display: block; }
  .tw.tw-cards tr { padding: 16px 18px; border-top: 1px solid var(--line, #e4e4e4); }
  .tw.tw-cards tbody tr:first-child,
  .tw.tw-cards tr.tw-head + tr { border-top: 0; }
  .tw.tw-cards tr.on { background: var(--mist, #f4f4f4); }

  .tw.tw-cards tr:not(.tw-head) > td,
  .tw.tw-cards tr:not(.tw-head) > th {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    padding: 5px 0; border: 0; background: none;
    text-align: right; font-size: .9rem; color: var(--concrete, #6b6b6b);
  }
  .tw.tw-cards tr:not(.tw-head) > td::before,
  .tw.tw-cards tr:not(.tw-head) > th::before {
    content: attr(data-label); flex: 0 0 auto; max-width: 45%;
    text-align: left; font-weight: 600; font-size: .78rem; color: var(--concrete-l, #9a9a9a);
  }
  /* 1re colonne = titre de la carte */
  .tw.tw-cards tr:not(.tw-head) > :first-child {
    display: block; text-align: left; padding: 0 0 8px;
    font-size: 1rem; color: var(--ink, #000);
  }
  .tw.tw-cards tr:not(.tw-head) > :first-child::before { display: none; }
  /* textes longs : libellé au-dessus, texte aligné à gauche */
  .tw.tw-cards tr:not(.tw-head) > .tw-long { display: block; text-align: left; }
  .tw.tw-cards tr:not(.tw-head) > .tw-long::before { display: block; max-width: none; margin-bottom: 2px; }
}
