/*
 * The desk layout: the same app on a laptop in the trailer.
 *
 * Everything here waits for html.wide, which app.html's head sets before the
 * first paint when the window is 1024 px or wider with a mouse or a desktop
 * browser's word (or the device chose Desktop in Settings: from 600 px, a
 * tablet upright; a phone's in its frame at any width). A phone at the phone
 * layout never gets the class, so it applies no rule of this file, which
 * app.html links at every width. Under 900 px the sidebar is a rail of short
 * words that opens over the page on a tap; a touch screen keeps 48 px taps
 * (html.touch).
 * test/desktop-css.test.js fails on any selector that does not start with
 * html.wide, or html[data-print] inside @media print.
 *
 * Colours are the theme tokens from themes.css, never a hex: every theme
 * reads the same here as on the phone. Print swaps the tokens for paper.
 *
 * The parts: density; the sidebar (body > .top); <main> and its panes
 * (solo | wide | split, set by src/desktop.js from src/lib/panes.js); sheets
 * as dialogs; Home as a dashboard; the JOB grid; the calendar and the map
 * side by side from 1280 px; print views for the daily report, the
 * look-ahead, the contacts card, the charge log and the contract quantities.
 */

/* ─── Density: a mouse, not a glove ────────────────────────────────────── */

html.wide { --tap: 40px; }
/* And the other sizes a mouse's, as the rules below draw them: a small button 32, the one primary 46. A chip keeps the
   phone's --chip: the sliders are the phone's row (a wrapping row of chips is tighter, below). */
