/* Project desk. Shared look from ../site.css; this file holds only the desk's own pieces.
   Colours come from the shared tokens, so light and dark both work. */

/* ---------- the desk: a short head, a tab strip, one tool at a time ---------- */
/* the head is laid out as the rental desk's (rental.css, ".desk-intro:not(.plain)"): the small "Tools"
   eyebrow, then the heading with the short note at its right, then the one line running the full width */
.desk { padding-top: 14px; }
.desk-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; margin-bottom: 10px; }
.desk-head > div { display: contents; }
.desk-head .eyebrow { grid-column: 1; font-size: 13px; line-height: 1.2; }
.desk-head h1 { grid-column: 1; grid-row: 2; font-size: clamp(26px, 3vw, 34px); margin-top: 4px; }
.desk-head .site-note { grid-column: 2; grid-row: 2; align-self: end; padding-bottom: 4px; white-space: nowrap; }
.desk-sub { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; font-size: 15.5px; color: var(--ink-2); }
.desk-sub a { color: var(--c-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.desk-sub a:hover { text-decoration: underline; }
.desk .tab { scroll-margin-top: 70px; }

/* eight tools in two groups (lien deadlines make it nine), Money and The job; on phones a picker instead of the strip.
   as on the rental desk, each group's small capital label sits above its pill */
.desk-nav { display: flex; align-items: center; margin-bottom: 10px; }
.desk .tabs { background: transparent; padding: 16px 0 0; gap: 24px 8px; flex-wrap: wrap; overflow: visible; border-radius: 0; }
.tab-group { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--field); }
.tab-cap { position: absolute; left: 14px; bottom: 100%; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap; line-height: 1.2; }
.tool-pick { display: none; }
.panel-tool { padding: 20px 24px 14px; }
.panel-tool:focus-visible { outline-offset: 2px; }
.panel-tool .tool-head h2 { margin-top: 0; font-size: 24px; }
.panel-tool .split { margin-top: 14px; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.panel-tool .how { margin-top: 10px; padding-top: 8px; }
.panel-tool .tool-foot { margin-top: 10px; padding-top: 10px; }
.panel-tool .fields { margin-top: 0; }
.field-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .ans-big.bump { animation: bump .35s ease; }
  @keyframes bump { 40% { transform: scale(1.04); } }
}

/* ---------- small grids of inputs ---------- */
.grid-scroll { overflow-x: auto; }
.bid-grid, .inv-grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; margin: -4px; }
.bid-grid th, .bid-grid td, .inv-grid th, .inv-grid td { padding: 0; font-weight: 600; }
.bid-grid thead th:first-child { width: 30%; }
.inv-grid thead th { font-size: 12.5px; color: var(--ink-2); text-align: left; padding-left: 8px; }
.inv-grid thead th:first-child { width: 56%; }
.bid-grid input, .inv-grid input {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; border: 1.5px solid transparent; border-radius: 10px;
  background: var(--field); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; padding: 7px 9px;
  font-variant-numeric: tabular-nums; outline: none; }
.bid-grid input:focus, .inv-grid input:focus { border-color: var(--focus); background: var(--surface); }
.bid-grid td input { text-align: right; }
.bid-grid thead input { background: transparent; font-weight: 650; text-align: right; color: var(--c-ink); }
.bid-grid tbody th input { background: transparent; font-weight: 600; color: var(--ink); padding-left: 2px; }
.bid-grid input:placeholder-shown { background: color-mix(in srgb, var(--bad) 9%, var(--field)); }
.bid-grid input::placeholder { color: var(--ink); opacity: 1; font-style: italic; }

