/* Mise en page du "tome" pour l'impression / export PDF via le navigateur.
   Quand on imprime, on masque l'app et on ne montre que #print-root. */

@page { size: A4; margin: 16mm 14mm; }

@media print {
  body { background: #fff; }
  .app-header, .app-main, .tabbar { display: none !important; }

  .print-root {
    position: static !important;
    left: auto !important;
    display: block !important;
  }
  .print-root[hidden] { display: block !important; }
}

/* Styles du tome (appliqués à l'écran d'aperçu ET à l'impression) */
.tome { color: #1c2430; font-family: Georgia, "Times New Roman", serif; }

.tome-page {
  page-break-after: always;
  min-height: 240mm;
  padding: 6mm 0;
}
.tome-page:last-child { page-break-after: auto; }

.tome-cover { text-align: center; padding-top: 40mm; }
.tome-cover .kicker { letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; color: #3b6ea5; }
.tome-cover h1 { font-size: 2.4rem; margin: 8px 0; }
.tome-cover .who { font-size: 1.2rem; color: #555; }
.tome-cover .draw-box { margin: 24px auto 0; width: 70%; height: 60mm; border: 2px dashed #bbb; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #aaa; }

.tome h2 { border-bottom: 2px solid #e8a23b; padding-bottom: 4px; font-size: 1.4rem; }
.tome .meta { color: #888; font-size: .85rem; }
.tome .badge {
  display: inline-block; font-family: sans-serif; font-size: .75rem;
  padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: #3b6ea5;
  vertical-align: middle; margin-left: 8px;
}
.tome .badge.app { background: #e7eefb; }
.tome .badge.reel { background: #eaf6ec; color: #3f9d58; }

.tome .consigne { font-weight: bold; }
.tome .lignes { margin-top: 8px; }
.tome .ligne { border-bottom: 1px solid #cbcbcb; height: 9mm; }
.tome .case { display: inline-block; width: 16px; height: 16px; border: 2px solid #888; border-radius: 4px; vertical-align: middle; margin-right: 8px; }

.tome ol.carte { list-style: none; padding: 0; }
.tome ol.carte li { padding: 6px 0; border-bottom: 1px dashed #ddd; }

.tome .anglais-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tome .anglais-grid .item { border: 1px solid #ddd; border-radius: 8px; padding: 8px; text-align: center; }
.tome .anglais-grid .item .emoji { font-size: 2rem; }

.tome .parents { background: #faf7f0; border: 1px solid #e8dfc8; border-radius: 8px; padding: 12px; font-family: sans-serif; font-size: .9rem; }

/* Habillage de livret */
.tome .runhead { font-family: sans-serif; font-size: .7rem; color: #aaa; text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid #eee; padding-bottom: 3px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.tome .lettre { font-style: italic; font-size: 1.05rem; line-height: 1.7; }
.tome ol.sommaire { font-family: sans-serif; }
.tome ol.sommaire li { padding: 5px 0; border-bottom: 1px dotted #ddd; }
.tome .recit p { line-height: 1.7; text-align: justify; }

/* Grilles d'exercices (beaucoup d'items par page) */
.tome .grille-calcul { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: 1.15rem; margin-top: 10px; }
.tome .grille-calcul .op { border-bottom: 1px solid #cbcbcb; padding: 6px 0; }
.tome .conj { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tome .conj td { border: 1px solid #ddd; padding: 8px; }
.tome .conj td.rep { width: 45%; }
.tome .savaistu { background: #f3f7fb; border-left: 4px solid #3b6ea5; padding: 8px 12px; margin: 12px 0; font-family: sans-serif; font-size: .9rem; }
.tome .lexique { width: 100%; border-collapse: collapse; }
.tome .lexique td { border-bottom: 1px solid #eee; padding: 7px 4px; vertical-align: top; }
.tome .lexique td.mot { font-weight: bold; width: 35%; }
