.age-guide-picture {
  margin: 1.4rem auto;
  max-width: 40rem;
}

.age-guide-picture img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 450;
}

.age-guide-picture figcaption {
  margin: .5rem .25rem 0;
  color: var(--muted, #43563a);
  font-size: .95rem;
  line-height: 1.65;
}

#age-leap-comparison .guide-table a,
.age-work-actions a {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.age-guide-question,
.age-work-blanks {
  margin-block: 1.25rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--light-line, #c5cebc);
  border-radius: .5rem;
  background: #f5f6ef;
}

.age-guide-question summary {
  cursor: pointer;
  font-weight: 700;
}

.age-guide-question[open] summary {
  margin-block-end: .6rem;
}

.age-work-steps {
  padding-inline-start: 1.6rem;
  margin-block: 1rem;
}

.age-work-steps li {
  padding-inline-start: .2rem;
  margin-block: .65rem;
}

.age-work-blanks h3 {
  margin-block: 0 .5rem;
}

.age-work-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1.25rem;
  margin-top: 1rem;
}

.age-work-fields label {
  display: grid;
  align-content: end;
  gap: .3rem;
  font-weight: 700;
  line-height: 1.5;
}

.age-work-fields input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: .4rem .6rem;
  border: 1px solid #899a80;
  border-radius: .3rem;
  background: #fffef9;
  color: var(--ink, #263b1c);
  font: inherit;
}

.age-work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-block: 1rem 0;
}

#age-worksheet-print {
  appearance: none;
  padding: .45rem .9rem;
  border: 1px solid #647b52;
  border-radius: .3rem;
  color: var(--ink, #263b1c);
  background: #fffef9;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

#age-worksheet-print[hidden] {
  display: none;
}

@media (max-width: 36rem) {
  .age-work-fields {
    grid-template-columns: 1fr;
  }
}

@media print {
  /* Keep the document path to the worksheet and remove siblings at every level. */
  body:has(#age-month-worksheet) > :not(:has(#age-month-worksheet)),
  body :has(#age-month-worksheet) > :not(:has(#age-month-worksheet)):not(#age-month-worksheet),
  #age-month-worksheet .age-work-actions {
    display: none !important;
  }

  body:has(#age-month-worksheet),
  body :has(#age-month-worksheet),
  #age-month-worksheet {
    display: block !important;
    position: static !important;
    min-height: 0 !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  #age-month-worksheet,
  #age-month-worksheet :is(p, li, label, input) {
    font-size: 12pt !important;
    line-height: 1.5 !important;
  }

  #age-month-worksheet h2 {
    font-size: 17pt;
    margin: 0 0 3mm;
  }

  #age-month-worksheet h3 {
    font-size: 13pt;
    margin: 0 0 2mm;
  }

  #age-month-worksheet p {
    margin: 0 0 2mm;
  }

  #age-month-worksheet .age-guide-picture {
    float: left;
    width: 58mm;
    max-width: 35%;
    margin: 2mm 3mm 2mm 0;
    break-inside: avoid;
  }

  #age-month-worksheet .age-guide-picture figcaption {
    display: none;
  }

  #age-month-worksheet .age-work-steps {
    margin: 2mm 0;
  }

  #age-month-worksheet .age-work-steps li {
    margin: 1mm 0;
  }

  #age-month-worksheet .age-work-blanks {
    clear: both;
    background: none;
    border-color: #888;
    margin: 4mm 0 0;
    padding: 3mm;
    break-inside: avoid;
  }

  #age-month-worksheet .age-work-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3mm 6mm;
    margin-top: 2mm;
  }

  #age-month-worksheet .age-work-fields input {
    height: 10mm;
    padding: 0;
    color: #000;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #777;
    border-radius: 0;
    outline: 0 !important;
    box-shadow: none !important;
  }
}