/* ---------- bid bars ---------- */
.bars { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.bars .who { font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.bars b { font-variant-numeric: tabular-nums; font-size: 16px; }
.bars .bar { grid-column: 1 / -1; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, transparent); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); transition: width .3s ease; }
.bars small { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars .short .bar i { background: repeating-linear-gradient(135deg, var(--bad) 0 6px, color-mix(in srgb, var(--bad) 55%, transparent) 6px 12px); }
/* Light --bad is under 4.5 to 1 on the building tint. Ink clears 4.5 and is not another line's colour. */
.bars .short small { color: var(--ink); font-weight: 650; }
.answer .ans-sum { color: var(--ink); }

/* ---------- payment stack ---------- */
.stack { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin-top: 14px; background: var(--field); }
.stack .seg { display: block; height: 100%; transition: width .3s ease; }
.paid { background: var(--c-ink); }
.due { background: var(--c); }
.held { background: repeating-linear-gradient(135deg, var(--c) 0 4px, transparent 4px 8px); }
.rest { background: color-mix(in srgb, var(--ink-2) 18%, transparent); }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ans-range.flag { color: var(--ink); font-weight: 600; }

/* ---------- the invoice, drawn as a sheet of paper ---------- */
.inv-more { margin-top: 12px; }
.inv-more .btn { padding: 9px 14px; font-size: 14px; }
/* a tool that makes a document offers a Word file and a PDF, then a quiet Print, in one row that wraps */
.file-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btns .btn { padding: 9px 14px; font-size: 14px; }
.log-controls .file-btns, .insp-controls .file-btns { flex-wrap: nowrap; }
.status.save { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.status.save:empty { display: none; }
.paper-wrap { display: grid; gap: 10px; align-content: start; }
.inv-answer { padding: 10px 16px; }
.inv-answer .ans-big { font-size: 30px; }
.inv-answer .ans-sum { margin-top: 2px; }
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 6px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 12.5px;
  border: 1px solid var(--paper-rule); }
.inv-head { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; border-bottom: 2px solid var(--paper-ink); padding-bottom: 6px; }
.inv-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin-right: auto; }
.inv-meta { font-size: 12px; font-variant-numeric: tabular-nums; }
.inv-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.inv-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.inv-text { white-space: pre-line; overflow-wrap: anywhere; }
.inv-lines { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.inv-lines th, .inv-lines td { text-align: right; padding: 3px; border-bottom: 1px dotted var(--paper-rule); overflow-wrap: anywhere; vertical-align: top; }
.inv-lines th { font-weight: 600; }
.inv-lines th:first-child, .inv-lines tbody td:first-child { text-align: left; width: 42%; }
.inv-lines tfoot td:first-child { text-align: right; }
.inv-lines .inv-grand td { border-top: 2px solid var(--paper-ink); border-bottom: 0; font-weight: 700; }

/* ---------- inspection order: a stage rail beside one stage at a time ---------- */
.insp-tool { padding-bottom: 12px; }
.insp-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; margin-top: 12px; align-items: stretch; }
.insp-answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; align-items: center; padding: 10px 16px; border-radius: 14px; }
.insp-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.insp-next .ans-label { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.insp-next-name { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.insp-next-note { font-size: 13.5px; color: var(--ink-2); }
.insp-count { display: grid; gap: 5px; justify-items: end; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.insp-count b { font-size: 17px; }
.insp-meter { display: block; width: 150px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; }
.insp-meter i { display: block; height: 100%; background: var(--c-ink); border-radius: 4px; transition: width .3s ease; }
.insp-controls { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; justify-content: flex-end; }
.insp-controls .btn { padding: 8px 14px; font-size: 14px; }
.insp-tool label.check, .insp-sites label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.insp-tool label.check input { width: 17px; height: 17px; accent-color: var(--c-ink); margin: 0; }

.insp-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; margin-top: 12px; }
.insp-rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; position: relative; }
.rail-btn { appearance: none; -webkit-appearance: none; width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px;
  align-items: center; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2);
  padding: 3px 8px; border-radius: 10px; cursor: pointer; text-align: left; }
.rail-btn:hover { background: var(--field); color: var(--ink); }
.rail-btn[aria-current="step"] { background: var(--tint); color: var(--c-ink); }
.rail-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 1.5px solid currentColor; font-variant-numeric: tabular-nums; flex: none; }
.rail-btn.done .rail-n { background: var(--c-ink); border-color: var(--c-ink); color: var(--on-c); }
.rail-c { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rail-btn[aria-current="step"] .rail-c { color: var(--c-ink); }

.insp-stages { display: grid; gap: 18px; align-content: start; }
.insp-stage h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 2px 0 8px; color: var(--ink); }
.insp-stage h3 .rail-n { color: var(--c-ink); }
.insp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.insp { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 8px 10px 8px 10px;
  border-radius: 12px; background: var(--field); border-left: 3px solid transparent; }
