@media print {

  .no-print,
  .print-hidden,
  button {
    display: none !important;
  }

  /* Ocultar título y elementos decorativos para ganar espacio vertical */
  header h1,
  header p,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
    font-size: 12pt;
  }

  .sheet {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 5mm 10mm !important;
    width: 100% !important;
    min-height: auto !important;
  }

  /* Encabezado compacto */
  .sheet>.border-b-4 {
    padding-bottom: 4mm !important;
    margin-bottom: 2mm !important;
  }

  .sheet>.border-b-4 h2 {
    font-size: 18pt !important;
    margin: 0 !important;
  }

  .sheet>.border-b-4 p {
    font-size: 10pt !important;
    margin: 0 !important;
  }

  /* Sección de nombre y fecha con más espacio para escribir */
  .flex.justify-between.items-center.mb-6 {
    margin-bottom: 5mm !important;
    gap: 15mm !important;
  }

  .flex.justify-between.items-center.mb-6 p {
    font-size: 10pt !important;
    border-bottom: 1px solid #000 !important;
    padding-bottom: 2mm !important;
    flex-grow: 1;
  }

  /* Sección de tiempos compacta */
  .flex.justify-around.mb-8 {
    margin-bottom: 3mm !important;
    padding: 2mm !important;
    font-size: 9pt !important;
  }

  /* Sección de reto de lectura compacta */
  .mb-8.p-4.bg-slate-50 {
    margin-bottom: 3mm !important;
    padding: 2mm !important;
  }

  .mb-8.p-4.bg-slate-50 .text-lg {
    font-size: 10pt !important;
  }

  /* Grid de ejercicios - 2 columnas compactas */
  .math-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
  }

  .math-grid>div {
    padding: 3mm 4mm !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    border-bottom: 1px solid #ddd !important;
  }

  /* Evitar saltos de página dentro de la hoja */
  .sheet * {
    page-break-inside: avoid;
  }
}

.math-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.btn-guia {
  background-color: #f0f4ff;
  border: 1px solid #d1d9ff;
  padding: 8px 16px;
  border-radius: 20px;
  color: #4a5568;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-guia:hover {
  background-color: #e2e8ff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.config-row {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  flex-wrap: wrap;
}

.config-row>div {
  flex: 1 1 0;
}

.config-actividad {
  display: flex;
  flex-direction: column;
}

.config-actividad label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a5568;
  margin-bottom: 4px;
}

.config-actividad select {
  box-sizing: border-box;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  background-color: #f8fafc;
}

/* Página método: imagen y disposición responsive */
.metodo-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.metodo-imagen {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .metodo-intro {
    flex-direction: row;
    align-items: flex-start;
  }

  .metodo-intro p {
    flex: 1 1 0;
  }
}