/* =====================================================================
 * 📁 /maths/grandeurs_et_mesures/masses/fiches/fiches.css
 * ===================================================================== */

.masses-preview-shell {
  border: 1px solid #d7dde3;
  border-radius: .5rem;
  background: #f3f5f7;
  overflow: hidden;
}

.masses-preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .8rem 1rem;
  background: #fff;
  border-bottom: 1px solid #d7dde3;
}

.masses-preview-scroll {
  overflow: auto;
  padding: 1rem;
}

.masses-a4-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 10mm 12mm 12mm;
  box-sizing: border-box;
  background: #fff;
  color: #1f2933;
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.28;
  box-shadow: 0 .2rem .8rem rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
}

.masses-empty-preview {
  min-height: 230mm;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.mg-sheet-header {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  align-items: center;
  border-bottom: 1px solid #adb5bd;
  padding-bottom: 2.5mm;
  margin-bottom: 2.5mm;
}

.mg-sheet-brand { font-size: 15px; font-weight: 700; }
.mg-sheet-title { text-align: center; }
.mg-sheet-title h3 { margin: 0; font-size: 22px; font-weight: 700; }
.mg-sheet-title p { margin: 1mm 0 0; color: #6c757d; }
.mg-sheet-number { text-align: right; font-weight: 700; }

.mg-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3mm;
}

.mg-section { margin-bottom: 3.5mm; }
.mg-section-title {
  margin: 0 0 1.8mm;
  padding: 1.8mm 2.2mm;
  border-left: 4px solid #6c757d;
  background: #f1f3f5;
  font-size: 12px;
  font-weight: 700;
}

.mg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 2.2mm;
}

.mg-item {
  border: 1px solid #dfe4e8;
  background: #fcfcfd;
  padding: 2mm 2.2mm;
  min-height: 10mm;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25em;
}

.mg-item--wide {
  grid-column: 1 / -1;
  display: block;
  min-height: 15mm;
}

.mg-answer {
  display: inline-block;
  min-width: 16mm;
  padding: 0 .8mm .3mm;
  border-bottom: 1px dotted #6f7f91;
  font-weight: 700;
  text-align: center;
}

.is-student .mg-answer-text { color: transparent; }
.is-solution .mg-answer { border-bottom-color: transparent; }
.is-solution .mg-answer-text { color: #198754; }

.mg-order-answer { margin-top: 2mm; }

.mg-problem-card {
  border: 1px solid #dfe4e8;
  background: #fafbfc;
  padding: 2.2mm;
  margin-bottom: 2mm;
  min-height: 37mm;
}

.mg-problem-question { font-size: 11.2px; margin-bottom: 1.7mm; }
.mg-workspace {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 2mm;
}
.mg-workspace > div {
  min-height: 27mm;
  border: 1px dotted #b8c0c8;
  padding: 1.5mm;
  color: #7b8794;
  font-weight: 700;
}

.mg-solution-step { margin: .8mm 0; }
.mg-solution-final { margin-top: 1.2mm; color: #198754; font-weight: 700; }

.mg-footer {
  margin-top: auto;
  padding-top: 1.5mm;
  border-top: 1px solid #e0e4e8;
  display: flex;
  justify-content: space-between;
  color: #6c757d;
  font-size: 9px;
}

@media (max-width: 991.98px) {
  .masses-a4-page { transform-origin: top left; }
  .masses-preview-toolbar { flex-direction: column; align-items: stretch; }
}