.insp.key { border-left-color: var(--c); }
.insp-text { min-width: 0; line-height: 1.35; }
.insp-name { font-weight: 650; font-size: 15px; line-height: 1.3; }
.insp-key { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 1px; }
.insp-looks, .insp-hold { display: inline; font-size: 13px; line-height: 1.4; }
.insp-looks { color: var(--ink-2); }
.insp-hold { font-weight: 650; color: var(--c-ink); }
.insp-hold::before { content: " \00b7  Hold: "; font-weight: 500; color: var(--ink-2); }
.insp-name { margin-bottom: 1px; }
.insp-step { appearance: none; -webkit-appearance: none; justify-self: start; margin-top: 8px; border: 0; background: transparent; font: inherit;
  font-size: 14px; font-weight: 650; color: var(--c-ink); padding: 4px 2px; cursor: pointer; }
.insp-step:hover { text-decoration: underline; }
.insp-set { display: flex; gap: 6px; align-items: center; }
.insp-set select, .insp-set input { appearance: none; -webkit-appearance: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 9px; padding: 5px 8px; min-width: 0; outline: none; }
.insp-set select { padding-right: 26px; width: 9.6em;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.insp-set input { width: 9.6em; font-variant-numeric: tabular-nums; color-scheme: light dark; }
.insp-set select:focus, .insp-set input:focus { border-color: var(--focus); }

/* the round mark: empty for not yet, a ring for booked, filled with a tick for passed, a dash for does not apply */
.insp-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink-2) 55%, transparent); margin-top: 1px; position: relative; }
.insp[data-status="booked"] .insp-mark { border-color: var(--c-ink); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.insp[data-status="passed"] .insp-mark { background: var(--c-ink); border-color: var(--c-ink); }
.insp[data-status="passed"] .insp-mark::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 10px;
  border: solid var(--on-c); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.insp[data-status="booked"] { background: var(--tint); }
.insp[data-status="passed"] .insp-hold { display: none; }
.insp[data-status="na"] .insp-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: var(--ink-2); }
.insp[data-status="na"] .insp-name { text-decoration: line-through; color: var(--ink-2); }
.insp[data-status="na"] .insp-hold, .insp[data-status="na"] .insp-looks { display: none; }

.insp-sites { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 10px; padding: 8px 10px; border-radius: 12px;
  border: 1.5px dashed var(--line); }
.insp-sites-q { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.insp-source { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); max-width: 86ch; }
.insp-sheet { display: none; }
#insp-count.bump { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  #insp-count.bump { animation: bump .35s ease; }
}

@media (max-width: 900px) {
  .insp-top { grid-template-columns: minmax(0, 1fr); }
  .insp-controls { justify-content: flex-start; }
  .insp-body { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .insp-rail { overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
  .insp-rail::-webkit-scrollbar { display: none; }
  .insp-rail ol { display: flex; gap: 4px; width: max-content; }
  .rail-btn { width: auto; grid-template-columns: 20px auto auto; gap: 6px; padding: 5px 9px 5px 6px; font-size: 13px; border-radius: 999px; background: var(--field); }
  .rail-n { width: 20px; height: 20px; font-size: 11px; }
  .insp-stage h3 { display: none; }
}

/* ---------- logs (change orders, lien releases) ---------- */
.log-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; margin-top: 12px; align-items: stretch; }
.log-answer { padding: 10px 16px; border-radius: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 24px; align-items: center; }
.log-ans-main { display: grid; }
.log-answer .ans-big { font-size: 34px; }
.log-ans-side { display: grid; gap: 2px; min-width: 0; }
.log-ans-side .ans-sum { margin-top: 0; }
.log-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.log-controls .field { width: 170px; }
.log-controls .btn { padding: 9px 16px; font-size: 14px; }
.log { margin-top: 12px; }
.log-head, .log-row { display: grid; gap: 6px; align-items: center; }
.co-log .log-head, .co-row { grid-template-columns: 74px 148px minmax(0, 1fr) 112px 64px 58px 124px; }
.rl-log .log-head, .rl-row { grid-template-columns: minmax(0, 1fr) 148px 124px 214px 148px; }
.log-head { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 9px 4px; }
.log-head .num { text-align: right; }
.log-rows { display: grid; gap: 4px; }
.cell { min-width: 0; }
.log-row input[type="text"], .log-row input[type="number"], .log-row input[type="date"], .log-row select,
.pl-item input[type="text"], .lic-row input[type="text"] {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; border: 1.5px solid transparent; border-radius: 10px;
  background: var(--field); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; padding: 6px 9px;
  font-variant-numeric: tabular-nums; outline: none; color-scheme: light dark; }
.log-row input:focus, .log-row select:focus, .pl-item input:focus, .lic-row input[type="text"]:focus { border-color: var(--focus); background-color: var(--surface); }
.log-row select { padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.c-cost input, .c-days input, .c-amt input { text-align: right; }
.c-signed { display: flex; justify-content: center; }
.log-row input[type="checkbox"], .pl-done input, .lic-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--c-ink); cursor: pointer; }
.c-run { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14.5px; padding-right: 9px; }
.add-row { appearance: none; -webkit-appearance: none; justify-self: start; border: 0; background: transparent; font: inherit; font-size: 14px;
  font-weight: 650; color: var(--c-ink); padding: 6px 2px; margin-top: 4px; cursor: pointer; }
