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

.perimeters-preview-shell { border:1px solid #d8dee5; border-radius:.5rem; background:#f4f6f8; overflow:hidden; }
.perimeters-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem 1rem; background:#fff; border-bottom:1px solid #d8dee5; }
.perimeters-preview-scroll { overflow-x:auto; padding:1rem; }
.perimeters-a4-page { width:210mm; min-height:297mm; margin:0 auto; box-sizing:border-box; padding:12mm 13mm 15mm; background:#fff; color:#1f2933; box-shadow:0 .25rem 1rem rgba(0,0,0,.12); font-family:Arial,sans-serif; font-size:10.2pt; line-height:1.32; display:flex; flex-direction:column; }
.perimeters-empty-preview { min-height:250mm; display:flex; align-items:center; justify-content:center; color:#6c757d; font-size:1.1rem; }
.pg-sheet-header { display:grid; grid-template-columns:28mm 1fr 28mm; align-items:center; padding-bottom:3mm; border-bottom:1px solid #adb5bd; margin-bottom:3mm; }
.pg-sheet-brand { font-weight:800; font-size:13pt; }
.pg-sheet-title { text-align:center; }
.pg-sheet-title h3 { margin:0; font-size:17pt; font-weight:800; }
.pg-sheet-title p { margin:1mm 0 0; color:#6c757d; font-size:9pt; }
.pg-sheet-number { text-align:right; font-weight:700; font-size:9pt; }
.pg-meta { display:flex; justify-content:space-between; gap:12mm; margin-bottom:4mm; font-size:9.2pt; }
.pg-section { margin-bottom:4mm; }
.pg-section-title { margin:0 0 2mm; padding:2mm 2.5mm; border-left:4px solid #6c757d; background:#f1f3f5; font-weight:800; font-size:10.2pt; }
.pg-grid { display:grid; grid-template-columns:1fr 1fr; gap:2mm 5mm; }
.pg-item { min-width:0; padding:1.8mm 2mm; border:1px solid #e2e6ea; border-radius:3px; background:#fcfcfd; }
.pg-item--replace { min-height:8mm; display:flex; align-items:center; }
.pg-answer { display:inline; margin-left:.25em; font-weight:700; white-space:nowrap; border-bottom:1px dotted #7c8793; padding:0 .15em .1em; }
.perimeters-a4-page.is-student .pg-answer-text { color:transparent; }
.perimeters-a4-page.is-solution .pg-answer { border-bottom-color:transparent; }
.perimeters-a4-page.is-solution .pg-answer-text,
.pg-solution-value { color:#198754; font-weight:700; }
.pg-calibration { margin:1mm 0 3mm; padding:2mm; border:1px solid #ffc107; background:#fff9e6; font-size:8.8pt; text-align:center; }
.pg-calibration svg { display:block; width:70mm; height:12mm; margin:1mm auto 0; }
.pg-polygons { margin-bottom:0; }
.pg-polygon-card { padding:1.5mm 2mm; border:1px solid #dfe4e8; border-radius:4px; background:#fff; margin-bottom:2mm; }
.pg-polygon-card svg { display:block; width:auto; height:auto; max-width:100%; margin:.5mm auto 1mm; }
.pg-polygon-layout { display:grid; grid-template-columns:auto 1fr; gap:5mm; align-items:center; }
.pg-polygon-side { align-self:stretch; display:flex; flex-direction:column; justify-content:center; }
.pg-polygon-measure-list { font-size:9.4pt; line-height:1.55; }
.pg-polygon-total { margin-top:2mm; color:#198754; font-size:10pt; }
.pg-polygon-answer { margin-top:2.5mm; font-size:9.2pt; }
.pg-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.pg-table th,.pg-table td { border:1px solid #ced4da; padding:2.2mm 1.5mm; text-align:center; vertical-align:middle; }
.pg-table th { background:#f1f3f5; font-weight:700; }
.pg-polyomino-row { display:grid; grid-template-columns:repeat(3,1fr); gap:3mm 5mm; align-items:start; justify-items:center; margin:3mm 0 4mm; }
.pg-polyomino-card { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; width:58mm; min-height:62mm; padding:1.5mm 0 1mm; border:1px solid #e2e6ea; border-radius:4px; background:#fff; box-sizing:border-box; }
.pg-polyomino-label { flex:0 0 auto; min-height:5mm; margin:0 0 .5mm; font-size:12pt; line-height:1; font-weight:700; text-align:center; }
.pg-polyomino-card svg { display:block; width:54mm; height:54mm; margin:0 auto; flex:0 0 auto; }
.pg-order-line { margin-top:2mm !important; }
.pg-grid--compare .pg-item,
.pg-grid--conversions .pg-item { min-height:10.5mm; font-size:10.4pt; padding:2.4mm 3mm; line-height:1.4; }
.pg-worked-card { border:1px solid #dfe4e8; border-radius:4px; background:#fafbfc; padding:2.2mm; margin-bottom:2.5mm; min-height:28mm; box-sizing:border-box; }
.pg-worked-card--research { min-height:43mm; }
.pg-problem-question { font-weight:500; margin-bottom:1.8mm; }
.pg-workspace { min-height:16mm; display:grid; grid-template-columns:1fr 1.35fr; gap:3mm; }
.pg-worked-card--research .pg-workspace { min-height:29mm; }
.pg-workspace > div { border:1px dashed #adb5bd; border-radius:3px; padding:1.5mm; color:#7c8793; font-size:8.7pt; }
.pg-problem-solution-body { display:grid; grid-template-columns:32% 1fr; gap:3mm; align-items:center; }
.pg-worked-card:not(.pg-worked-card--research) .pg-problem-solution-body { grid-template-columns:1fr; }
.pg-worked-card:not(.pg-worked-card--research) .pg-problem-diagram { display:none; }
.pg-problem-diagram svg { display:block; width:84mm; max-width:100%; height:auto; margin:0 auto; }
.pg-problem-steps { font-size:9pt; }
.pg-step { margin:.5mm 0; }
.pg-problem-final { margin-top:1mm; font-weight:700; color:#198754; }
.pg-type-varied .pg-section--worked { margin-top:1mm; }
.pg-type-varied .pg-worked-card { min-height:31mm; }
.pg-type-tables .pg-section { margin-bottom:5mm; }
.pg-type-tables .pg-table th,.pg-type-tables .pg-table td { padding:2.45mm 1.35mm; }
.pg-type-compare .pg-section { margin-bottom:7mm; }
.pg-type-problems .pg-section--research { flex:1 1 auto; display:flex; flex-direction:column; }
.pg-type-compare .pg-grid { gap:4.8mm 10mm; }
.pg-type-compare .pg-section-title { margin-bottom:3mm; }
.pg-type-problems .pg-worked-card--research { flex:1 1 0; min-height:0; margin-bottom:3mm; padding:3.2mm; }
.pg-type-problems .pg-worked-card--research .pg-workspace { min-height:38mm; }
.pg-type-problems .pg-problem-question { margin-bottom:2.5mm; }
.pg-type-problems .pg-problem-solution-body { grid-template-columns:46% 1fr; gap:5mm; }
.pg-type-problems .pg-problem-diagram svg { width:100%; max-width:96mm; height:auto; }
.pg-footer { margin-top:auto; padding-top:2mm; border-top:1px solid #e0e4e8; display:flex; justify-content:space-between; color:#6c757d; font-size:7.5pt; }

@media (max-width:991.98px){
  .perimeters-preview-toolbar{align-items:flex-start;flex-direction:column;}
}

/* v3 : respiration des comparaisons/conversions */
.pg-type-compare .pg-item--replace .pg-solution-value {
    display: inline-block;
    margin: 0 .75em;
}
