/* SEG Académie — CN-SEG-007 / R12.3-D — Compactage des cartes Mes ECUE.
   Correctif VISUEL isolé au tableau de bord ; n'intervient pas sur
   la recherche, la progression, les droits, les routes ou les 3 raccourcis. */

/* Déjoue l'ancienne règle P3-B qui force 1 colonne sous 1200 px.
   Deux cartes même sur les fenêtres d'ordinateur réduites (ex. 945 px). */
body.seg-boost-dashboard #p12Ecues.p12-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
  min-width: 0 !important;
}

body.seg-boost-dashboard #p12Ecues .r286-ocean-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 14px !important;
  gap: 9px !important;
  border-radius: 17px !important;
}

/* Illustration décorative raccourcie ; le média reste intact sur disque. */
body.seg-boost-dashboard #p12Ecues .r286-ocean-card > .seg-p3b-ecue-cover {
  box-sizing: border-box !important;
  display: block !important;
  width: calc(100% + 28px) !important;
  height: 170px !important;
  aspect-ratio: auto !important;
  max-height: 170px !important;
  min-height: 0 !important;
  margin: -14px -14px 2px !important;
  border-radius: 16px 16px 0 0 !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card > .seg-p3b-ecue-cover > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* Titres, méta et suivi conservent leur contenu, avec moins de hauteur. */
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .r276-name {
  min-height: 0 !important;
  gap: 5px !important;
  padding: 1px 0 2px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .r276-name b {
  font-size: clamp(14px, 1.12vw, 17px) !important;
  line-height: 1.32 !important;
  overflow-wrap: anywhere !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .r276-meta {
  font-size: 11.5px !important;
  padding: 4px 8px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card > div:has(> .p12-bar) {
  padding: 8px 10px !important;
  gap: 5px 8px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .seg-ecue-progress-empty {
  padding: 9px 11px !important;
  gap: 5px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .seg-ecue-advice {
  padding: 7px 9px !important;
}

/* Préserve les actions et leur ordre, tout en réduisant les espaces. */
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .p12-ecue-direct-links {
  gap: 7px !important;
  padding-top: 9px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .p12-ecue-direct-links > .r279-ecue-action {
  min-height: 59px !important;
  padding: 8px 5px !important;
  font-size: 11.5px !important;
}
body.seg-boost-dashboard #p12Ecues .r286-ocean-card .p12-ecue-direct-links > .seg-boost-action-agenda {
  min-height: 38px !important;
}

/* Tablette étroite et téléphone : une carte lisible par ligne. */
@media (max-width: 879px) {
  body.seg-boost-dashboard #p12Ecues.p12-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 13px !important;
  }
}
@media (max-width: 600px) {
  body.seg-boost-dashboard #p12Ecues .r286-ocean-card {
    padding: 13px !important;
  }
  body.seg-boost-dashboard #p12Ecues .r286-ocean-card > .seg-p3b-ecue-cover {
    width: calc(100% + 26px) !important;
    height: 150px !important;
    max-height: 150px !important;
    margin: -13px -13px 2px !important;
  }
  body.seg-boost-dashboard #p12Ecues .r286-ocean-card .r276-name b {
    font-size: 15px !important;
  }
  body.seg-boost-dashboard #p12Ecues .r286-ocean-card .p12-ecue-direct-links > .r279-ecue-action {
    min-height: 57px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.seg-boost-dashboard #p12Ecues .r286-ocean-card {
    transition: none !important;
  }
}