.add-row:hover { text-decoration: underline; }
/* Light --bad is under 4.5 to 1 on the field. Ink clears 4.5 and is not another line's colour. */
.rl-row[data-back="no"] .c-kind select { color: var(--ink); font-weight: 650; }
.rl-answer { display: grid; justify-items: stretch; align-content: center; text-align: left; padding: 10px 16px; border-radius: 14px; }
.rl-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-top: 6px; }
.rl-line { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.rl-stack { margin-top: 8px; height: 12px; }
.got { background: var(--c-ink); }
.gap { background: repeating-linear-gradient(135deg, var(--bad) 0 4px, color-mix(in srgb, var(--bad) 30%, transparent) 4px 8px); }
.rl-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.rl-answer .ans-range { margin-top: 0; }
.log-head .mid { text-align: center; }

/* ---------- punch list: a rail of rooms beside the open room ---------- */
.pl-side { display: grid; align-content: start; gap: 4px; }
.pl-room { display: grid; align-content: start; }
.pl-roomhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pl-roomlabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.pl-roomhead input { appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; font: inherit; font-family: var(--display); font-size: 17px;
  font-weight: 700; color: var(--ink); background: transparent; border: 1.5px solid transparent; border-radius: 9px; padding: 3px 8px; outline: none; }
.pl-roomhead input:hover { border-color: var(--line); }
.pl-roomhead input:focus { border-color: var(--focus); background: var(--surface); }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 210px); gap: 8px; align-items: center; padding: 5px 8px 5px 10px;
  border-radius: 12px; background: var(--field); }
.pl-item input[type="text"] { background: var(--surface); }
.pl-done { display: flex; }
.pl-item[data-done="yes"] { background: var(--tint); }
.pl-item[data-done="yes"] .c-item input { text-decoration: line-through; color: var(--ink-2); }
.pl-open { font-size: 15px; font-weight: 650; }
#pl-count.bump, #lic-count.bump, #rl-line.bump { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  #pl-count.bump, #lic-count.bump, #rl-line.bump { animation: bump .35s ease; }
}

/* ---------- licence check: the number and the board's record on the left, what to read on the right ---------- */
.lic-split { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); margin-top: 12px; }
.lic-left { display: grid; align-content: start; gap: 8px; }
.lic-num .input input { font-size: 26px; font-weight: 650; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lic-shape { font-size: 13.5px; color: var(--ink-2); }
.lic-shape.flag { color: var(--bad); font-weight: 600; }
.lic-open { justify-self: start; }
.lic-board { font-size: 13px; color: var(--ink-2); max-width: 46ch; }
.lic-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2px; }
.lic-card { border-radius: 16px; padding: 12px 16px; background: var(--tint); display: grid; align-content: start; gap: 8px; }
.lic-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lic-cardhead .insp-count { justify-items: end; }
.lic-cardhead .insp-meter { width: 120px; }
.lic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lic-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 170px); gap: 4px 10px; align-items: center; padding: 6px 8px 6px 10px;
  border-radius: 12px; background: var(--surface); }
