@layer components {
  /* The reports, each a link with a round icon: rows up to a tablet, tiles three across from 1024 wide. */
  .page-header:has(+ .page > .reports) {
    text-align: center;
  }

  .reports {
    display: grid;
    font-size: 1rem;                 /* 16px */
    gap: 0.5em;

    @media (min-width: 100ch) {
      font-size: 0.842rem;           /* 16px */
    }

    @media (width >= 1024px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .reports__link {
    align-items: center;
    color: inherit;
    gap: 0.875em;
    min-block-size: 4em;             /* 64px */
    padding: 0.625em 0.875em;
    text-decoration: none;

    @media (width >= 1024px) {
      flex-direction: column;
      gap: 0.5em;
      padding: 1em 0.75em 1.25em;
      text-align: center;
    }
  }

  .reports__icon {
    --icon-size: 1.25em;

    background-color: var(--color-ink);
    border-radius: 50%;
    block-size: 2.5em;               /* 40px */
    color: var(--color-ink-inverted);
    display: grid;
    flex: none;
    inline-size: 2.5em;
    place-items: center;
  }

  .reports__icon--link {
    background-color: var(--color-link);
  }

  .reports__icon--late {
    background-color: oklch(var(--lch-red-medium));
  }

  .reports__body {
    display: grid;
    min-inline-size: 0;
  }

  .reports__name {
    font-size: 1.0625em;             /* 17px */
    line-height: 1.4;
  }

  .reports__hint {
    color: var(--color-meta);
    font-size: 0.9375em;             /* 15px */
    line-height: 1.45;
    text-wrap: balance;
  }

  /* A report's rows in groups, each under the label a day of the trail has. */
  .report__group + .report__group {
    margin-block-start: calc(var(--text-control) * 2.85); /* 40px */
  }

  /* Paper drops backgrounds, so the label prints as dark words. */
  @media print {
    .report__group .history__date {
      background: none;
      color: inherit;
      padding-inline: 0;
    }
  }

  /* What is late says so with a dot before its count of days. */
  .report__dot {
    background-color: oklch(var(--lch-red-medium));
    block-size: 0.57em;              /* 8px */
    border-radius: 50%;
    display: inline-block;
    inline-size: 0.57em;
    margin-inline-end: 0.6em;
  }

  /* What comes due says its day once: over its rows up to a tablet, in a column beside them from 1024 wide. */
  .report__day {
    @media (width >= 1024px) {
      align-items: baseline;
      display: grid;
      grid-template-columns: calc(var(--text-control) * 7.65) minmax(0, 1fr); /* 109px */
    }
  }

  .report__date {
    color: var(--color-text-subtle);
    font-size: var(--text-control);
    font-weight: 500;
    line-height: 1.45;
    margin: var(--block-space) 0 0;
    text-transform: uppercase;

    @media (width < 1024px) {
      + div .rows__subheading {
        margin-block-start: 0;
      }
    }
  }
}