html.wide { --tap-row: 32px; --tap-big: 46px; }
/* A fine screen at a desk (styles.css): 32 px rows, its small ones the desk's own. */
html.wide[data-density="fine"] { --tap-row: 32px; --tap-big: 40px; }
/* A touch screen at the desk layout (a tablet): a finger's taps. */
html.wide.touch { --tap: 48px; }
html.wide.touch { --tap-row: 44px; --tap-big: 56px; }
html.wide.touch :is(.btn, .small, .tile, #headbar .tab, #side-tools .tile, .chips:not(.scroll) > .chip) { min-height: 48px; }
html.wide body { font-size: 15px; }
html.wide :is(input:not([type="checkbox"], [type="radio"]), textarea, select) { padding: 8px 10px; border-radius: var(--r-m); font-size: 15px; }
html.wide #screen-job :is(input:not([type="checkbox"], [type="radio"]), textarea, select) { font-size: 15px; }
html.wide textarea { min-height: 96px; }
html.wide .head { font-size: 17px; }
html.wide .hint { font-size: 13px; }
html.wide .md { font-size: 15px; }
html.wide .btn { padding: 8px 14px; border-radius: var(--r-m); }
html.wide .btn.big { min-height: 46px; font-size: 16px; }
/* A screen's primary at a desk: in the page where it stands, as the rules above draw it (R1-06's bar is a phone's). */
html.wide .actionbar { position: static; display: flex; gap: var(--g-2); padding: 0; border: 0; background: none; }
html.wide .actionbar > .btn { min-height: var(--tap-big); }
/* A ghost button standing alone in a screen (Add layer, Later, Skip, Photo, Restore) is its words wide, not the column's. */
html.wide .screen > .btn.ghost { align-self: flex-start; }
html.wide .small { min-height: 32px; padding: 5px 10px; border-radius: var(--r-m); }
/* Chip rows that wrap get tighter. With a mouse the sliders (.chips.scroll: divisions, sections, subs, crews, the
   themes) wrap too, since a wheel does not move a row sideways; a touch screen at the desk keeps them sliding. */
html.wide .chips:not(.scroll) > .chip { min-height: 34px; padding: 6px 12px; }
html.wide:not(.touch) .chips.scroll { flex-wrap: wrap; overflow: visible; }
html.wide:not(.touch) .chips.scroll > .chip { min-height: 34px; padding: 6px 12px; }
html.wide .item,
html.wide .gcard { padding: 10px 12px; border-radius: var(--r-m); }
/* A section's row opens its page: room kept for its › at a desk too (C22). */
html.wide :is(.item.pvsecgo, .item.plsec) { padding-right: 32px; }
html.wide details summary { min-height: 38px; }
html.wide .steptitle { font-size: 19px; }
html.wide .steer { padding: 10px 12px; font-size: 18px; }
html.wide .gps { min-height: 36px; }
html.wide .results .item { min-height: 40px; }
html.wide .tiles .tile { min-height: 56px; padding: 12px 14px; border-radius: var(--r-m); font-size: 16px; }

/* What a mouse can press says so, and answers the pointer. */
html.wide :is(button, a[href], summary, label.btn, select, .calday) { cursor: pointer; }
/* Hover: a fill, the edge kept (a border moved to --line-strong came out fainter than --edge); the primary a shade brighter. */
html.wide :is(button.item, .tiles .tile, .btn.secondary, .btn.ghost, .chip:not(.on)):hover { background: var(--panel2); }
html.wide .btn.primary:hover { filter: brightness(1.08); }

/* ─── The sidebar: the job bar and the six places, down the left ───────── */

html.wide body > .top {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-top);
  width: 208px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
html.wide body > .top .bar { flex-direction: column; align-items: flex-start; gap: var(--g-1); padding: 16px 14px 12px; background: none; border-bottom: 1px solid var(--line); }
html.wide body > .top .job { max-width: 100%; min-height: 0; padding: 0; font-size: 16px; line-height: 1.3; text-align: left; overflow-wrap: anywhere; white-space: normal; overflow: visible; }
html.wide body > .top .who { font-size: 13px; }
html.wide body > .top .date { margin-left: 0; font-size: 13px; }
html.wide body > .top .offline { margin-top: 4px; }

html.wide #headbar { flex-direction: column; padding: 8px 0; background: none; border-bottom: 1px solid var(--line); }
html.wide #headbar .tab { flex: none; min-height: 36px; padding: 0 16px; text-align: left; font-size: 15px; color: var(--ink); }
html.wide #headbar .tab:hover { background: var(--panel2); }
html.wide #headbar .tab.active { color: var(--accent); background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
/* A tool row below is the screen: the place above it only names it, in the accent, with no ground and no rule. */
html.wide #headbar.sub .tab.active { background: none; box-shadow: none; }

/* The second level: the tools, one line each (src/desktop.js draws them). */
html.wide #side-tools { display: flex; flex-direction: column; padding: 8px 0; }
html.wide #side-tools .tile { min-height: 30px; padding: 5px 16px; border: none; border-radius: 0; background: none; color: var(--dim); font-size: 14px; font-weight: 600; }
html.wide #side-tools .tile:hover { color: var(--ink); background: var(--panel2); }
html.wide #side-tools .tile[aria-current="page"] { color: var(--accent); background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }

/* The foot: the job switcher, the theme, sign out. */
html.wide #side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--g-2); padding: 12px 14px 16px; border-top: 1px solid var(--line); }
html.wide #side-foot select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
html.wide #side-foot .btn { align-self: flex-start; }

/* ─── Main: one form, a board, or a list with its detail ───────────────── */

html.wide main { margin-left: 208px; padding: 24px; }
html.wide .banner { margin: 16px 24px 0 232px; }
html.wide .toast { left: calc(50% + 104px); }

html.wide main.solo > .screen { max-width: 760px; margin-inline: auto; }
html.wide main.wide > .screen { max-width: 1600px; margin-inline: auto; }

html.wide main.split {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 920px);
  column-gap: 24px;
  justify-content: center;
  align-items: start;
}
/* Placed, not flowed: the Diary comes before Today in app.html. */
html.wide main.split > .pane-list {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
html.wide main.split > .pane-detail,
html.wide main.split > #pane-empty { grid-column: 2; grid-row: 1; min-width: 0; }
html.wide #pane-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-l);
  color: var(--dim);
  font-size: 15px;
  text-align: center;
}
/* The row whose detail is open beside the list. */
html.wide main.split > .pane-list .sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* The list is in view: a back button to it only repeats it. */
html.wide main.split :is(#sop-back, #pi-back, #d-back, #x-back, #v-back, #k-back, #wk-back) { display: none; }
/* The crew board's worker headings open the worker beside it. */
html.wide #g-list .group.wk-open { display: block; width: 100%; padding: 0; border: none; background: none; font: inherit; font-size: 13px; text-align: left; color: var(--dim); cursor: pointer; }
html.wide #g-list .group.wk-open:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
html.wide #g-list .group.wk-open.sel { color: var(--accent); box-shadow: none; }
html.wide #screen-worker .item.expired .code { color: var(--tint-red-ink); }

/* ─── Tables: a list at a desk, sorted, filtered, taken away as CSV ────── */

/* A list pane holding a table takes a little more room; the detail the rest. */
html.wide main.split:has(> .pane-list .dtable) { grid-template-columns: minmax(300px, 420px) minmax(0, 920px); }
html.wide main.split > .pane-list tr.sel { box-shadow: none; }
html.wide .dtable { display: flex; flex-direction: column; gap: var(--g-2); min-width: 0; }
html.wide .dtable .dt-bar { display: flex; align-items: center; gap: var(--g-2); }
html.wide .dtable .dt-filter { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; font-size: 14px; }
html.wide .dtable .dt-count { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
html.wide .dtable :is(.dt-csv, .dt-print) { min-height: 36px; padding: 4px 12px; }
/* The rows scroll under a head that stays (design review R1-18): the table's own box scrolls both ways, a screen
   tall at most; the head's line is a shadow, since a collapsed border scrolls away with its row. */
html.wide .dtable .dt-scroll { overflow: auto; max-height: calc(100vh - 160px); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel); }
html.wide .dtable table.dt { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.35; }
html.wide .dtable th { position: sticky; top: 0; z-index: 1; background: var(--panel2); text-align: left; font-size: 13px; font-weight: 650; color: var(--dim); border-bottom: 1px solid var(--line); box-shadow: inset 0 -1px 0 var(--line); padding: 0; white-space: nowrap; }
html.wide .dtable :is(th, td).num { text-align: right; font-variant-numeric: tabular-nums; }
html.wide .dtable .dt-sort { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; cursor: pointer; }
html.wide .dtable th.num .dt-sort { text-align: right; }
html.wide .dtable .dt-sort:hover { color: var(--ink); }
html.wide .dtable .dt-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
html.wide .dtable .dt-sort[aria-sort="ascending"]::after { content: " \25B2"; font-size: 11px; }
html.wide .dtable .dt-sort[aria-sort="descending"]::after { content: " \25BC"; font-size: 11px; }
/* A column not sorted yet shows it can be, under the pointer or the keyboard. */
html.wide .dtable .dt-sort[aria-sort="none"]:is(:hover, :focus-visible)::after { content: " \2195"; font-size: 11px; opacity: 0.6; }
html.wide .dtable td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
html.wide .dtable tbody tr:last-child td { border-bottom: none; }
html.wide .dtable tr.pick { cursor: pointer; }
html.wide .dtable tr.pick:hover td { background: var(--panel2); }
html.wide .dtable tr.pick:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
html.wide .dtable tr.sel td,
html.wide .dtable tr.open td { background: var(--panel2); }
html.wide .dtable tr.sel td:first-child,
html.wide .dtable tr.open td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
html.wide .dtable .dt-empty td { color: var(--dim); padding: 14px 10px; }
html.wide .dtable td .cellsub { display: block; color: var(--dim); font-size: 12px; }
html.wide .dtable td.nowrap { white-space: nowrap; }
html.wide .dtable td a { color: var(--ink); text-underline-offset: 2px; }
html.wide .dtable td .badge { font-size: 12px; }
html.wide .dtable td .btn.small { min-height: 30px; padding: 2px 8px; font-size: 13px; }
html.wide .dtable td :is(select, input) { min-height: 34px; padding: 4px 8px; font-size: 14px; }
html.wide .dtable td .pp-code { flex-wrap: nowrap; gap: var(--g-2); }

/* The print buttons: at a desk only; on a JOB card's heading, to the right. */
html.wide .btn.deskonly { display: inline-flex; }
/* The Plans door at a desk: the tabs their own width; a card's cover down its left, beside what the set is and its ways
   in, Pages a button among them and the work left on its pages a line under them; Jump to section a panel down the
   right, the door beside it (a phone's is a bottom sheet). */
html.wide .plfact { padding: 10px 14px; }
html.wide .plfact b { font-size: 22px; }
html.wide .plsegtabs { align-self: flex-start; width: 520px; max-width: 100%; }
html.wide .plcards { gap: var(--g-3); }
html.wide .plcard { grid-template-columns: 196px minmax(0, 1fr); align-content: start; padding: 14px; }
html.wide .plcard > .plcover { grid-row: 1 / span 3; align-self: start; }
html.wide .plcard > :is(.placts, .plwork, .pl-setstate) { grid-column: 2; }
html.wide .placts .btn { flex: 0 0 auto; }
html.wide .placts .pl-pages { display: inline-flex; }
html.wide .plwork { display: block; }
html.wide .plcard > .pl-pages-row { display: none; }
html.wide .plmeta { font-size: 13px; }
html.wide .plpending { grid-template-columns: minmax(0, 1fr); }
html.wide .plpending > .pl-setstate { grid-column: 1; }
html.wide :is(#pl-jump, #pv-addref, #pv-sec, #save-sheet, #mk-words, #nt-sheet, #nt-box, #mp-list).sheet { flex-direction: row; justify-content: flex-end; padding: 0; background: none; }
html.wide :is(#pl-jump, #pv-addref, #pv-sec, #save-sheet, #mk-words, #nt-sheet, #nt-box, #mp-list) > .sheet-body { width: 400px; max-width: none; height: 100%; max-height: none; margin: 0; padding: 16px; border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; background: var(--panel); box-shadow: -12px 0 32px var(--scrim); overflow-y: auto; animation: none; }
/* The plan viewer at a desk: the set's pages a column down the page's left (the side column's tools then sit against
   the page), as tall as the page and scrolled on its own, the one shown lit and kept in its middle (plans.js
   renderStrip); on the page's right a side column with Save page, this person's note and the references on the page,
   scrolled on its own too. A phone keeps the strip under the page, the chips and Save page over it. */
html.wide #screen-plan-view .pvbody { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
html.wide #screen-plan-view .pvbody:has(> #pv-rail:not([hidden])) { grid-template-columns: 104px minmax(0, 1fr) 280px; }
html.wide #screen-plan-view .pvbody:has(> #pv-side[hidden]) { grid-template-columns: minmax(0, 1fr); }
html.wide #screen-plan-view .pvbody:has(> #pv-rail:not([hidden])):has(> #pv-side[hidden]) { grid-template-columns: 104px minmax(0, 1fr); }
/* The rail takes the column's height from the row and gives it to the strip, the page box under it. */
html.wide #screen-plan-view #pv-rail:not([hidden]) { order: -1; display: flex; flex-direction: column; gap: 6px; min-height: 0; contain: size; }
html.wide #screen-plan-view #pv-rail[hidden] { display: none; }
html.wide #screen-plan-view #pv-strip { position: relative; flex: 1 1 0; min-height: 0; flex-direction: column; align-items: center; overflow-x: hidden; overflow-y: auto; padding: 0 2px; scroll-snap-type: y proximity; contain: size; }
html.wide #screen-plan-view .pvgoto { flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; }
html.wide #screen-plan-view #pv-goto-n { width: 46px; min-height: 30px; padding: 2px 4px; text-align: right; font-size: 14px; }
html.wide #screen-plan-view .pvgotoof { color: var(--dim); font-size: 13px; white-space: nowrap; }
/* Down the column, a section's divider runs across it with its name over the line (C22). */
html.wide #screen-plan-view #pv-strip .pvsecdiv { width: 100%; margin: 2px 0 -4px; padding-top: 2px; border-left: 0; border-top: 2px solid var(--line-strong); justify-content: flex-start; }
html.wide #screen-plan-view #pv-strip .pvsecdiv.yours { border-top-color: var(--accent); }
html.wide #screen-plan-view #pv-strip .pvsecdivname { max-width: 96px; max-height: none; writing-mode: horizontal-tb; transform: none; }
html.wide #screen-plan-view #pv-chips { display: none; }
/* The head's line at a desk (item 53): Bookmark, Reference and Sections stand on it, no menu. */
html.wide #screen-plan-view .pvmore { display: none; }
html.wide #screen-plan-view .pvpair { position: static; flex: none; display: flex; flex-direction: row; min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; }
html.wide #screen-plan-view .pvpair:not(:has(> :not([hidden]))) { display: none; }
html.wide #screen-plan-view .pvpair .btn { min-height: 32px; }
html.wide #screen-plan-view .pvname { font-size: 18px; }
html.wide #screen-plan-view .pvside { display: flex; flex-direction: column; gap: var(--g-2); min-width: 0; overflow-y: auto; padding-right: 2px; contain: size; }
html.wide #screen-plan-view .pvacts { gap: var(--g-2); }
html.wide #screen-plan-view .pvacts .btn { flex: 1 1 0; }
html.wide #screen-plan-view .pvsidehead { margin-top: 8px; }
html.wide #screen-plan-view .pvrefs { display: flex; flex-direction: column; gap: 4px; }
html.wide #screen-plan-view .pvrefs .plref { margin-left: 0; }
html.wide #screen-plan-view .pvrefs button.plref { width: 100%; }
html.wide #screen-plan-view .pvrefs .plkind { min-width: 0; }
/* With Take off beside it the column is narrow: the kind over the words, so a sheet number never breaks. */
html.wide #screen-plan-view .pvrefs .plrefline > .plref { flex-direction: column; align-items: flex-start; gap: 2px; }
html.wide #screen-plan-view .pvrefs button.plref { width: 100%; }
html.wide #screen-plan-view .pvrefs .plrefline > button.plref { width: auto; }
html.wide #pv-note-text, html.wide #pv-note-text:focus { height: auto; min-height: 96px; resize: vertical; }
/* Mark up at a desk (src/plans.js): the marks under the references, Mark up a button over the list (#mk-go, moved into
   #mk-go-home), and the history. Marking, the tools take the head of the column (Save page, the note and the references
   wait): two across with Line and Measure, the six inks, the three widths, Save markup, the symbols; the marks and the
   history stay under them. The newest revision is the column's line, not a pill over the page. */
html.wide #pv-rev { display: none; }
html.wide #screen-plan-view .mkside { display: flex; flex-direction: column; gap: var(--g-2); }
html.wide #mk-go-home .mkgo { flex: 1 1 auto; gap: 6px; }
html.wide #mk-go-home .mkgo .mkic { width: 20px; height: 20px; }
html.wide #screen-plan-view .mkpanel { order: -1; }
html.wide #screen-plan-view.marking :is(#pv-note, #pv-refs, #pv-side > .pvsidehead, #mk-go-home) { display: none; }
html.wide .mkpanel .mktools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* The bar at a desk: Save markup a row of its own; folded (item 53), the side column a rail down the page's right, the
   page wider: the tool picked, Undo, Redo, Save and Done stacked. */
html.wide .mkbar { flex-wrap: wrap; }
html.wide .mkbar .mkfold { flex: 1 1 auto; max-width: none; }
html.wide .mkbar .mksave { flex: 1 1 100%; }
html.wide #screen-plan-view.mkfolded .pvbody { grid-template-columns: minmax(0, 1fr) 84px; }
html.wide #screen-plan-view.mkfolded .pvbody:has(> #pv-rail:not([hidden])) { grid-template-columns: 104px minmax(0, 1fr) 84px; }
html.wide #screen-plan-view.mkfolded .pvside > :not(#mk-panel) { display: none; }
html.wide #screen-plan-view.mkfolded .mkpanelhead { order: 1; }
html.wide #screen-plan-view.mkfolded .mkpanelhead .lbl { display: none; }
html.wide #screen-plan-view.mkfolded #mk-done { flex: 1 1 auto; }
html.wide #screen-plan-view.mkfolded .mkbar { flex-direction: column; flex-wrap: nowrap; }
html.wide #screen-plan-view.mkfolded .mkbar > * { flex: none; width: 100%; min-width: 0; max-width: none; }
html.wide #screen-plan-view.mkfolded .mkfold { flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 4px; font-size: 12px; text-align: center; }
html.wide #screen-plan-view.mkfolded .mkfoldword { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
html.wide #screen-plan-view.mkfolded .mkfold .mkchev { display: none; }
html.wide #screen-plan-view.mkfolded .mksave { padding: 6px 4px; font-size: 0; white-space: normal; }
html.wide #screen-plan-view.mkfolded .mksave::before { content: "Save " attr(data-n); font-size: 14px; }
html.wide .mkpanel .mktool { flex-direction: row; justify-content: flex-start; gap: 8px; min-height: var(--tap-row); padding: 4px 10px; font-size: 14px; }
html.wide .mkpanel .mktool .mkic { width: 20px; height: 20px; }
html.wide .mkpanel .mkinks { justify-content: flex-start; gap: 10px; }
html.wide .mkpanel .mkswatch { width: 28px; height: 28px; }
html.wide .mkpanel .btn.big { min-height: var(--tap); font-size: 16px; }
html.wide .mkpanel .mkpanelhead .lbl { margin: 0; }
/* The desk's symbols (src/plans.js renderSymbols), under the tools while marking: a field that finds one by name, then
   the groups, a head each that opens and folds (one open at a time; with words in the field, every group they find
   in), three symbols across, each its drawing in the theme's ink over its name; the one picked lit as a tool is. */
html.wide #screen-plan-view .mksymbols { order: -1; display: flex; flex-direction: column; gap: 6px; padding-top: var(--g-2); border-top: 1px solid var(--line); }
html.wide .mksymbols .lbl { margin: 0; }
html.wide .mksymfind { min-height: 40px; padding: 6px 10px; border-radius: var(--r-m); font-size: 15px; }
html.wide .mksymnone { margin: 0; font-size: 14px; }
html.wide .mksymgroups { display: flex; flex-direction: column; }
html.wide .mksymgroup { border-bottom: 1px solid var(--line); }
html.wide .mksymhead { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 2px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 650; text-align: left; cursor: pointer; }
html.wide .mksymhead::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.12s; }
html.wide .mksymhead[aria-expanded="true"]::before { transform: rotate(45deg); }
html.wide .mksymhead:hover { color: var(--accent); }
html.wide .mksymname { flex: 1 1 auto; min-width: 0; }
html.wide .mksymcount { flex: none; min-width: 24px; padding: 0 6px; border-radius: var(--r-pill); background: var(--panel2); color: var(--dim); font-size: 12px; text-align: center; }
html.wide .mksymgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 0 8px; }
html.wide .mksymgrid[hidden] { display: none; }
html.wide .mksym { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 76px; padding: 6px 2px 4px; border: 1px solid var(--edge); border-radius: var(--r-m); background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer; }
html.wide .mksym:hover { border-color: var(--accent); }
html.wide .mksym[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
html.wide .mksymic { flex: none; width: 36px; height: 36px; overflow: visible; }
html.wide .mksymword { display: -webkit-box; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* The Calendar's day and time off are the side column at a desk, never put away (their sheets are the phone's, R4-04). */
html.wide :is(#cal-day-close, #off-close) { display: none; }
html.wide #screen-job .jobhead .deskonly { margin-left: auto; }

/* Bulk at a desk: a bar over the list, and a tick at the head of each row. */
html.wide .bulkbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--g-2); margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel2); }
html.wide .bulkbar[hidden] { display: none; }
html.wide .bulkbar .toggle { min-height: 32px; font-size: 14px; }
html.wide .bulkbar .toggle input { width: 18px; height: 18px; }
html.wide #bulk-note { flex: 1; min-width: 200px; min-height: 34px; }
html.wide #off-bulk-said { flex-basis: 100%; margin: 0; color: var(--tint-red-ink); }
html.wide #bulk-count { margin: 0 auto 0 0; }
html.wide .dtable :is(th, td).dt-tick { width: 34px; padding: 7px 4px 7px 10px; }
html.wide :is(.dtable, .item.offreq) :is(.dt-check, .dt-all) { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
html.wide .item.offreq .top .dt-check { margin-right: 8px; align-self: center; }

/* The address book: the table, and the company picked beside it. */
html.wide #screen-book .bookgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
html.wide #book-detail { position: sticky; top: 24px; }

/* ─── Sheets: a dialog over a scrim, not a page ────────────────────────── */

html.wide .sheet { padding: 7vh 24px 48px; background: var(--scrim); }
html.wide .sheet-body { max-width: 680px; padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 20px 60px var(--scrim); }
/* A phone's bottom sheet is a dialog in the middle at a desk. */
html.wide .sheet.bottom { justify-content: center; }
/* A page to check, large: wide enough to read the drawing; its arrows beside its name. */
html.wide #ck-page > .sheet-body { max-width: 1040px; }
html.wide #ck-page .ck-zoom { max-height: 62vh; }
html.wide #ck-page .ck-steps { order: 0; flex: none; }
html.wide #ck-page .ck-approve { order: 0; flex: none; }
/* The pages to check at a desk: more of them a row, a card lit under the mouse. */
html.wide .ck-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
html.wide:not(.touch) .ck-card:hover { border-color: var(--accent); }
html.wide .ck-confirm { align-self: flex-start; }

/* ─── Home: the day down the left, the weather beside it (design review R2-02) ─── */

html.wide #screen-menu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); column-gap: 24px; row-gap: var(--g-2); align-items: start; }
/* The day's lines and lists down the first column in their order; the weather at the top of the second. */
html.wide #screen-menu > * { grid-column: 1; }
html.wide #menu-install { grid-column: 1 / -1; margin-bottom: 6px; }
html.wide #menu-weather { grid-column: 2; grid-row: 1 / span 8; }
html.wide #screen-menu:has(> #menu-install:not([hidden])) > #menu-weather { grid-row: 2 / span 8; }
html.wide #screen-menu:has(> #menu-weather[hidden]) > * { grid-column: 1 / -1; }
html.wide #menu-strip .calday { min-height: 84px; }
/* Tools at a desk: Most used four across, the groups and a group's rows three across. */
html.wide #tools-most { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.wide :is(#tools-groups, #tools-tiles > .toolset:not([hidden])) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g-2); }
/* Home's Assign and Walk at a desk: two buttons their own width, not the board's. */
html.wide #menu-actions { justify-content: flex-start; }
html.wide #menu-actions > .btn { flex: 0 1 220px; }

/* ─── JOB: the card on top, contract time and the crews left, contacts right ─ */

/*
 * Found in use, item 49 ("Job page on desktop, huge spacing between items, wastes so much screen room"): one column
 * under 1100 px; above, two, the card and the contract quantities across both, contacts, work links and the survey on
 * the right, the rest on the left, each column's sections one under the other with 12 px between and no band (packed:
 * src/desktop.js packJob gives each section rows of 2 px for its height).
 */
html.wide #screen-job {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
}
@media (min-width: 1100px) {
  html.wide #screen-job { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; }
  html.wide #screen-job > * { grid-column: 1; }
  html.wide #screen-job > :is(#job-contacts, #job-links, #job-survey) { grid-column: 2; }
  html.wide #screen-job > #job-contacts { order: 1; }
  html.wide #screen-job > :not(#job-card, #job-contacts) { order: 2; }
  /* The contract quantities are a table of six columns: the page's whole width, under the rest. */
  html.wide #screen-job > #job-card { grid-column: 1 / -1; order: 0; }
  html.wide #screen-job > #job-quantities { grid-column: 1 / -1; order: 3; }
  html.wide #screen-job.packed { grid-auto-rows: 2px; row-gap: 0; }
  html.wide #screen-job.packed > * { margin-bottom: 12px; }
}
html.wide #screen-job .jobsec,
html.wide #screen-job .jobform { scroll-margin-top: 24px; }
/* A pay-item review line at a desk: one row, the tick, the number and name, the quantity to take, the ›. */
html.wide #screen-job .jqhead { grid-template-columns: 20px minmax(0, 1fr) auto var(--tap-row); grid-template-areas: "tick what amount more"; }
html.wide #screen-job .jqhead .jq-tick { width: 18px; height: 18px; margin: 0; align-self: center; }
html.wide #screen-job .jqwhat { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; align-self: center; padding-top: 0; }
html.wide #screen-job .jqwhat .jqnum { margin-right: 0; }
html.wide #screen-job .jqhead .jqamount { margin-right: 0; }
html.wide #screen-job .jqhead .jq-qty { width: 104px; min-height: 32px; padding: 4px 8px; }
html.wide #screen-job .jq-line > :not(.jqhead, input) { margin-left: 30px; }
/* A sub's record open (C19): Crews & Subs takes the page's width, so the record's eight columns read. */
@media (min-width: 1100px) {
  html.wide #screen-job:has(#sub-record):not(:has(> #job-contract[hidden])) > #job-trades { grid-column: 1 / -1; }
}
/* The contacts card alone (a laborer, or the Contacts tool): one readable column. */
html.wide #screen-job:has(> #job-contract[hidden]) { justify-content: center; }
html.wide #screen-job:has(> #job-contract[hidden]) { grid-template-columns: minmax(0, 760px); }
html.wide #screen-job:has(> #job-contract[hidden]) > * { grid-column: 1; }