.lic-name { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); cursor: pointer; }
.lic-name b { color: var(--ink); font-size: 14.5px; margin-right: 2px; }
.lic-row input[type="text"] { font-size: 14px; padding: 5px 8px; }
.lic-row[data-done="yes"] .lic-name b { color: var(--c-ink); }
.lic-files { justify-self: start; }
.sheet { display: none; }

/* ---------- lien deadlines, the counted dates down a line ---------- */
.ld-split { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.ld-fields { align-content: start; gap: 10px 12px; }
.ld-wide { grid-column: 1 / -1; }
.ld-fields > .hint { margin-top: -6px; }
.ld-owed { display: grid; gap: 2px; }
.ld-owed .check { align-items: flex-start; font-size: 13.5px; line-height: 1.35; font-weight: 600; }
.ld-owed .check input { flex: none; margin-top: 1px; }
.ld-owed .hint { padding-left: 26px; line-height: 1.35; }
.ld-scope { font-size: 13px; font-weight: 600; color: var(--c-ink); }
.ld-printbox .btn { padding: 9px 14px; font-size: 14px; }
.ld-right { display: grid; align-content: start; gap: 10px; min-width: 0; }
.ld-answer { padding: 12px 16px; }
.ld-answer .ans-sum { margin-top: 4px; }
.ld-answer .ans-range { margin-top: 4px; }
.ld-answer .ans-big.words { font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; }
.ld-answer .ans-big.passed { color: var(--ink); }
.ld-flags { display: grid; gap: 2px; }
.ld-steps { list-style: none; margin: 0; padding: 0; max-height: 238px; overflow-y: auto; overscroll-behavior: contain; }
.ld-step { position: relative; display: grid; grid-template-columns: 14px 124px minmax(0, 1fr); gap: 0 10px; padding: 3px 4px 3px 0;
  font-size: 13.5px; line-height: 1.35; }
.ld-step::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--c) 35%, transparent); }
.ld-step:first-child::before { top: 10px; }
.ld-step:last-child::before { bottom: auto; height: 10px; }
.ld-dot { position: relative; z-index: 1; box-sizing: border-box; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%;
  border: 2.5px solid var(--c); background: var(--surface); }
