@page {
  margin: 0.5in;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  body {
    color: #000;
    font-size: 10pt;
  }

  .print-only {
    display: block;
  }

  /* The screen viewer is a three-column shell. Only the ballot belongs in print. */
  header,
  .print-preview-banner,
  .table-of-contents,
  .viewer-share-panel,
  .viewer-back-to-top,
  .copy-button,
  .no-print {
    display: none !important;
  }

  .viewer,
  .viewer.viewer-wide {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }

  .viewer-shell {
    display: block;
    width: auto;
  }

  .viewer-shell .view {
    padding: 0;
  }

  .viewer-tree {
    column-count: 2;
    column-gap: 0.35in;
  }

  /* Remove screen-only indentation so hierarchy headings can span both columns. */
  .viewer-tree .nest,
  .viewer-tree .viewer-nest {
    display: contents;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .viewer-node-header,
  .viewer-demarcation-header,
  .viewer-election-header {
    display: block;
  }

  .viewer-node-header,
  .viewer-demarcation-header {
    column-span: all;
    break-after: avoid;
    margin-top: 0.16in;
    padding: 0.04in 0;
    border-bottom: 1px solid #777;
  }

  .viewer-node-header:first-child {
    margin-top: 0;
  }

  .print-guide-header {
    margin: 0 0 0.18in;
    padding-bottom: 0.1in;
    border-bottom: 2px solid #000;
  }

  .viewer-tree .election {
    box-sizing: border-box;
    break-inside: avoid;
    margin: 0 0 0.08in;
    padding: 0.05in 0;
    border: 0;
    border-bottom: 1px solid #b0b0b0;
    border-radius: 0;
    background: transparent;
    animation: none;
  }

  .viewer-tree .election.print-picked,
  .viewer-tree .election.print-measure {
    margin: 0.02in 0 0.09in;
    padding: 0.07in 0.1in;
    border: 1px solid #555;
    background: #f7f7f7;
  }

  .viewer-tree .election.print-picked {
    border-left: 4px solid #000;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 0.05in;
    margin-bottom: 0.05in;
    color: #000 !important;
    text-shadow: none;
  }

  h1 {
    font-size: 22pt;
  }

  h2 {
    font-size: 15pt;
  }

  h3 {
    font-size: 12pt;
  }

  p {
    font-size: 10pt;
  }
}
