.print-only {
  display: none;
}

@media print {
  .hide-on-print {
    display: none !important;
  }
  .print-only {
    display: revert;
  }

  /* Hide chrome that doesn't belong on paper */
  .navbar,
  .flash,
  footer,
  .footer,
  .buttons,
  form.button_to {
    display: none !important;
  }

  /* Let the content column take the full page width so charts reflow */
  .is-fullheight.columns {
    display: block;
    min-height: 0;
    margin: 0 !important;
  }
  .is-fullheight.columns > .column {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  /* Auto-expand collapsed cards */
  details:not([open]) > *:not(summary) {
    display: revert !important;
  }
  details > summary {
    list-style: none;
  }
  details .card-header-icon {
    display: none;
  }

  /* Charts: make sure SVG/canvas fits the page */
  #chart-1, [id^="chart-"],
  .chartkick-chart,
  canvas,
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Backgrounds and borders read better as plain on paper */
  .card,
  .card-header,
  .has-background-white-ter,
  .has-background-light {
    background: transparent !important;
    box-shadow: none !important;
  }

  body {
    background: white !important;
  }

  /* Avoid breaking tables awkwardly across pages */
  table, tr, td, th {
    page-break-inside: avoid;
  }
  h1, h2, h3 {
    page-break-after: avoid;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }
}