/* The JOB page's own at a desk: a tight card, its status lines one under the other (item 49). */
html.wide #screen-job .jobcard { padding: 10px 12px; gap: 2px; }
html.wide #screen-job .jobtitle { font-size: 19px; }
html.wide #screen-job .jobhead { margin-top: 0; }
html.wide #screen-job .jobh { font-size: 16px; }
html.wide #screen-job .ctpanel,
html.wide #screen-job .panel { padding: 8px 12px; gap: 2px; }

/*
 * A fine screen at a desk (the JOB page, Settings, the plans, a plan set, a sheet's editor; found in use, item 49):
 * 32 px rows, a field, a button, a select and a fold's head alike, its 14 px text; a fold's head one line, what it
 * holds beside its name. A touch screen keeps a finger's taps (above).
 */
html.wide[data-density="fine"]:not(.touch) :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select) { min-height: 32px; padding: 4px 8px; font-size: 14px; }
html.wide[data-density="fine"]:not(.touch) textarea { min-height: 64px; padding: 6px 8px; font-size: 14px; }
html.wide[data-density="fine"]:not(.touch) .btn:not(.big) { min-height: 32px; padding: 4px 12px; font-size: 14px; }
html.wide[data-density="fine"]:not(.touch) .small { min-height: 28px; padding: 3px 8px; }
html.wide[data-density="fine"]:not(.touch) :is(.chips:not(.scroll), .chips.scroll) > .chip { min-height: 28px; padding: 3px 10px; }
html.wide[data-density="fine"]:not(.touch) details summary { min-height: 32px; }
html.wide[data-density="fine"]:not(.touch) details.fold.long > summary { flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
html.wide[data-density="fine"]:not(.touch) details.fold.long > summary .val { order: 0; flex: 0 1 auto; margin-left: var(--g-3); white-space: nowrap; }
html.wide[data-density="fine"]:not(.touch) .screen { gap: 6px; }

/*
 * Settings at a desk: a field's label beside it (item 49), in a column of its own; the words and the buttons under a
 * field in the field's column, a button its words wide. A hint between a label and its field: the label beside the
 * field all the same (it spans the hint's row and the field's, at their foot), the hint shown by its (i).
 */
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .foldbody > .stack:not([hidden]), .foldbody > .adminpart, details .md) { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: center; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody > .stack, .foldbody > .adminpart, details .md) { grid-column: 1 / -1; padding-bottom: 0; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody > .stack, .foldbody > .adminpart) { grid-template-columns: subgrid; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .stack, .adminpart, details .md) > :not(.lbl, .stack, .adminpart, details, .md, h2) { grid-column: 2; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .stack, .adminpart, details .md) > :is(details, h2) { grid-column: 1 / -1; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .stack, .adminpart, details .md) > .lbl { grid-column: 1; margin: 0; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .stack, .adminpart, details .md) > .lbl:has(+ .hint.explain:not([hidden]) + :is(input, select, textarea)) { grid-row: span 2; align-self: end; line-height: 32px; }
html.wide[data-density="fine"] #screen-settings :is(.foldbody, .stack, .adminpart, details .md) > .btn { justify-self: start; }

