/* Contracts, Preferences, the library file, and the printed sheets (run-out and driver job
 * sheets). Built on coach.css: its colours (var(--rf-…), var(--co-accent)) so both looks work. */

/* --- shared ------------------------------------------------------------------------------------- */

.pl-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 24px 32px; text-align: center; color: var(--rf-dim); }
.pl-empty p { margin: 0; max-width: 520px; line-height: 1.5; }
.pl-prefs > .co-page-head { position: sticky; top: -18px; z-index: 5; margin: -18px -24px 16px; padding: 18px 24px 14px; background: var(--rf-bg); box-shadow: 0 1px 0 var(--rf-line); }
.pl-note { margin: 0; font-size: 12px; line-height: 1.45; }
.pl-sub { margin-top: 4px; padding-top: 14px; box-shadow: inset 0 1px 0 var(--rf-line); }
.pl-sub .sec-h { margin: 0; }

/* --- a contract: its itinerary and running days ----------------------------------------------- */

.pl-leg { display: grid; grid-template-columns: 150px 1fr 128px; gap: 6px; }
.pl-leg > input:nth-of-type(3) { grid-column: 1 / -1; }
.pl-leg .est { grid-column: 1 / -1; font-size: 11.5px; color: var(--rf-dim); }

.pl-days { display: flex; flex-direction: column; gap: 16px; }
.pl-count { font-size: 13px; color: var(--rf-dim); }
.pl-count b { font-size: 20px; font-weight: 700; color: var(--co-accent-text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.pl-daysbar { gap: 12px; flex-wrap: wrap; padding: 10px 0 0; box-shadow: inset 0 1px 0 var(--rf-line); }
.pl-key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; box-shadow: inset 0 0 0 1.3px var(--sr-edge); }
.pl-key.on { background: var(--co-accent-deep); box-shadow: none; }
.pl-key.hol { box-shadow: inset 0 -3px 0 var(--rf-warn), inset 0 0 0 1.3px var(--sr-edge); }
.pl-key.sch { background: rgba(var(--sr-action-rgb), 0.18); }
.pl-key.hand { position: relative; }
.pl-key.hand::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--rf-text); }
.pl-cal { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; }
.pl-cal .days button { position: relative; }
.pl-cal .days button.sch:not(.on) { background: rgba(var(--sr-action-rgb), 0.14); }
.pl-cal .days button.out:not(.on) { opacity: 0.35; }
.pl-cal .days button.hand::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pl-cal .days button.on.hol { box-shadow: inset 0 -3px 0 var(--rf-warn); }

/* --- preferences -------------------------------------------------------------------------------- */

.pl-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pl-sec { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pl-sec.wide { grid-column: 1 / -1; }
.pl-sec > header { display: flex; align-items: center; gap: 12px; }
.pl-sec > header .badge { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--co-accent-text); background: rgba(var(--co-accent-rgb), 0.12); }
.pl-sec > header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.pl-sec > header p { margin: 3px 0 0; font-size: 12px; color: var(--rf-dim); }
.pl-unit { display: flex; align-items: center; gap: 8px; }
.pl-unit .input { flex: 1; min-width: 0; }
.pl-unit > span { flex: none; min-width: 52px; font-size: 12px; font-weight: 600; color: var(--rf-dim); }
.pl-rows { display: flex; flex-direction: column; }
.pl-row { display: flex; align-items: center; gap: 16px; padding: 11px 0; box-shadow: inset 0 -1px 0 var(--rf-line); }
.pl-row:first-child { padding-top: 0; }
.pl-row:last-child { box-shadow: none; padding-bottom: 0; }
.pl-row > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl-row b { font-size: 13px; font-weight: 600; }
.pl-row small { font-size: 12px; color: var(--rf-dim); line-height: 1.4; }
.pl-look { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.pl-list { display: flex; flex-direction: column; gap: 8px; }
.pl-li { display: flex; align-items: center; gap: 8px; }
.pl-li .input { flex: 1; min-width: 0; }
.pl-li.add { margin-top: 4px; flex-wrap: wrap; }
.pl-li.add .input[type="date"] { flex: 0 1 170px; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 11px; border-radius: 15px; font-size: 12px; font-weight: 600; background: var(--sr-soft); color: var(--rf-text); white-space: nowrap; }
.pl-chip small { font-weight: 500; color: var(--rf-dim); font-size: 11px; }
.pl-chip button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--rf-dim); }
.pl-chip button:hover { color: var(--rf-err); background: rgba(240, 72, 72, 0.14); }
.pl-sh { display: grid; grid-template-columns: 170px 170px 1fr 38px; gap: 8px; align-items: center; }
.pl-sh .field > span:empty { display: none; }
.pl-sh.head span { font-size: 11.5px; font-weight: 600; color: var(--rf-dim); }