.ld-step.undated .ld-dot { transform: scale(.6); background: var(--c); }
.ld-step.safe .ld-dot, .ld-step.last .ld-dot { background: var(--c); }
.ld-when { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-step.undated .ld-when { color: var(--ink-2); }
.ld-what { min-width: 0; }
.ld-what b { font-weight: 650; color: var(--ink); margin-right: 6px; }
.ld-note { color: var(--ink-2); margin-right: 6px; }
.ld-cite { font-size: 12px; font-weight: 600; color: var(--c-ink); overflow-wrap: anywhere; }
.ld-step.safe .ld-when, .ld-step.safe b { color: var(--c-ink); }
.ld-step.flag .ld-dot, .ld-step.passed .ld-dot { border-color: var(--bad); }
.ld-step.flag .ld-when, .ld-step.passed .ld-when { color: var(--bad); }
.ld-tag { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bad); vertical-align: 1px; }
.ld-fixed { font-size: 12.5px; color: var(--ink-2); }
.ld-rules { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.ld-rules .ld-cite { margin-left: 4px; }
.ld-q { font-style: italic; }

.printline { display: none; }

/* the head on a narrow screen, as the rental desk's at the same width: the note drops under the heading
   and runs the full width; only the link stays of the line under the heading */
@media (max-width: 700px) {
  .desk { padding-top: 12px; }
  .desk-head { margin-bottom: 8px; }
  .desk-head h1 { font-size: 24px; }
  .desk-head .site-note { grid-column: 1 / -1; grid-row: 4; margin-top: 4px; padding-bottom: 0; white-space: normal; }
  .desk-sub-text { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .desk .tabs { display: none; }
  .tool-pick { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 13px; font-weight: 650; color: var(--ink-2); }
  .tool-pick select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; font: inherit; font-size: 16px; font-weight: 650;
    color: var(--c-ink); background-color: var(--field); border: 1.5px solid transparent; border-radius: 999px; padding: 9px 36px 9px 16px; outline: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--c-ink) 50%), linear-gradient(135deg, var(--c-ink) 50%, transparent 50%);
    background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
  .tool-pick select:focus { border-color: var(--focus); }
  .panel-tool { padding: 16px 14px 12px; }
  .panel-tool .tool-head h2 { font-size: 21px; }
  .tool-one { font-size: 14.5px; }
  .split.wide-left { grid-template-columns: minmax(0, 1fr); }
  .bid-grid input, .inv-grid input { font-size: 15px; padding: 6px 6px; }
  .bid-grid thead th:first-child { width: 28%; }
  .bars { gap: 6px; margin-top: 6px; }
  .bars .bar { height: 9px; }
  .answer { padding: 12px 14px; }
  .ans-big { font-size: 32px; }
  .field-row { gap: 8px; }
  .field-row .field > span:first-child { font-size: 12px; }
  /* the bid and payment answers end inside the first screen of a phone; spacing only, no text smaller */
  .legend { margin-top: 6px; gap: 2px 14px; }
  .legend li { line-height: 1.3; }
  #pay-sum, #panel-bids .ans-sum { margin-top: 6px; }
  #panel-schedule .stack { margin-top: 10px; }
  .field-row .field > span:first-child { line-height: 1.3; }
  .bid-grid thead input { padding-top: 3px; padding-bottom: 3px; }
  .bid-grid tbody input { padding-top: 5px; padding-bottom: 5px; }
  .bars { margin-bottom: 6px; }
  /* each amount sits under its own label, so the four keys line up whatever their length */
  .legend:not(.rl-legend) b { flex-basis: 100%; padding-left: 16px; }
  /* the bidder names fit their narrow columns */
  .bid-grid thead input { font-size: 13px; padding-left: 2px; padding-right: 2px; }
  .panel-tool .tool-foot .more { display: none; }
  .insp-answer { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .insp-count { justify-items: start; grid-auto-flow: column; align-items: center; gap: 10px; }
  .insp-meter { width: 110px; }
  .insp-next-name { font-size: 17px; }
  .insp { grid-template-columns: 20px minmax(0, 1fr); padding: 8px; gap: 4px 10px; }
  .insp-set { grid-column: 2; }
  .insp-set select, .insp-set input { flex: 1 1 0; width: auto; font-size: 14px; }
  .insp-looks { font-size: 13px; }
  #insp-clear { display: none; }

  /* On phones: each log row becomes a small card, with a caption over each box */
  .log-top { grid-template-columns: minmax(0, 1fr); }
  .log-answer { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .log-answer .ans-big { font-size: 28px; }
  .log-controls { justify-content: flex-start; }
  .log-controls .field { width: auto; flex: 1 1 100%; }
  .log-controls .file-btns, .insp-controls .file-btns { flex-wrap: wrap; }
  .log-head { display: none; }
  .log-rows { gap: 8px; }
  .log-row { padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); gap: 6px 8px; }
  .co-row .c-no { grid-area: no; } .co-row .c-date { grid-area: date; } .co-row .c-signed { grid-area: signed; }
  .co-row .c-what { grid-area: what; } .co-row .c-cost { grid-area: cost; } .co-row .c-days { grid-area: days; } .co-row .c-run { grid-area: run; }
  .co-row { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); grid-template-areas: "no date date" "what what signed" "cost days run"; }
  .rl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "who who" "date amt" "kind rdate"; }
  .rl-row .c-who { grid-area: who; } .rl-row .c-amt { grid-area: amt; } .rl-row .c-kind { grid-area: kind; }
  .rl-row .c-date:nth-child(2) { grid-area: date; } .rl-row .c-date:nth-child(5) { grid-area: rdate; }
  .log-row .cell::before, .pl-item .cell::before { content: attr(data-cap); display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 2px 2px; }
  .c-signed { flex-direction: column; align-items: center; }
  .c-run { padding: 0; align-self: end; line-height: 34px; }
  .rl-line { font-size: 16px; }
  .pl-item { grid-template-columns: 22px minmax(0, 1fr); padding: 8px; }
  .pl-item .c-who { grid-column: 2; }
  .pl-item .cell::before { display: none; }
  .lic-split { grid-template-columns: minmax(0, 1fr); }
  .lic-row { grid-template-columns: 20px minmax(0, 1fr); }
  .lic-row input[type="text"] { grid-column: 2; }
  .lic-card { padding: 10px 12px; }
  /* the count of items read sits on the bottom edge of the first screen; tighter gaps in this panel only */
  #panel-licence.panel-tool { padding-top: 8px; }
  #panel-licence .lic-split { margin-top: 4px; }
  #panel-licence .lic-left { gap: 4px; }
  #panel-licence .lic-card { padding-top: 4px; }
  #panel-licence .lic-board, #panel-licence .lic-shape { line-height: 1.3; }

  /* On phones: the answer first, then the form, then the dates down their line */
  .ld-split { grid-template-columns: minmax(0, 1fr); }
  .ld-right { display: contents; }
  .ld-answer { order: -1; padding: 10px 12px; }
  .ld-scope { order: -1; }
  .ld-steps { order: 1; max-height: none; }
  .ld-fixed { order: 2; }
  .ld-fields { gap: 8px; }
  .ld-fields > .field:first-child { grid-column: 1 / -1; }
  .ld-step { grid-template-columns: 14px minmax(0, 1fr); }
  .ld-when, .ld-what { grid-column: 2; }
}