/* ─── Calendar: seven full columns, the day beside them from 1280 px ───── */

/* Each day names itself, so the letters over the grid go. */
html.wide #cal-week { display: none; }
html.wide #cal-grid { gap: var(--g-2); }
html.wide #cal-grid .calrow { gap: var(--g-2); }
html.wide #cal-grid .calday {
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--g-1);
  min-width: 0;
  min-height: 116px;
  padding: 6px 8px calc(8px + var(--lanes, 0) * 18px);
  overflow: hidden;
  text-align: left;
}
html.wide #cal-grid .calday .wd { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--dim); }
html.wide #cal-grid .calday .num { font-size: 16px; font-weight: 650; line-height: 1.2; }
html.wide #cal-grid .calday :is(.holname, .evtitle) { display: block; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A holiday's name gets two lines; an event keeps one, so three of them still fit. */
html.wide #cal-grid .calday .holname { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; font-weight: 650; color: var(--tint-warm-ink); }
html.wide #cal-grid .calday .evtitle.more { color: var(--dim); }
/* The titles carry the event pictures; the glyph line is the phone's. */
html.wide #cal-grid .calday .evs { display: none; }
html.wide #cal-grid .calday .dots { justify-content: flex-start; }
html.wide #cal-grid .calday .offcount { font-size: 12px; }
/* The chosen day, the size of a desk cell: tinted and ringed, not filled, so its bars and titles still read. */
html.wide #cal-grid .calday.on,
html.wide #cal-grid .calday.on.holiday { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); font-weight: 400; }
html.wide #cal-grid .calday.on .monthtag { color: var(--accent); }
html.wide #cal-grid .calday.on .offcount { color: var(--dim); }
/* Crews & Subs bars: up to six lanes, each wide enough for its name. */
html.wide #cal-grid .lanes { bottom: 6px; column-gap: var(--g-2); row-gap: var(--g-1); }
html.wide #cal-grid .tradebar { min-width: 0; height: 16px; overflow: hidden; }
html.wide #cal-grid .tradebar.first { margin-left: 6px; }
html.wide #cal-grid .tradebar.last { margin-right: 6px; }
html.wide #cal-grid .tradebar .barlabel { display: block; padding: 0 6px; font-size: 11px; font-weight: 700; line-height: 16px; color: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.wide #cal-grid .tradebar.marked .barlabel { position: relative; } /* above its days' marks (C19) */

