/* The Planner's prints (assets/nscc-planner-print.js): Daily (a box per trip or shift), Daily
   (short) and Weekly (landscape). Shown only while printing: app.js's beforeprint marks the print
   root .print-section and the body .print-active; this file adds .nscc-pp-printing so the rest of
   the app is left out of the page entirely. Black on white, no colour needed to read it. */

.nscc-pp-root { display: none; }
.nscc-pp-control { display: inline-flex; align-items: center; gap: 0.3rem; }
.nscc-pp-control select { width: auto; min-width: 0; font-size: 0.74rem; }

@page nscc-pp-portrait { size: portrait; margin: 10mm 10mm 12mm; }
@page nscc-pp-landscape { size: landscape; margin: 8mm 8mm 10mm; }

@media print {
    body.print-active.nscc-pp-printing .app-container,
    body.print-active.nscc-pp-printing > *:not(#nscc-planner-print-root) { display: none !important; }
    body.print-active.nscc-pp-printing { min-height: 0 !important; height: auto !important; }
    body.print-active.nscc-pp-printing #nscc-planner-print-root.print-section {
        display: block !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
    }
    .nscc-pp-control { display: none !important; }
}

/* ── Common ────────────────────────────────────────────────────────────────────── */
.nscc-pp {
    color: #000;
    background: #fff;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 9.5pt;
    line-height: 1.3;
}
.nscc-pp-day, .nscc-pp-short { page: nscc-pp-portrait; }
/* The app's own table styles (uppercase heads, screen padding and type) never reach a print. */
.nscc-pp table, .nscc-pp th, .nscc-pp td, .nscc-pp tr {
    font-size: inherit;
    line-height: inherit;
    text-transform: none;
    letter-spacing: normal;
    height: auto;
    min-height: 0;
    color: #000;
    font-family: inherit;
}
.nscc-pp-week { page: nscc-pp-landscape; font-size: 7pt; line-height: 1.18; }
.nscc-pp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12pt;
    border-bottom: 1.5pt solid #000;
    padding-bottom: 4pt;
    margin-bottom: 7pt;
}
.nscc-pp-head__company { font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.nscc-pp-head__title { font-size: 14pt; font-weight: 800; }
.nscc-pp-week .nscc-pp-head__title { font-size: 12pt; }
.nscc-pp-head__right { text-align: right; }
.nscc-pp-head__range { font-size: 11pt; font-weight: 700; }
.nscc-pp-head__sub, .nscc-pp-head__printed { font-size: 8pt; color: #333; }
.nscc-pp-empty { font-size: 10pt; padding: 12pt 0; }
.nscc-pp-open { font-style: italic; text-decoration: underline dotted; }
.nscc-pp-muted { color: #444; font-style: italic; }
.nscc-pp-tag {
    display: inline-block;
    border: 0.75pt solid #000;
    border-radius: 2pt;
    padding: 0 3pt;
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nscc-pp-chips { display: flex; flex-wrap: wrap; gap: 3pt; margin-top: 4pt; }
.nscc-pp-chip {
    border: 0.75pt solid #000;
    border-radius: 2pt;
    padding: 0.5pt 4pt;
    font-size: 8pt;
    font-weight: 700;
}
.nscc-pp-chip--approval, .nscc-pp-chip--unavailable { border-width: 1.5pt; }
.nscc-pp-chip--unavailable::before { content: "\26A0  "; }
.nscc-pp-chip--approval::before { content: "\270E  "; }
.nscc-pp-chip--keep::before { content: "\25CE  "; }

/* ── Daily: one box per trip ───────────────────────────────────────────────────── */
.nscc-pp-box {
    border: 1pt solid #000;
    margin: 0 0 6pt;
    break-inside: avoid;
    page-break-inside: avoid;
}
.nscc-pp-box--open { border-style: dashed; }
.nscc-pp-box__head {
    display: flex;
    align-items: baseline;
    gap: 8pt;
    padding: 3pt 6pt;
    border-bottom: 0.75pt solid #000;
    background: #ececec;
}
.nscc-pp-box__time { font-weight: 800; font-size: 10.5pt; white-space: nowrap; }
.nscc-pp-box__time small { font-weight: 600; font-size: 8pt; }
.nscc-pp-box__title { font-weight: 800; font-size: 10.5pt; flex: 1 1 auto; }
.nscc-pp-box__sub { font-size: 8.5pt; font-weight: 700; white-space: nowrap; }
.nscc-pp-box__body { display: flex; align-items: stretch; }
.nscc-pp-box__main { flex: 1 1 64%; padding: 4pt 6pt; min-width: 0; }
.nscc-pp-write {
    flex: 0 0 34%;
    border-left: 0.75pt solid #000;
    padding: 3pt 5pt 4pt;
    min-height: 58pt;
    display: flex;
    flex-direction: column;
}
.nscc-pp-write__line { flex: 1 1 0; min-height: 13pt; border-bottom: 0.5pt solid #8a8a8a; }
.nscc-pp-write__label { font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.nscc-pp-fields { margin: 0; display: grid; grid-template-columns: max-content 1fr; column-gap: 8pt; row-gap: 1pt; }
.nscc-pp-row { display: contents; }
.nscc-pp-row dt { font-weight: 700; font-size: 8.5pt; color: #222; white-space: nowrap; }
.nscc-pp-row dd { margin: 0; overflow-wrap: anywhere; }
.nscc-pp-notes { white-space: pre-wrap; }
.nscc-pp-sites { margin: 0; padding-left: 13pt; }

/* ── Daily (short): one line per trip ──────────────────────────────────────────── */
.nscc-pp-table { width: 100%; border-collapse: collapse; }
.nscc-pp-table th, .nscc-pp-table td { border-bottom: 0.5pt solid #777; padding: 2.5pt 4pt; text-align: left; vertical-align: top; }
.nscc-pp-table th { border-bottom: 1pt solid #000; font-size: 8pt; text-transform: uppercase; letter-spacing: 0.03em; }
.nscc-pp-table td:first-child { white-space: nowrap; font-weight: 700; }
.nscc-pp-table--courier td:last-child { white-space: nowrap; }
.nscc-pp-table tr { break-inside: avoid; page-break-inside: avoid; }
.nscc-pp-table__flags td { border-bottom: 0.5pt solid #777; padding-top: 0; }
.nscc-pp-table tr:has(+ .nscc-pp-table__flags) td { border-bottom: 0; }
.nscc-pp-table__flags .nscc-pp-chips { margin-top: 0; }
.nscc-pp-table small { font-size: 7.5pt; }

/* ── Weekly: days across ───────────────────────────────────────────────────────── */
.nscc-pp-week__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.nscc-pp-week__grid th, .nscc-pp-week__grid td { border: 0.5pt solid #000; padding: 1.5pt 2.5pt; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.nscc-pp-week__grid thead th { background: #e4e4e4; font-size: 8pt; }
.nscc-pp-week__grid thead { display: table-header-group; }
/* A busy row may run onto the next page (its entries stay whole), so a page is never left half empty. */
.nscc-pp-entry { break-inside: avoid; page-break-inside: avoid; }
.nscc-pp-week__grid .nscc-pp-week__first { width: 11%; background: #f2f2f2; font-weight: 700; }
.nscc-pp-week--routes .nscc-pp-week__grid .nscc-pp-week__first { width: 19%; }
.nscc-pp-week__first small { display: block; font-weight: 500; font-size: 6.8pt; }
.nscc-pp-week__hol { display: block; font-weight: 600; font-size: 6.8pt; font-style: italic; }
.nscc-pp-entry { padding: 0.5pt 0; }
.nscc-pp-entry + .nscc-pp-entry { border-top: 0.4pt dotted #777; }
.nscc-pp-entry--flag { font-weight: 700; }
.nscc-pp-entry i { font-weight: 700; text-decoration: underline; }
