body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f5f5f5;
  }

  .content {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 16px 24px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
    page-break-inside: avoid; /* Evita que o conteúdo quebre em páginas diferentes */
  }

  h1,
  h2,
  h3 {
    margin-top: 8px;
    margin-bottom: 8px;
    page-break-inside: avoid; /* Evita que os títulos quebrem em páginas diferentes */
  }

  p {
    margin: 4px 0 8px 0;
    page-break-inside: avoid; /* Evita que o texto quebre em páginas diferentes */
  }

  li {
    page-break-inside: avoid; /* Evita que as listas quebrem em páginas diferentes */
  }

  .section {
    page-break-inside: avoid; /* Evita que as seções quebrem em páginas diferentes */
    margin-bottom: 16px;
  }

  /* Área de desenho */
  .desenho {
    border: 1.5px dashed #888;
    min-height: 200px;
    margin: 12px 0 16px 0;
    background: #fafafa;
    border-radius: 4px;
    page-break-inside: avoid; /* Evita que o desenho quebre em páginas diferentes */
  }

  .legenda-desenho {
    font-size: 0.9rem;
    color: #555;
    margin-top: 4px;
  }

  /* Linhas de resposta */
  .resposta-longa {
    margin: 8px 0 12px 0;
  }

  .linha {
    display: block;
    border-bottom: 1px solid #444;
    margin: 4px 0;
    min-height: 16px;
  }

  .linha-curta {
    display: inline-block;
    border-bottom: 1px solid #444;
    min-width: 80px;
    margin-left: 4px;
  }

  /* Caixa de texto */
  .caixa-texto {
    border: 1px solid #444;
    min-height: 150px;
    margin: 8px 0 12px 0;
    border-radius: 4px;
    background: #fafafa;
    display: block;
    page-break-inside: avoid; /* Evita que a caixa de texto quebre em páginas diferentes */
  }

  /* Atividade de ligar */
  .ligar {
    margin-top: 8px;
  }

  .ligar-colunas {
    display: flex;
    gap: 32px;
    page-break-inside: avoid; /* Evita que as colunas quebrem em páginas diferentes */
  }

  .ligar-colunas ol {
    margin: 4px 0;
    padding-left: 18px;
    page-break-inside: avoid; /* Evita que as listas quebrem em páginas diferentes */
  }

  .ligar .col-esquerda,
  .ligar .col-direita {
    flex: 1;
    page-break-inside: avoid; /* Evita que as colunas quebrem em páginas diferentes */
  }

  /* Ordenar */
  .ordenar {
    margin-top: 8px;
    page-break-inside: avoid; /* Evita que a atividade de ligar quebre em páginas diferentes */
  }

  .ordenar-lista {
    margin-top: 4px;
    page-break-inside: avoid; /* Evita que as listas quebrem em páginas diferentes */
  }

  .item-ordenar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0;
    page-break-inside: avoid; /* Evita que os itens quebrem em páginas diferentes */
  }

  .numero-resposta {
    border: 1px solid #444;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 4px;
    font-size: 0.9rem;
    page-break-inside: avoid; /* Evita que o número da resposta quebre em páginas diferentes */
  }

  .texto-item {
    flex: 1;
    page-break-inside: avoid; /* Evita que o texto do item quebre em páginas diferentes */
  }

  /* Recorte e cole */
  .recorte {
    margin-top: 8px;
    page-break-inside: avoid; /* Evita que a atividade de recorte quebre em páginas diferentes */
  }

  .recorte-alvos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    page-break-inside: avoid; /* Evita que os alvos quebrem em páginas diferentes */
  }

  .alvo {
    flex: 1 1 220px;
    page-break-inside: avoid; /* Evita que os alvos quebrem em páginas diferentes */
  }

  .caixa-alvo {
    border: 1px dashed #444;
    height: 80px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: #fafafa;
    page-break-inside: avoid; /* Evita que a caixa de alvo quebre em páginas diferentes */
  }

  .recorte-pecas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    page-break-inside: avoid; /* Evita que as peças quebrem em páginas diferentes */
  }

  .peca {
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    background: #fdfdfd;
    font-size: 0.9rem;
    page-break-inside: avoid; /* Evita que as peças quebrem em páginas diferentes */
  }

  @media print {
    @page {
      size: A4;
      margin: 10mm;
    }

    body {
      width: 210mm;
      margin: 0;
      background: #ffffff;
    }

    .content {
      max-width: none;
      margin: 0;
      box-shadow: none;
      padding: 0 12mm;
    }

    .section {
      page-break-inside: avoid; /* Evita que as seções quebrem em páginas diferentes */
    }

    button {
      display: none;
      page-break-inside: avoid; /* Evita que o botão quebre em páginas diferentes */
    }
  }