/* Drag on the calendar with a mouse (a foreman and above): bars take the pointer, their true ends stretch. */
html.wide #cal-grid.canplan .tradebar { position: relative; pointer-events: auto; cursor: grab; }
html.wide #cal-grid.canplan .tradebar:is(.first, .last)::before,
html.wide #cal-grid.canplan .tradebar:is(.first, .last)::after { content: none; position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
html.wide #cal-grid.canplan .tradebar.first::before { content: ""; left: 0; }
html.wide #cal-grid.canplan .tradebar.last::after { content: ""; right: 0; }
html.wide #cal-grid.dragging,
html.wide #cal-grid.dragging * { cursor: grabbing; user-select: none; }
html.wide #cal-grid .tradebar.grab { outline: 2px solid var(--ink); outline-offset: 1px; }
html.wide #cal-grid .calday.dragpick { box-shadow: inset 0 0 0 2px var(--accent); }

/* The SWMP walk's map at a desk: room to read the sheets on it. */
html.wide #p-map { height: 420px; }

html.wide .sheetview { max-height: calc(100vh - 260px); }

@media (min-width: 1280px) {
  /* The grid left, the day and the time-off blocks right. Only once app.html wraps them. */
  html.wide #screen-calendar:has(> .calside),
  html.wide #screen-map:has(> .mapside) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 24px;
    align-items: start;
  }
  html.wide #screen-calendar > :is(.calmain, .calside),
  html.wide #screen-map > :is(.mapmain, .mapside) { display: flex; flex-direction: column; gap: var(--g-2); min-width: 0; }
  html.wide #screen-calendar > .calside,
  html.wide #screen-map > .mapside {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }
}

