/* ---------------------------------------------------------------------------
   Print
   ---------------------------------------------------------------------------
   Loaded with media="print", so it costs nothing on screen. Every page in the
   application is printable: the navigation, filters and buttons come off, the
   ink-heavy backgrounds go, and what is left is the record itself.

   Anything the desk should never see on paper carries .no-print; anything that
   only makes sense on paper carries .print-only.
--------------------------------------------------------------------------- */

@page {
    size: A4;
    margin: 14mm 12mm;
}

html, body {
    background: #fff !important;
    color: #000;
    font-size: 10.5pt;
}

/* The chrome. The sidebar is a grid item, so it is emptied rather than
   removed — the same reason the collapsed sidebar keeps its track. */
.sidebar,
.topbar,
.nav-scrim,
.nav-button,
.rail-button,
.filters,
.pagination,
.flash,
.no-print {
    display: none !important;
}

.print-only {
    display: block !important;
}

.shell {
    display: block !important;
}

main,
.page {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    overflow: visible !important;
}

/* Buttons are all links to somewhere else, which paper cannot follow. */
.btn,
.actions,
form button,
.inline-form {
    display: none !important;
}

/* A form shown for reading keeps its values; only its controls go. */
.input,
select.input,
textarea.input {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #000 !important;
    -webkit-appearance: none;
    appearance: none;
}

a {
    color: #000;
    text-decoration: none;
}

/* Panels and cards lose their fill but keep the line that separates them. */
.panel,
.card,
.note,
.metric {
    background: transparent !important;
    box-shadow: none !important;
    border-color: #999 !important;
    break-inside: avoid;
}

.table-scroll {
    overflow: visible !important;
}

table {
    width: 100% !important;
    border-collapse: collapse;
    break-inside: auto;
}

/* Headings repeat at the top of every page a long table runs onto. */
thead {
    display: table-header-group;
}

tr {
    break-inside: avoid;
}

.rt-head,
.rt-cell {
    border-bottom: 1px solid #bbb !important;
    padding: 5pt 4pt !important;
    background: transparent !important;
}

.rt-head {
    border-bottom: 1px solid #000 !important;
    font-weight: 700;
}

/* The stacked-card table layout is for narrow screens, not for paper. */
.rt-stack .rt-row {
    display: table-row;
}

.rt-stack .rt-cell {
    display: table-cell;
}

.rt-stack .rt-cell::before {
    content: none !important;
}

.tag {
    border: 1px solid #666 !important;
    background: transparent !important;
    color: #000 !important;
}

h2, h3, h4, .section-title {
    break-after: avoid;
}

.page-head {
    border-bottom: 1px solid #000;
    padding-bottom: 6pt;
    margin-bottom: 10pt;
}

.cols,
.grid-2,
.deflist.split {
    display: block !important;
}

.deflist > div {
    break-inside: avoid;
}