@page { margin: 16mm; }
/* Dark --bad already clears 4.5, so dark keeps the warning colour.
   ::placeholder cannot sit inside :is(); that pseudo-element is dropped. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bid-grid input::placeholder { color: var(--bad); }
  :root:not([data-theme="light"]) :is(
    .bars .short small, .ans-range.flag,
    .rl-row[data-back="no"] .c-kind select, .ld-answer .ans-big.passed
  ) { color: var(--bad); }
}
:root[data-theme="dark"] .bid-grid input::placeholder { color: var(--bad); }
:root[data-theme="dark"] :is(
  .bars .short small, .ans-range.flag,
  .rl-row[data-back="no"] .c-kind select, .ld-answer .ans-big.passed
) { color: var(--bad); }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .masthead, .site-foot, .desk-head, .tabs, .panel-tool:not(#panel-invoice) { display: none !important; }
  #panel-invoice { display: block !important; box-shadow: none; border: 0; padding: 0; }
  #panel-invoice .tool-head, #panel-invoice .split > div:first-child, #panel-invoice .inv-answer,
  #panel-invoice .tool-foot, #panel-invoice .how { display: none !important; }
  #panel-invoice .split { display: block; margin: 0; }
  .paper { box-shadow: none; border: 0; padding: 0; background: #fff; color: #000; font-size: 11pt; }
  .inv-head, .inv-lines .inv-grand td { border-color: #000; }
  .inv-lines th, .inv-lines td { border-color: #999; }
  .printline { display: block; margin-top: 12mm; font-size: 9pt; color: #444; }

  /* the inspection checklist: one page, two columns, a box and a date line for each */
  [data-print="inspections"] #panel-invoice { display: none !important; }
  [data-print="inspections"] #panel-inspections { display: block !important; box-shadow: none; border: 0; padding: 0; background: #fff; }
  #panel-inspections > :not(.insp-sheet):not(.insp-source) { display: none !important; }
  #panel-inspections .insp-sheet { display: block; color: #000; }
  #panel-inspections .insp-source { margin-top: 4mm; font-size: 8pt; color: #444; max-width: none; }
  [data-print="inspections"] .printline { margin-top: 2mm; font-size: 8pt; }
  .sheet-title { font-size: 15pt; font-weight: 700; }
  .sheet-sub { font-size: 9.5pt; margin: 1mm 0 3mm; }
  .sheet-cols { columns: 2; column-gap: 8mm; }
  .sheet-stage { break-inside: avoid; margin-bottom: 2.5mm; }
  .sheet-h { font-size: 10pt; font-weight: 700; border-bottom: 1.2pt solid #000; padding-bottom: .5mm; margin-bottom: .8mm; }
  .sheet-list { list-style: none; margin: 0; padding: 0; }
  .sheet-row { display: grid; grid-template-columns: 4mm 1fr auto; gap: 0 2mm; font-size: 9pt; padding: .8mm 0; border-bottom: .5pt dotted #999; }
  .sheet-box { width: 3mm; height: 3mm; border: .9pt solid #000; margin-top: .6mm; }
  /* a passed inspection is a filled box even when the browser leaves backgrounds off */
  .sheet-row.passed .sheet-box { background: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-row.na .sheet-name { text-decoration: line-through; color: #666; }
  .sheet-when { font-size: 8.5pt; color: #333; white-space: nowrap; }
  .sheet-hold { grid-column: 2 / -1; font-size: 7.5pt; color: #555; }

  /* change orders, lien releases, punch list and licence check each print their own one-page sheet */
  [data-print="changes"] #panel-invoice, [data-print="releases"] #panel-invoice,
  [data-print="punch"] #panel-invoice, [data-print="licence"] #panel-invoice,
  [data-print="lien-dates"] #panel-invoice { display: none !important; }
  [data-print="changes"] #panel-changes, [data-print="releases"] #panel-releases,
  [data-print="punch"] #panel-punch, [data-print="licence"] #panel-licence,
  [data-print="lien-dates"] #panel-lien-dates { display: block !important; box-shadow: none; border: 0; padding: 0; background: #fff; }
  #panel-changes > :not(.sheet), #panel-releases > :not(.sheet), #panel-punch > :not(.sheet), #panel-licence > :not(.sheet),
  #panel-lien-dates > :not(.sheet) { display: none !important; }
  .sheet { display: block; color: #000; }
  .sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9.5pt; font-variant-numeric: tabular-nums; }
  .sheet-table th, .sheet-table td { text-align: left; padding: 1.4mm 1.2mm; border-bottom: .5pt solid #999; vertical-align: top; overflow-wrap: anywhere; }
  .sheet-table th { border-bottom: 1.2pt solid #000; font-weight: 700; }
  .sheet-checks .sheet-row { grid-template-columns: 4mm minmax(0, 1fr) 62mm; padding: 2.5mm 0; font-size: 10.5pt; }
  .sheet-note { border-bottom: .5pt solid #000; font-size: 10pt; }
  .sheet .sheet-box { display: inline-grid; place-items: center; font-size: 7pt; line-height: 1; font-weight: 700; }
  .co-table th:nth-child(1) { width: 10%; } .co-table th:nth-child(2) { width: 14%; } .co-table th:nth-child(3) { width: 31%; }
  .co-table th:nth-child(4) { width: 13%; } .co-table th:nth-child(5) { width: 7%; } .co-table th:nth-child(6) { width: 9%; }
  .co-table th:nth-child(7) { width: 16%; }
  .rl-table th:nth-child(1) { width: 22%; } .rl-table th:nth-child(2) { width: 16%; } .rl-table th:nth-child(3) { width: 15%; }
  .rl-table th:nth-child(4) { width: 28%; } .rl-table th:nth-child(5) { width: 19%; }
  .sheet-sign { margin-top: 12mm; display: grid; gap: 9mm; font-size: 10.5pt; }
  .sheet-sign-line { white-space: pre; }
  /* the lien dates, their sections, and the fixed lines */
  .sheet-big { font-size: 12pt; font-weight: 700; margin: 2mm 0 1mm; }
  .sheet-flag { font-weight: 700; }
  .ld-table { margin-top: 2mm; font-size: 8.5pt; }
  .ld-table th, .ld-table td { padding: .7mm 1mm; }
  #ld-sheet .sheet-big { font-size: 11pt; margin-top: 1mm; }
  #ld-sheet .sheet-sub { margin: .5mm 0 1mm; font-size: 9pt; }
  .ld-table th:nth-child(1) { width: 20%; } .ld-table th:nth-child(2) { width: 49%; } .ld-table th:nth-child(3) { width: 31%; }
  .sheet-line { font-size: 8.5pt; margin-top: 1mm; }
  .bid-grid input::placeholder, .bars .short small, .ans-range.flag,
  .rl-row[data-back="no"] .c-kind select, .ld-answer .ans-big.passed { color: #000 !important; }
}