/* ─── Print: one block on paper, never the sidebar ─────────────────────── */

@media print {
  /* Paper is white whatever the theme: the tokens turn to ink on paper. */
  html.wide,
  html[data-print] {
    color-scheme: light !important;
    --bg: Canvas;
    --panel: Canvas;
    --panel2: Canvas;
    --line: GrayText;
    --line-strong: CanvasText;
    --ink: CanvasText;
    --dim: GrayText;
    --accent-ink: Canvas;
    --toast-bg: Canvas;
    --toast-ink: CanvasText;
    --tint-warm-bg: Canvas;
    --tint-warm-ink: CanvasText;
    --tint-blue-bg: Canvas;
    --tint-blue-ink: CanvasText;
    --tint-green-bg: Canvas;
    --tint-green-ink: CanvasText;
    --tint-red-bg: Canvas;
    --tint-red-ink: CanvasText;
    --tint-purple-bg: Canvas;
    --tint-purple-ink: CanvasText;
    --holiday-bg: color-mix(in srgb, var(--warn) 22%, Canvas);
  }

  /* Printed from the desk with no view chosen: the screen as it stands, the detail over its list. */
  html.wide body > .top,
  html.wide #pane-empty { display: none !important; }
  html.wide main { margin: 0; padding: 0; }
  html.wide main.split { display: block; }
  html.wide main.split:has(> .pane-detail) > .pane-list { display: none !important; }
  html.wide main.split > .pane-list { position: static; max-height: none; overflow: visible; }
  html.wide main > .screen { max-width: none; margin: 0; }

  /* A chosen view: only its block. */
  html[data-print] body > .top,
  html[data-print] :is(#banner, #toast, #urgent, #pane-empty, .sheet) { display: none !important; }
  html[data-print] main { display: block !important; margin: 0 !important; padding: 0 !important; }
  html[data-print] main > .screen { max-width: none !important; max-height: none !important; margin: 0 !important; position: static !important; overflow: visible !important; }

  /* The daily report: its heading and the report, as the Export screen shows it. */
  html[data-print="report"] main > :not(#screen-export) { display: none !important; }
  html[data-print="report"] #screen-export { display: block !important; }
  html[data-print="report"] #screen-export > :not(.screenhead, #report-preview) { display: none !important; }
  html[data-print="report"] #screen-export > .screenhead > :not(#x-head) { display: none !important; }
  html[data-print="report"] #x-head { margin: 0 0 8pt; font-size: 13pt; }
  /* The inspection report: the page as filled in, only the answers picked, no buttons. */
  html[data-print="inspection"] main > :not(#screen-swmp-report) { display: none !important; }
  html[data-print="inspection"] #screen-swmp-report { display: block !important; }
  html[data-print="inspection"] #screen-swmp-report :is(#ir-back, .irbtns, .irfiledhead, #ir-filed, #ir-saved, #ir-said, .irsign, .irmore) { display: none !important; }
  html[data-print="inspection"] #screen-swmp-report .chip:not(.on) { display: none !important; }
  html[data-print="inspection"] #screen-swmp-report .irsec { break-inside: avoid; }
  html[data-print="inspection"] #screen-swmp-report :is(input, textarea) { border: none; border-bottom: 1px solid GrayText; background: none; }
  html[data-print="report"] #report-preview { max-height: none; overflow: visible; padding: 0; border: none; background: none; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9.5pt; line-height: 1.35; }

  /* The look-ahead: the weeks on one landscape page, the crews' colours printed. */
  @page lookahead { size: landscape; margin: 10mm; }
  html[data-print="lookahead"] body { page: lookahead; }
  html[data-print="lookahead"] main > :not(#screen-calendar) { display: none !important; }
  html[data-print="lookahead"] #screen-calendar { display: block !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  html[data-print="lookahead"] #screen-calendar > .calmain { display: block !important; }
  html[data-print="lookahead"] #screen-calendar :is(.calside, #cal-prev, #cal-next, #cal-today, #cal-status, #cal-import, #cal-plus, #cal-schedule, #cal-sched, #cal-day, #off-mine, #off-crew-box) { display: none !important; }
  html[data-print="lookahead"] #screen-calendar > :is(hr, .panel, .head, p.lbl) { display: none !important; }
  html[data-print="lookahead"] #cal-title { margin: 0 0 6pt; font-size: 14pt; }
  html[data-print="lookahead"] #cal-trades { flex-wrap: wrap; overflow: visible; margin-bottom: 6pt; }
  html[data-print="lookahead"] #cal-trades .chip:not(.trade) { display: none !important; }
  html[data-print="lookahead"] #cal-trades .chip { min-height: 0; padding: 2pt 8pt; background: none; color: var(--ink); border-color: var(--line); font-weight: 400; }
  html[data-print="lookahead"] #cal-grid .calrow { break-inside: avoid; }
  html[data-print="lookahead"] #cal-grid .calday { min-height: 88px; }
  html[data-print="lookahead"] #cal-grid .calday.on { background: var(--panel); color: var(--ink); border-color: var(--line); font-weight: 400; }
  html[data-print="lookahead"] #cal-grid .calday.on.holiday { background: var(--holiday-bg); }
  /* Bars as tints of their crew's colour with black names: readable on paper from any theme, and light on ink. */
  html[data-print="lookahead"] #cal-grid .tradebar { background-image: linear-gradient(color-mix(in srgb, Canvas 55%, transparent), color-mix(in srgb, Canvas 55%, transparent)) !important; }
  html[data-print="lookahead"] #cal-grid .tradebar .barlabel { color: var(--ink); }

  /* The print buttons are the screen's, never the paper's. */
  html[data-print] .deskonly { display: none !important; }

  /* The contacts card, for the trailer wall: the job, what to tell 911, then everyone, two across. */
  html[data-print="contacts"] main > :not(#screen-job) { display: none !important; }
  html[data-print="contacts"] #screen-job { display: block !important; }
  html[data-print="contacts"] #screen-job > :not(#job-card, #job-contacts) { display: none !important; }
  html[data-print="contacts"] #job-card :is(#job-status-line, .jobstate) { display: none !important; }
  html[data-print="contacts"] #job-card { padding: 0 0 10pt; border: none; }
  html[data-print="contacts"] #job-contacts :is(.jobslot, #contacts-edit) { display: none !important; }
  html[data-print="contacts"] #job-contacts .line911 { font-size: 16pt; font-weight: 700; }
  html[data-print="contacts"] #job-contacts .l911 { font-size: 11pt; color: var(--ink); }
  html[data-print="contacts"] #job-contacts .list { display: grid; grid-template-columns: 1fr 1fr; gap: 8pt 12pt; }
  html[data-print="contacts"] #job-contacts .item { padding: 6pt 8pt; break-inside: avoid; }
  html[data-print="contacts"] #job-contacts .calls a { min-height: 0; padding: 0; border: none; background: none; color: var(--ink); align-items: flex-start; justify-content: flex-start; text-align: left; }
  html[data-print="contacts"] #job-contacts .calls a.mail::after { content: ": " attr(title); }
  /* At a desk the contacts are a table: on paper, without its filter and CSV, every row whole. */
  html[data-print="contacts"] #job-contacts .dtable .dt-bar { display: none !important; }
  html[data-print="contacts"] #job-contacts .dtable .dt-scroll { overflow: visible; border: none; background: none; }
  html[data-print="contacts"] #job-contacts .dtable :is(th, td) { padding: 3pt 6pt; font-size: 10pt; background: none; color: var(--ink); }
  html[data-print="contacts"] #job-contacts .dtable .dt-sort { padding: 0; }
  html[data-print="contacts"] #job-contacts .dtable .dt-sort::after { content: none; }
  html[data-print="contacts"] #job-contacts .dtable a { color: var(--ink); text-decoration: none; }
  html[data-print="contacts"] #job-contacts .dtable tr { break-inside: avoid; }

  /* A sub's record of days and delays (C19): its title, then the table whole, nothing else of the JOB page. */
  html[data-print="subrecord"] main > :not(#screen-job) { display: none !important; }
  html[data-print="subrecord"] #screen-job { display: block !important; }
  html[data-print="subrecord"] #screen-job > :not(#job-trades) { display: none !important; }
  html[data-print="subrecord"] #job-trades :not(#sub-record, #sub-record *):not(:has(#sub-record)) { display: none !important; }
  html[data-print="subrecord"] #sub-record :is(#sub-record-close, .dt-bar) { display: none !important; }
  html[data-print="subrecord"] #sub-record-title { font-size: 14pt; color: var(--ink); }
  html[data-print="subrecord"] #sub-record .dtable .dt-scroll { overflow: visible; border: none; background: none; }
  html[data-print="subrecord"] #sub-record .dtable :is(th, td) { padding: 3pt 6pt; font-size: 10pt; background: none; color: var(--ink); }
  html[data-print="subrecord"] #sub-record .dtable .dt-sort::after { content: none; }
  html[data-print="subrecord"] #sub-record .dtable tr { break-inside: avoid; }

  /* The charge log: contract time and every day logged (app.js opens #ct-log first). */
  html[data-print="chargelog"] main > :not(#screen-job) { display: none !important; }
  html[data-print="chargelog"] #screen-job { display: block !important; }
  html[data-print="chargelog"] #screen-job > :not(#job-card, #job-contract) { display: none !important; }
  html[data-print="chargelog"] #job-card :is(#job-status-line, .jobstate) { display: none !important; }
  html[data-print="chargelog"] #job-card { padding: 0 0 10pt; border: none; }
  html[data-print="chargelog"] #job-contract :is(.jobslot, .jobbtns, #ct-changes) { display: none !important; }
  html[data-print="chargelog"] #job-contract .ctpanel { padding: 0; border: none; }
  html[data-print="chargelog"] #ct-log { border: none; padding: 0; }
  html[data-print="chargelog"] #ct-log .logline { break-inside: avoid; }

  /* The contract quantities (#jq-print, its fold opened first): the job, then the table alone, every row whole, without
     its filter, CSV and Print. */
  html[data-print="quantities"] main > :not(#screen-job) { display: none !important; }
  html[data-print="quantities"] #screen-job { display: block !important; }
  html[data-print="quantities"] #screen-job > :not(#job-card, #job-quantities) { display: none !important; }
  html[data-print="quantities"] #job-card :is(#job-status-line, .jobstate) { display: none !important; }
  html[data-print="quantities"] #job-card { padding: 0 0 10pt; border: none; }
  html[data-print="quantities"] #job-quantities :is(.jobslot, .jobbtns, #jq-readbox, .dt-bar) { display: none !important; }
  html[data-print="quantities"] #job-quantities details.jobgroup { padding: 0; border: none; background: none; }
  html[data-print="quantities"] #job-quantities details.jobgroup > summary::after { content: none; }
  html[data-print="quantities"] #job-quantities .dtable .dt-scroll { overflow: visible; max-height: none; border: none; background: none; }
  html[data-print="quantities"] #job-quantities .dtable :is(th, td) { padding: 3pt 6pt; font-size: 10pt; background: none; color: var(--ink); }
  html[data-print="quantities"] #job-quantities .dtable th { position: static; box-shadow: none; }
  html[data-print="quantities"] #job-quantities .dtable .dt-sort { padding: 0; }
  html[data-print="quantities"] #job-quantities .dtable .dt-sort::after { content: none; }
  html[data-print="quantities"] #job-quantities .dtable tr { break-inside: avoid; }

  /* The drawing log (#plansets): the table alone, every row whole, without its filter and CSV. */
  html[data-print="drawinglog"] main > :not(#screen-plansets) { display: none !important; }
  html[data-print="drawinglog"] #screen-plansets { display: block !important; }
  html[data-print="drawinglog"] #screen-plansets > :not(#ps-log) { display: none !important; }
  html[data-print="drawinglog"] #ps-log .dtable .dt-bar { display: none !important; }
  html[data-print="drawinglog"] #ps-log .dtable .dt-scroll { overflow: visible; border: none; background: none; }
  html[data-print="drawinglog"] #ps-log .dtable :is(th, td) { padding: 3pt 6pt; font-size: 10pt; background: none; color: var(--ink); }
  html[data-print="drawinglog"] #ps-log .dtable .dt-sort { padding: 0; }
  html[data-print="drawinglog"] #ps-log .dtable .dt-sort::after { content: none; }
  html[data-print="drawinglog"] #ps-log .dtable tr { break-inside: avoid; }
}

/* ─── The SWMP home at a desk: the minimap the left half, the counts and lists the right ─── */

html.wide #screen-swmp-home:not([hidden]):has(#sw-minimap:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
html.wide #screen-swmp-home > .screenhead { grid-column: 1 / -1; }
html.wide #screen-swmp-home .swleft { position: sticky; top: 16px; }
html.wide #sw-minimap { height: calc(100vh - 140px); min-height: 360px; }
/* With the history under it, the map leaves it room. */
html.wide #screen-swmp-home .swleft:has(#sw-history:not([hidden])) #sw-minimap { height: calc(100vh - 330px); }
html.wide #screen-swmp-home .swmapbox:has(> #sw-minimap[hidden]) > .swhistview { height: calc(100vh - 330px); min-height: 360px; }
html.wide #screen-swmp-home .swside { display: flex; flex-direction: column; gap: var(--g-2); min-width: 0; }
/* No minimap (a map from before it): the one readable column. */
html.wide #screen-swmp-home:not(:has(#sw-minimap:not([hidden]))) { max-width: 760px; }

/* ─── A tablet upright (600 to 899 px): the sidebar a rail of short words, open over the page on a tap ─── */

html.wide #side-toggle { display: none; }
@media (max-width: 899px) {
  html.wide body > .top { width: 64px; overflow-x: hidden; }
  html.wide main { margin-left: 64px; padding: 16px; }
  html.wide .banner { margin: 12px 16px 0 80px; }
  html.wide .toast { left: calc(50% + 32px); }
  html.wide #side-toggle { display: block; align-self: center; min-width: 48px; min-height: 48px; margin: 8px 0 0; font-size: 20px; }
  html.wide body > .top .bar { align-items: center; padding: 8px 4px; }
  html.wide body > .top .job { font-size: 11px; text-align: center; max-height: 4em; overflow: hidden; }
  html.wide body > .top :is(.who, .date) { display: none; }
  html.wide #headbar .tab,
  html.wide #side-tools .tile { min-height: 48px; padding: 4px 2px; text-align: center; font-size: 11px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
  html.wide #side-tools .tile[data-short] { font-size: 0; }
  html.wide #side-tools .tile[data-short]::before { content: attr(data-short); font-size: 11px; }
  html.wide #side-foot { display: none; }
  html.wide body.side-open > .top { width: 208px; box-shadow: 0 0 0 100vmax var(--scrim); }
  html.wide body.side-open > .top .bar { align-items: flex-start; padding: 16px 14px 12px; }
  html.wide body.side-open > .top .job { font-size: 16px; text-align: left; max-height: none; }
  html.wide body.side-open > .top :is(.who, .date) { display: block; }
  html.wide body.side-open #headbar .tab,
  html.wide body.side-open #side-tools .tile { padding: 5px 16px; text-align: left; font-size: 14px; }
  html.wide body.side-open #side-tools .tile[data-short] { font-size: 14px; }
  html.wide body.side-open #side-tools .tile[data-short]::before { content: none; }
  html.wide body.side-open #side-foot { display: flex; }
  /* Home and Tools: one column of the board, the weather in it; Tools' rows two across. */
  html.wide #screen-menu { grid-template-columns: minmax(0, 1fr); }
  html.wide #screen-menu:has(> #menu-weather) > #menu-weather { grid-column: 1; grid-row: auto; }
  html.wide :is(#tools-groups, #tools-tiles > .toolset:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html.wide #sl-phone { color: var(--dim); font-size: 13px; }

/* A note to this person at a desk (#nt-alert): a card in the middle of the window, the screen dimmed behind it, not the
   whole window in the info colour. */
html.wide #nt-alert { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 48px)); max-height: calc(100vh - 48px); padding: 28px; border-radius: var(--r-l); box-shadow: 0 0 0 100vmax var(--scrim), 0 16px 48px var(--scrim); overflow-y: auto; }

/* P4: a section lined up with another. The map's question lists a line a sheet; the set's sections each with Line up with…. */
html.wide .stackask .stackrows { margin: 0; padding-left: 20px; max-height: 40vh; overflow-y: auto; font-size: 14px; line-height: 1.4; }
html.wide .stackask .stackrows[hidden] { display: none; }
html.wide .ps-lineup .ps-lineup-row { align-items: center; gap: 10px; }
html.wide .ps-lineup .ps-lineup-menu { flex-wrap: wrap; gap: 6px; padding-left: 12px; }
html.wide .ps-lineup .ps-lineup-menu[hidden] { display: none; }

/* Pair and line up from the plans (src/matchpairs.js, P2b): a section's button in Put sheets on the map, and the side
   panel of pairs, a row a pair with its fit or why none, the station marks under them, Accept at the foot. */
html.wide .plpickpair { align-self: flex-start; margin: 4px 0; }
html.wide #mp-list > .sheet-body { width: 460px; display: flex; flex-direction: column; gap: 10px; }
html.wide .mp-sum { margin: 0; font-weight: 650; }
html.wide .mp-pairs, html.wide .mp-marks { display: flex; flex-direction: column; gap: 8px; }
html.wide .mp-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--r-m); background: var(--bg); }
html.wide .mp-row.unmatched { border-left-color: var(--accent); }
html.wide .mp-row.skipped { opacity: 0.6; border-left-color: var(--line); }
html.wide .mp-row.skipped.picked { opacity: 1; }
html.wide .mp-row-head { display: flex; align-items: baseline; gap: 8px; }
html.wide .mp-row-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
html.wide .mp-row-score { color: var(--dim); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
html.wide .mp-row-how { margin: 0; color: var(--dim); font-size: 14px; }
html.wide .mp-row-how.mp-reason { color: var(--ink); }
html.wide .mp-row-acts { gap: 8px; }
/* The seam's picture at a desk (P14c; styles.css draws it): as tall as the panel's row holds it. */
html.wide .mp-pic svg { height: auto; max-height: 300px; }
html.wide .mp-pic-words { font-size: 14px; }
html.wide .mp-cand { min-width: 40px; }
html.wide .mp-marks-head { margin: 6px 0 0; }
html.wide .mp-mark { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
html.wide .mp-mark input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
html.wide .mp-mark-words { display: flex; flex-direction: column; min-width: 0; }
html.wide .mp-mark-sub { color: var(--dim); font-size: 13px; }
/* Found in use, 39: the button pinned on top, under the one line, where it is seen without scrolling. */
html.wide .mp-go { position: sticky; top: -16px; z-index: 1; display: flex; flex-direction: column; gap: 6px; margin: 0 -16px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
html.wide .mp-go .hint { margin: 0; }


/* Settings' Data tab (89): its rows keep their own layout, not the fine density's label-and-field grid. */
html.wide[data-density="fine"] #screen-settings #set-data > .foldbody { display: flex; flex-direction: column; align-items: stretch; text-align: start; gap: var(--g-2); }
html.wide[data-density="fine"] #screen-settings #set-data > .foldbody > * { justify-self: auto; margin-inline: 0; }
html.wide[data-density="fine"] #screen-settings #set-data > .foldbody > :is(select, .datarows, .confirm, .toggle, #data-said) { max-width: 640px; }

/* Add plans' Read the pages at a desk (found in use, 98): the pages two or three to a row in their fold. */
html.wide .ap-read-fold > .foldbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px var(--g-3); }
html.wide .ap-read-run { max-width: 640px; }
