/* Chanak Flex · estilos de contenido y de impresión A4 (Tailwind cubre el resto). */

/* Texto de libro: párrafos, listas y tablas que vienen de los datos de las unidades. */
.prose-flex { line-height: 1.7; color: #1e293b; }
.prose-flex p { margin: 0 0 0.85em; }
.prose-flex ul, .prose-flex ol { margin: 0 0 0.85em 1.4em; }
.prose-flex ul { list-style: disc; }
.prose-flex ol { list-style: decimal; }
.prose-flex li { margin: 0.2em 0; }
.prose-flex strong, .prose-flex b { color: #0f172a; }
.prose-flex blockquote { margin: 0.6em 0 0.9em; padding: 0.6em 1em; border-left: 4px solid #cbd5e1; background: #f8fafc; color: #334155; }
.prose-flex table { border-collapse: collapse; margin: 0.6em 0 1em; font-size: 0.92em; display: block; overflow-x: auto; max-width: 100%; }
.prose-flex th, .prose-flex td { border: 1px solid #cbd5e1; padding: 0.35em 0.6em; text-align: left; vertical-align: top; }
.prose-flex th { background: #f1f5f9; }
.prose-flex sup, .prose-flex sub { font-size: 0.75em; }

/* ── Cuadernillo imprimible (pantalla) ───────────────────────────────────── */
.print-doc { background: #fff; max-width: 210mm; margin: 0 auto; padding: 14mm; box-shadow: 0 2px 20px rgba(18, 35, 61, 0.08); font-size: 11pt; color: #0f172a; }
.print-doc h2 { font-family: Fraunces, Georgia, serif; font-size: 16pt; margin: 8mm 0 3mm; color: #0c1e35; border-bottom: 1.5px solid #b8873a; padding-bottom: 1.5mm; }
.print-section { margin-bottom: 6mm; }
.print-item { margin: 4mm 0; break-inside: avoid; }
.print-q { display: flex; gap: 2mm; }
.print-q > div { flex: 1; min-width: 0; }
.print-choices { list-style: none; margin: 2mm 0 0 6mm; padding: 0; display: grid; gap: 1.5mm; }
.print-choices li { display: flex; gap: 2.5mm; align-items: flex-start; }
.bubble { display: inline-flex; width: 5.5mm; height: 5.5mm; border: 1px solid #334155; border-radius: 50%; align-items: center; justify-content: center; font-size: 8pt; font-weight: 700; flex-shrink: 0; }
.print-sub { font-size: 8.5pt; color: #64748b; margin: 2mm 0 0 6mm; text-transform: uppercase; letter-spacing: 0.06em; }
.ruled { margin: 1mm 0 0 6mm; }
.rule { height: 8mm; border-bottom: 0.6px solid #94a3b8; }
.answer-box { margin: 2mm 0 0 6mm; font-weight: 600; }
.answer-blank { display: inline-block; min-width: 45mm; border-bottom: 1px solid #0f172a; height: 5mm; vertical-align: bottom; }
.checkpoint { margin: 3mm 0; padding: 2mm 3mm; border-left: 3px solid #f59e0b; background: #fffbeb; }
.score-line { margin-top: 5mm; text-align: right; font-weight: 700; }
.std-list { margin: 0 0 4mm 5mm; list-style: disc; }
.worldview { margin-top: 4mm; padding: 3mm 4mm; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 2mm; }
.glossary { display: grid; grid-template-columns: 38mm 1fr; gap: 1.5mm 4mm; }
.glossary dt { font-weight: 700; }

/* Portada oficial */
.cover { min-height: 250mm; display: flex; flex-direction: column; border: 2px solid #0c1e35; outline: 1px solid #b8873a; outline-offset: -5px; padding: 9mm 10mm; }
.cover-head { display: flex; gap: 5mm; align-items: center; border-bottom: 2px solid #b8873a; padding-bottom: 5mm; }
.seal { width: 18mm; height: 18mm; border-radius: 50%; background: #0c1e35; color: #f6c453; display: flex; align-items: center; justify-content: center; font-family: Fraunces, Georgia, serif; font-size: 22pt; font-weight: 700; flex-shrink: 0; }
.cover-school { font-family: Fraunces, Georgia, serif; font-size: 20pt; color: #0c1e35; }
.cover-sub { font-size: 9pt; color: #475569; }
.cover-title-block { margin: 8mm 0 6mm; text-align: center; }
.cover-kicker { font-size: 9pt; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #8a6d2f; }
.cover-title { font-family: Fraunces, Georgia, serif; font-size: 28pt; color: #0c1e35; margin: 3mm 0 1.5mm; }
.cover-unit { font-size: 15pt; color: #0f5460; font-weight: 600; }
.cover-meta { margin-top: 3mm; font-size: 9pt; color: #475569; }
.cover-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5mm 8mm; }
.cover-field { display: flex; flex-direction: column; }
.cover-label { font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; }
.cover-value { border-bottom: 1px solid #0f172a; min-height: 7mm; padding-top: 1.5mm; font-size: 12pt; }
.cover-objectives { margin-top: 6mm; font-size: 10pt; }
.cover-objectives h3 { font-weight: 700; margin-bottom: 2mm; }
.cover-objectives ul { margin-left: 5mm; list-style: disc; }
.cover-rules { margin-top: 5mm; font-size: 9pt; color: #334155; padding: 3mm 4mm; background: #f1f5f9; border-radius: 2mm; }
.cover-foot { margin-top: auto; padding-top: 4mm; font-size: 8pt; text-align: center; color: #64748b; }
.cover-test { min-height: 0; }
.cover-test .cover-title-block { margin: 8mm 0 6mm; }

/* Línea de corte del examen desprendible */
.detach { margin: 10mm 0 6mm; border-top: 2px dashed #64748b; text-align: center; }
.detach span { position: relative; top: -3.2mm; background: #fff; padding: 0 3mm; font-size: 9pt; font-weight: 700; color: #475569; letter-spacing: 0.06em; text-transform: uppercase; }
.example { break-inside: avoid; }

/* ── Impresión A4 ───────────────────────────────────────────────────────── */
@page { size: A4; margin: 14mm 13mm 16mm; }
@media print {
  html, body { background: #fff !important; }
  .no-print, #app-header, #demo-banner, footer, #toast { display: none !important; }
  main { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .print-doc { box-shadow: none; padding: 0; max-width: none; font-size: 10.5pt; }
  .page-break { break-before: page; }
  .cover { min-height: 0; break-after: page; }
  .cover-foot { margin-top: 6mm; }
  .test-sheet .cover { min-height: 0; break-after: auto; }
  .detach { margin: 3mm 0 5mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  h2 { break-after: avoid; }
}

/* Figuras SVG y pies bilingües */
.fig { margin: 1em auto; text-align: center; break-inside: avoid; }
.fig svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.fig figcaption { margin-top: 0.4em; font-size: 0.85em; color: #475569; font-style: italic; }
.fig-table table { margin: 0 auto; }
html[lang="en"] .lang-es, html[lang="es"] .lang-en { display: none; }

.print-match { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin: 2mm 0 0 6mm; }
.print-hl { margin: 2mm 0 0 6mm; line-height: 1.8; }
.iw svg { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