/* --- the library file -------------------------------------------------------------------------- */

.pl-kpis { padding: 0 0 16px; }
.pl-file { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--rf-field); box-shadow: inset 0 0 0 1px var(--sr-edge); }
.pl-file > svg { color: var(--co-accent-text); }
.pl-file b { display: block; font-size: 13px; }
.pl-file small { display: block; margin-top: 2px; font-size: 12px; color: var(--rf-dim); }
.pl-warn { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: var(--rf-text); background: rgba(255, 166, 38, 0.12); }
.pl-warn svg { color: var(--rf-warn); margin-top: 1px; }

@media (max-width: 1100px) {
  .pl-cols { grid-template-columns: minmax(0, 1fr); }
  .pl-sh { grid-template-columns: 1fr 1fr; }
}

/* --- designing a sheet: the sheet, and the panel beside it ------------------------------------- */

.ex-tpl { width: 230px; }
.ex-work { display: flex; gap: 18px; align-items: flex-start; }
.ex-sheets { flex: 1; min-width: 0; }
.sd { position: sticky; top: 0; flex: none; width: 340px; max-height: calc(100vh - 150px); display: flex; flex-direction: column; border-radius: 10px; background: var(--rf-card); border: 1px solid var(--rf-line); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.sd-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--rf-line); font-size: 14px; }
.sd-scroll { overflow: auto; padding: 4px 16px 16px; }
.sd-tpl { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 14px; border-bottom: 1px solid var(--rf-line); }
.sd-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-note { margin: 0; font-size: 12px; }
.sd-part { border-bottom: 1px solid var(--rf-line); }
.sd-part > summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; cursor: pointer; font-weight: 700; font-size: 13px; list-style: none; }
.sd-part > summary::-webkit-details-marker { display: none; }
.sd-part[open] > summary .hub-icon { transform: rotate(180deg); }
.sd-body { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sd input[type='range'] { width: 100%; accent-color: var(--co-accent); }
.sd-logo { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--rf-line); }
.sd-logo img { max-height: 40px; max-width: 160px; background: #fff; border-radius: 4px; padding: 2px; }
.sd-colour { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.sd-colour input { width: 34px; height: 26px; padding: 0; border: 1px solid var(--rf-line); border-radius: 6px; background: none; cursor: pointer; }
.sd-colour span { flex: 1; }
.sd-colour code { font-size: 11.5px; color: var(--rf-faint); }
.sd-cols { display: flex; flex-direction: column; gap: 4px; }
.sd-col { display: flex; align-items: center; gap: 6px; }
.sd-col .input { flex: 1; min-width: 0; height: 30px; padding: 4px 8px; font-size: 12.5px; }
.sd-col input[type='checkbox'] { accent-color: var(--co-accent); width: 16px; height: 16px; }
.sd-col.off .input { opacity: 0.55; }

/* --- the sheets (paper on screen, and in print) ------------------------------------------------- */

.ex-controls .ex-date { width: 160px; }
.ex-who { width: 220px; }
.ex-table td:nth-child(2) small { white-space: nowrap; }
.paper {
  --rf-text: #071433; --rf-dim: #4a5677; --rf-faint: #7d869c; --rf-line: rgba(7, 20, 51, 0.12);
  max-width: 1120px; margin: 0 auto 22px; padding: 28px 34px 22px; border-radius: 6px;
  background: #fff; color: #071433; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(7, 20, 51, 0.08);
  font-size: 12.5px; line-height: 1.4;
}
.paper .co-wordmark b { color: var(--ex-ink, #071433); }
.ex-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2.5px solid var(--ex-ink, #071433); }
.ex-brand { display: flex; flex-direction: column; gap: 7px; }
.ex-brand > span { font-size: 14px; font-weight: 700; }
.ex-brand > small { font-size: 11.5px; color: var(--rf-dim); white-space: pre-wrap; }
.ex-logo { display: block; width: auto; max-width: 320px; object-fit: contain; object-position: left center; }
.ex-notice { margin: -6px 0 14px; text-align: center; font-style: italic; font-size: 12.5px; }
.ex-title { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.ex-title h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ex-ink, #071433); }
.ex-title b { font-size: 13.5px; color: var(--ex-accent, var(--co-accent-deep)); }
.ex-title span { font-size: 12px; color: var(--rf-dim); }
.ex-none { margin: 20px 0; color: var(--rf-dim); font-size: 13px; }
.ex-flag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #b3261e; background: #fde8e7; border: 1px solid #b3261e; white-space: nowrap; }

.ex-table { width: 100%; border-collapse: collapse; }
.ex-table th { text-align: left; padding: 7px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ex-ink, var(--rf-dim)); border-bottom: 1.5px solid var(--ex-ink, #071433); white-space: nowrap; }
.ex-table td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--rf-line); }
.paper.stripes .ex-table tr:nth-child(even) td { background: color-mix(in srgb, var(--ex-band, #eef1f8) 60%, #fff); }
.ex-table tr.flag td { background: #fff6f5; }
.ex-table td small { display: block; color: var(--rf-dim); font-size: 11px; margin-top: 1px; }
.ex-table .t, .ex-legs .t { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.ex-table th.n { text-align: right; }
.ex-table .notes { max-width: 260px; font-size: 11.5px; color: var(--rf-dim); }
.ex-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 12px; }
.ex-sub b { width: 100%; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-dim); }
.ex-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--rf-line); font-size: 10.5px; color: var(--rf-faint); }

.ex-foot .co-made { margin-left: auto; }
.co-made { display: inline-flex; align-items: center; gap: 4px; font-family: "Montserrat", Arial, sans-serif; font-size: 8.5px; color: #333; white-space: nowrap; }
.co-made b { font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.co-made i { font-style: normal; font-weight: 800; letter-spacing: 0.02em; color: #f20d78; text-transform: uppercase; }

.ex-job { margin-bottom: 16px; border: 1px solid rgba(7, 20, 51, 0.18); border-radius: 6px; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.ex-job-head { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--ex-band, #eef1f8); border-bottom: 1px solid rgba(7, 20, 51, 0.14); font-size: 13.5px; }
.ex-time { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-type { font-size: 11px; font-weight: 700; color: var(--ex-accent, var(--co-accent-deep)); white-space: nowrap; }
.ex-trip .ex-job-head { background: color-mix(in srgb, var(--ex-band, #eef1f8) 50%, #fff); }
.ex-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; padding: 10px 12px; }
.ex-facts:empty { display: none; }
.ex-facts i, .ex-notes i { display: block; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-faint); }
.ex-legs { width: 100%; border-collapse: collapse; border-top: 1px solid var(--rf-line); }
.ex-legs td { padding: 6px 12px; vertical-align: top; border-bottom: 1px solid var(--rf-line); }
.ex-legs tr:last-child td { border-bottom: 0; }
.ex-legs .t { width: 78px; }
.ex-legs .k { width: 120px; color: var(--rf-dim); }
.ex-legs small { display: block; color: var(--rf-dim); font-size: 11px; }
.ex-legs .notes { color: var(--rf-dim); font-size: 11.5px; }
.ex-notes { padding: 9px 12px; border-top: 1px solid var(--rf-line); background: #fffaf0; white-space: pre-wrap; }


/* the sheet chooser, the jobs list's days and the rota's week */
.ex-kinds { margin-top: -6px; }
.ex-kinds .seg { flex-wrap: wrap; }
.ex-span { width: 160px; }
.ex-wk { font-size: 12.5px; }

/* the ready-made looks in the designer */
.sd-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sd-look { display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 8px; text-align: left; box-shadow: inset 0 0 0 1px var(--rf-line); }
.sd-look:hover { background: var(--rf-hover); }
.sd-look > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; }
.sd-look small { font-size: 10.5px; color: var(--rf-faint); line-height: 1.3; }
.sd-look .sw { position: relative; flex: none; width: 38px; height: 38px; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(7, 20, 51, 0.15); display: flex; align-items: flex-end; justify-content: center; }
.sd-look .sw i { position: absolute; top: 0; left: 0; right: 0; height: 12px; background: var(--b); border-bottom: 2px solid var(--i); }
.sd-look .sw b { position: relative; font-size: 14px; color: var(--a); padding-bottom: 4px; }

/* the watermark */
.paper { position: relative; }
.ex-mark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; z-index: 0; }
.ex-mark span { transform: rotate(-30deg); font-size: 120px; font-weight: 800; letter-spacing: 0.08em; color: var(--ex-accent, #c80a62); opacity: 0.08; white-space: nowrap; }
.paper > *:not(.ex-mark) { position: relative; z-index: 1; }

/* the header's layouts */
.hd-band .ex-head { margin: -28px -34px 18px; padding: 22px 34px 16px; background: var(--ex-band, #eef1f8); border-top: 6px solid var(--ex-accent, #c80a62); border-bottom: 0; border-radius: 6px 6px 0 0; }
.hd-centred .ex-head { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.hd-centred .ex-brand, .hd-centred .ex-title { align-items: center; text-align: center; }
.hd-centred .ex-logo { object-position: center; }
.hd-minimal .ex-head { padding-bottom: 8px; margin-bottom: 12px; border-bottom-width: 1px; align-items: center; }
.hd-minimal .ex-title { flex-direction: row; align-items: baseline; gap: 12px; }
.hd-minimal .ex-title h2 { font-size: 15px; }

/* the tables' styles */
.tb-grid .ex-table th, .tb-grid .ex-table td { border: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 30%, #fff); }
.tb-plain .ex-table td { border-bottom: 0; }
.tb-boxed .ex-table { border-collapse: separate; border-spacing: 0 5px; }
.tb-boxed .ex-table td { border-top: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 25%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 25%, #fff); }
.tb-boxed .ex-table td:first-child { border-left: 3px solid var(--ex-accent, #c80a62); border-radius: 5px 0 0 5px; }
.tb-boxed .ex-table td:last-child { border-right: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 25%, #fff); border-radius: 0 5px 5px 0; }
.paper:not(.stripes) .ex-table tr:nth-child(even) td { background: none; }

/* groups and totals */
.ex-table tr.ex-group th { padding: 14px 8px 6px; font-size: 12.5px; letter-spacing: 0.02em; text-transform: none; color: var(--ex-accent, #c80a62); border-bottom: 1.5px solid var(--ex-accent, #c80a62); background: none !important; }
.ex-table tr.ex-group th span { margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--rf-faint); }
.ex-table tr.ex-total td { font-weight: 700; background: color-mix(in srgb, var(--ex-band, #eef1f8) 80%, #fff) !important; border-top: 1.5px solid var(--ex-ink, #071433); }
.ex-table tr.ex-total td span { font-weight: 500; color: var(--rf-dim); margin-left: 4px; }
.ex-table tfoot tr.ex-total td { border-top: 2px solid var(--ex-ink, #071433); }

/* a job's times on a driver's sheet */
.ex-times { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--rf-line); }
.ex-times > span { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; border-right: 1px solid var(--rf-line); }
.ex-times > span:last-child { border-right: 0; }
.ex-times i { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-faint); }
.ex-times b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ex-times small { font-size: 10.5px; color: var(--rf-dim); }

/* the boxes a driver fills in */
.ex-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; break-inside: avoid; page-break-inside: avoid; }
.ex-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid rgba(7, 20, 51, 0.25); border-radius: 6px; }
.ex-box > i { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-faint); }
.ex-box:first-child:has(.ex-walk) { grid-column: 1 / -1; }
.ex-walk { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 12px; font-size: 11.5px; }
.ex-walk span, .ex-fill-row > span { display: flex; align-items: center; gap: 6px; }
.tick { flex: none; display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--ex-ink, #071433); border-radius: 3px; }
.line { display: inline-block; flex: 1; min-width: 60px; height: 1px; margin-top: 12px; border-bottom: 1px solid #7d869c; }
.line.short { flex: 0 0 90px; }
.line.full { display: block; width: 100%; margin-top: 16px; }
.ex-fill { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ex-fill td { padding: 4px 6px 4px 0; }
.ex-fill td > .line { width: 70px; }
.ex-fill-row { display: flex; gap: 18px; font-size: 11.5px; }
.ex-fill-row > span { flex: 1; }

/* the weekly rota */
.ex-rota-t th, .ex-rota-t td { font-size: 11px; }
.ex-rota-t td { padding: 6px; }
.ex-rota-t th.we, .ex-rota-t td.we { background: color-mix(in srgb, var(--ex-band, #eef1f8) 70%, #fff); }
.ex-rota-t td:first-child { width: 120px; }
.ex-rjob { display: flex; flex-direction: column; gap: 0; padding: 4px 6px; margin-bottom: 4px; border-radius: 4px; border-left: 3px solid var(--ex-accent, #c80a62); background: color-mix(in srgb, var(--ex-band, #eef1f8) 55%, #fff); }
.ex-rjob small { margin: 0 !important; }
.ex-away { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; color: var(--rf-dim); border: 1px dashed #7d869c; }

/* a booking confirmation */
.ex-confirm, .ex-ticket { break-after: page; page-break-after: always; }
.ex-confirm:last-child, .ex-ticket:last-child { break-after: auto; page-break-after: auto; }
.ex-to { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.ex-to > div { display: flex; flex-direction: column; gap: 3px; }
.ex-to i, .ex-terms i, .ex-to dt { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rf-faint); }
.ex-to b { font-size: 15px; }
.ex-to small { color: var(--rf-dim); white-space: pre-wrap; }
.ex-to dl { display: grid; grid-template-columns: auto auto; gap: 4px 14px; margin: 0; align-content: start; }
.ex-to dd { margin: 0; font-weight: 700; }
.ex-greet { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.ex-cfacts { padding: 12px 14px; margin-bottom: 14px; border-radius: 6px; background: color-mix(in srgb, var(--ex-band, #eef1f8) 60%, #fff); }
.ex-clegs { margin-bottom: 14px; }
.ex-price { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-top: 2px solid var(--ex-ink, #071433); border-bottom: 2px solid var(--ex-ink, #071433); }
.ex-price b { font-size: 20px; color: var(--ex-ink, #071433); }
.ex-price small { color: var(--rf-dim); }
.ex-terms { padding: 10px 0; font-size: 10.5px; color: var(--rf-dim); white-space: pre-wrap; line-height: 1.5; }
.ex-csign { margin: 18px 0 4px; }

/* a work ticket */
.pre { white-space: pre-wrap; }
.tk-count { position: absolute !important; top: 10px; left: 34px; padding: 3px 10px; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; background: var(--ex-accent, #c80a62); }
.tk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.tk-grid .wide { grid-column: 1 / -1; }
.tk-stack { display: flex; flex-direction: column; gap: 8px; }
.tk-row { display: flex; gap: 8px; margin-bottom: 10px; }
.tk-row .grow { flex: 1; }
.tk-box { display: grid; grid-template-columns: max-content 1fr; border: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 45%, #fff); border-radius: 7px; overflow: hidden; font-size: 12px; }
.tk-box .k { padding: 3px 9px; text-align: right; color: var(--rf-dim); background: color-mix(in srgb, var(--ex-band, #eef1f8) 60%, #fff); border-right: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 45%, #fff); }
.tk-box .k:first-child, .tk-box .k:first-child + .v { padding-top: 6px; }
.tk-box .k:nth-last-child(2), .tk-box .v:last-child { padding-bottom: 6px; }
.tk-box .v { padding: 3px 10px; min-width: 0; }
.tk-legs { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 12px; }
.tk-legs th { text-align: left; padding: 6px; font-weight: 600; border-top: 1px solid var(--ex-ink, #071433); border-bottom: 1px solid var(--ex-ink, #071433); }
.tk-legs td { padding: 4px 6px; vertical-align: top; }
.tk-legs tr:nth-child(even) td { background: color-mix(in srgb, var(--ex-band, #eef1f8) 55%, #fff); }
.paper:not(.stripes) .tk-legs tr td { background: none; }
.tk-legs .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-legs .t, .tk-legs .d { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-legs small { display: block; font-size: 10.5px; color: var(--rf-dim); }
.tk-legs .tk-note { margin-top: 3px; color: var(--rf-text); }
.tk-instr { margin: 6px 0 10px; font-weight: 700; font-size: 12px; }
.tk-instr p { margin: 0 0 6px; }
.tk-fill { display: flex; gap: 8px; margin-top: 12px; break-inside: avoid; page-break-inside: avoid; }
.tk-act { flex: 1; border-collapse: separate; border-spacing: 0; font-size: 11.5px; border: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 45%, #fff); border-radius: 7px; overflow: hidden; }
.tk-act th, .tk-act td { padding: 5px 8px; height: 18px; border-right: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 25%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--ex-ink, #071433) 25%, #fff); text-align: left; font-weight: 500; }
.tk-act th:first-child, .tk-act tbody th { text-align: right; color: var(--rf-dim); background: color-mix(in srgb, var(--ex-band, #eef1f8) 60%, #fff); }
.tk-act tr:last-child > * { border-bottom: 0; }
.tk-act tr > *:last-child { border-right: 0; }
.tk-pax { flex: 0 0 170px; }
.tk-pax td { width: 60px; }

@media print {
  :root, :root[data-theme] { color-scheme: light !important; background: #fff !important; }
  .ex-kinds { display: none !important; }
  .ex-table tfoot { display: table-row-group; }
  .hd-band .ex-head { margin: 0 0 14px; padding: 14px 16px 12px; border-radius: 0; }
  .tk-count { left: 0; top: 0; }
}

@media print {
  html, body, #app { height: auto !important; background: #fff !important; color: #000 !important; }
  .co { position: static !important; display: block !important; overflow: visible !important; background: #fff !important; }
  .co-main { display: block !important; }
  .co-rail, .co-title, .ex-controls, .sd, .co-toasts, .co-menu, .co-scrim, .co-status { display: none !important; }
  .co-page { overflow: visible !important; padding: 0 !important; }
  .paper { max-width: none; margin: 0; padding: 0; border-radius: 0; box-shadow: none; color: #000; --rf-text: #000; --rf-dim: #333; --rf-faint: #555; --rf-line: #bbb; }
  .paper .co-wordmark b, .ex-head { color: #000; }
  .ex-driver { break-after: page; page-break-after: always; }
  .ex-driver.together { break-after: auto; page-break-after: auto; margin-bottom: 10mm; }
  .ex-driver:last-child { break-after: auto; page-break-after: auto; }
  .ex-work { display: block !important; }
  .ex-sheets { overflow: visible !important; }
  .ex-table tr { break-inside: avoid; page-break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.tk-stack.across { flex-direction: row; }
.tk-stack.across > * { flex: 1; }

/* how many days a sheet covers */
.ex-span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--rf-dim); width: auto; }
.ex-span .input { width: 64px; height: 34px; padding: 4px 8px; }
.ex-chip { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--rf-dim); box-shadow: inset 0 0 0 1px var(--rf-line); }
.ex-chip.on { color: var(--sr-action-ink); box-shadow: inset 0 0 0 1.5px var(--sr-action-ink); }

/* the book-on sheet */
.ex-book th.fill { text-align: center; }
.ex-book td.fill { min-width: 70px; border-left: 1px solid var(--rf-line); }
.ex-book td.sig { min-width: 120px; }
.ex-book td.c { text-align: center; vertical-align: middle; }
.ex-book td { height: 34px; vertical-align: middle; }
.ex-book tr.idle td { color: var(--rf-faint); }

/* the coach and duty graphs */
.gr { display: flex; flex-direction: column; font-size: 10.5px; }
.gr-row { display: flex; align-items: stretch; min-height: 34px; border-bottom: 1px solid var(--rf-line); break-inside: avoid; page-break-inside: avoid; }
.gr-row.none .gr-name b { color: #b3261e; }
.gr-name { flex: none; width: 112px; padding: 5px 8px 5px 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.gr-name b { font-size: 12px; }
.gr-name small { color: var(--rf-dim); font-size: 10px; }
.gr-track { position: relative; flex: 1; min-width: 0; }
.gr-hours { flex: none; width: 52px; display: flex; align-items: center; justify-content: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.gr-axis { min-height: 30px; border-bottom: 1.5px solid var(--ex-ink, #071433); }
.gr-axis .gr-hours { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ex-ink, #071433); }
.gr-tick { position: absolute; bottom: 3px; transform: translateX(-50%); font-size: 9.5px; color: var(--rf-dim); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; white-space: nowrap; }
.gr-tick.day { transform: none; align-items: flex-start; padding-left: 3px; color: var(--ex-ink, #071433); font-weight: 700; }
.gr-tick b { font-size: 10.5px; color: var(--ex-accent, #c80a62); }
.gr-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dotted rgba(7, 20, 51, 0.16); }
.gr-line.day { border-left: 1.5px solid color-mix(in srgb, var(--ex-ink, #071433) 55%, #fff); }
.gr-bar { position: absolute; display: flex; align-items: center; gap: 4px; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 4px; font-size: 10px; font-weight: 600; color: #fff; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.gr-bar em { font-style: normal; font-weight: 800; }
.gr-bar.other { color: #333; background: repeating-linear-gradient(135deg, #eef1f8 0 5px, #dfe4ef 5px 10px); box-shadow: inset 0 0 0 1px #b8c0d3; }
.gr-pre { position: absolute; transform: scaleY(0.5); border-radius: 3px 0 0 3px; background: var(--c); opacity: 0.35; }
.gr-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 10.5px; color: var(--rf-dim); }
.gr-key span { display: inline-flex; align-items: center; gap: 6px; }
.gr-key i { width: 14px; height: 10px; border-radius: 3px; }
.gr-key i.other { background: repeating-linear-gradient(135deg, #eef1f8 0 3px, #dfe4ef 3px 6px); box-shadow: inset 0 0 0 1px #b8c0d3; }
.ex-graph { break-after: page; page-break-after: always; }
.ex-graph:last-child { break-after: auto; page-break-after: auto; }
.tk-legs .tk-map { font-size: 9.5px; color: var(--rf-dim); white-space: nowrap; }

/* Depots & costs: the running costs by depot, and whether each coach earns its keep. */
.dc-head .seg { margin-right: 4px; }
.dc-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dc-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dc-sum b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-sum small { font-size: 11.5px; color: var(--rf-dim); }
.dc-rows { display: flex; flex-direction: column; gap: 8px; }
.dc-row { display: grid; grid-template-columns: minmax(140px, 1.6fr) minmax(120px, 1fr) 120px 120px 150px 150px 84px 34px; gap: 8px; align-items: center; }
.dc-row .field > span:empty { display: none; }
.dc-row.head span { font-size: 11.5px; font-weight: 600; color: var(--rf-dim); }
.dc-row .r { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.dc-row.past > *:not(:last-child) { opacity: 0.55; }
.dc-period { gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; }
.dc-period .field > span:empty { display: none; }
.dc-period .input[type="date"] { width: 160px; }
.dc-tablehead { gap: 12px; padding: 12px 14px; box-shadow: inset 0 -1px 0 var(--rf-line); flex-wrap: wrap; }
.dc-keep th.num, .dc-fin th.num { text-align: right; }
.dc-keep td.num, .dc-fin td.num { text-align: right; white-space: nowrap; }
.dc-keep tfoot td { font-weight: 600; background: var(--sr-soft); }
.dc-pos { color: var(--rf-ok); }
.dc-neg { color: var(--rf-err); }
.dc-foot { margin-top: 12px; max-width: 900px; }
@media (max-width: 1250px) {
  .dc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dc-row { grid-template-columns: 1fr 1fr 1fr 34px; }
  .dc-row.head { display: none; }
}
