/* Peg's own additions to peg.css. peg.css is the design handover (Peg-design-handover.zip, 13 Oct 2026)
   kept as it came, so a revised handover drops straight in; what it did not draw lives here, on its tokens. */

/* The design's components set display, which would beat the hidden attribute; hidden always wins. */
[hidden] { display: none !important; }

/* The icon sprite: CSP allows no style attributes, so it is hidden by class. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Tablet pages are two .screen panes in a .split; on a phone they stack, so the second loses its top gap. */
.split > .screen + .screen { padding-top: 0; }
.split > .screen:first-child { padding-bottom: var(--s4); }
@container app (min-width: 768px) { .split > .screen:first-child { padding-bottom: 0; } }

/* The appbar: a sign out at the right of the jobs screen. */
.appbar .btn--quiet { color: var(--on-brand); min-height: 44px; }
.appbar__end { margin-left: auto; padding-right: var(--s2); display: flex; align-items: center; gap: var(--s2); }

/* A stack with the tight gap the markup used inline. */
.stack--tight { gap: var(--s1); }

/* Take photo is a label around a file input, so it can open the camera without script. */
label.btn input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.btn { position: relative; }
.prompt__actions > :only-child { grid-column: 1 / -1; }

/* A photo held on the record but not shown (no coverage, or not signed yet). */
.thumb--off { display: grid; place-items: center; font: var(--t-label); color: var(--muted); }


/* The quote form: the price book's job-sheet inputs, in a card that opens. */
details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); min-height: 64px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .card__title { flex: 1; }
details.card > summary .ic { transition: transform .15s; }
details.card[open] > summary .ic { transform: rotate(90deg); }
.form-section + .question { border-top: 0; padding-top: var(--s2); }
.card__body > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section { font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* Requests to the PC worker. */
.asks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); }
.asks .btn { width: 100%; }
.work > li { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.work > li:first-child { border-top: 0; }
.work__top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: space-between; }

/* The desk study's source line under each overlay. */
.overlays .cond__detail { grid-column: 1 / -1; }

/* An error under a form. */
.err { margin-top: var(--s2); }

/* Step 4: the land report import beside the PC's buttons, the study map, the quote's notes. */
.inline-ask { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); margin-top: var(--s2); }
@media (max-width: 420px) { .inline-ask { grid-template-columns: 1fr; } }
.studymap { display: block; width: 100%; height: auto; border-radius: var(--r-sm, 6px); margin-bottom: var(--s2); }
.quote__notes summary { cursor: pointer; }
.quote__notes ul { margin: var(--s2) 0 0; padding-left: 1.2em; }

/* Signing on the spot: the pad takes a finger without scrolling the page. */
.sigpad { display: block; width: 100%; background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r); touch-action: none; }
label.consent { display: flex; gap: var(--s2); align-items: flex-start; font: var(--t-body); }
label.consent input { width: 22px; height: 22px; flex: none; margin-top: 2px; }

/* Billing (15 Oct 2026): the tracker's figures, small tables, the invoice builder's pick lists. */
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
.fig { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r, 8px); }
.fig__label { font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
.fig__value { font: var(--t-title, 600 18px/1.2 var(--font-display, sans-serif)); }
.fig__value small { font: var(--t-label); color: var(--muted); margin-left: var(--s1); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font: var(--t-body); }
.tbl th, .tbl td { text-align: left; padding: var(--s1) var(--s2); border-top: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); border-top: 0; }
.tbl tfoot th, .tbl tfoot td { font-weight: 600; border-top: 2px solid var(--line-strong, var(--line)); }
.tbl .num { text-align: right; white-space: nowrap; }
.picks { display: flex; flex-direction: column; gap: var(--s1); }
.pick { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2); align-items: start; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r, 8px); font: var(--t-body); }
.pick input { width: 22px; height: 22px; margin-top: 2px; }
.pick span { display: flex; flex-direction: column; }
.pick small { color: var(--muted); }

/* The mark goes home (5 Nov 2026): the wordmark on the jobs screen, the mark alone elsewhere. */
a.wordmark { color: inherit; text-decoration: none; }
.appbar__home { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); color: inherit; border-radius: var(--r); margin-left: auto; }
.appbar__home svg { width: 26px; height: 26px; }
#sync + .appbar__home, .appbar__end + .appbar__home { margin-left: 0; }

/* Log time on the fly, and the practice overview. */
.choice--hours { margin-bottom: var(--s2); }
.choice--hours span { min-width: 56px; justify-content: center; font-variant-numeric: tabular-nums; }
.screen--wide { max-width: 1120px; }
.figs--lead { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.fig__note { font: var(--t-small); color: var(--muted); }
.tbl__sub { display: block; font: var(--t-small); color: var(--muted); font-weight: 400; }
.tbl th a { color: inherit; }

/* The printable report (#/report): on screen a sheet inside the app; on paper an A4 document with
   none of the app around it. */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 8px); padding: var(--s4, 16px); margin-top: var(--s4, 16px); }
.report__kicker { margin: 0; font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
.report__title { margin: 4px 0; font: var(--t-title); }
.report__meta, .report__note { margin: 0 0 var(--s2, 8px); color: var(--muted); font: var(--t-small); }
.report__section { margin-top: var(--s5, 24px); }
.report__h { margin: 0 0 var(--s1, 4px); font: var(--t-h2); padding-bottom: 4px; border-bottom: 2px solid var(--ink); }
.report__job { margin: var(--s3, 12px) 0 var(--s1, 4px); font: var(--t-strong); }
.report__figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2, 8px); }
.report__fig { display: flex; flex-direction: column; gap: 2px; padding: var(--s2, 8px); border: 1px solid var(--line); border-radius: 6px; }
.report__fig span { color: var(--muted); font: var(--t-small); }
.report__fig strong { font-variant-numeric: tabular-nums; font-size: 1.15em; }
.report .tbl { font-size: 14px; }
.report__tbl tbody th { font-weight: 500; }
.choice--multi { gap: 6px; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  /* Paper is always light, whatever the screen's theme: (0,3,0)+ beats every theme selector in the skins. */
  :root:root:root, :root:root:root[data-theme] {
    color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --muted: #444;
    --line: #bbb; --line-strong: #666; --met: #000; --unmet: #000; --unknown: #000;
  }
  body { background: #fff !important; color: #000; }
  .appbar, #bar, .demo-banner, .no-print, .note--stale { display: none !important; }
  .screen { padding: 0 !important; max-width: none !important; }
  .report { border: 0; padding: 0; margin: 0; }
  .report__section { break-inside: auto; }
  .report__h, .report__job { break-after: avoid; }
  .report .tbl tr { break-inside: avoid; }
  .report .tbl thead { display: table-header-group; }
  .tbl-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* Budget alert sliders (item 3 of the 6 Nov billing entry). */
.slider { display: flex; align-items: center; gap: 12px; }
.slider input[type="range"] { flex: 1; min-width: 0; accent-color: var(--primary); height: 32px; }
.slider__out { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font: var(--t-small); }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.alert-row + .alert-row { border-top: 1px solid var(--line); padding-top: 8px; }

/* The timer on Log time, and the alerts (6 Nov). */
.timer__top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.timer__clock { margin-left: auto; font: 600 22px/1 var(--font-text); font-variant-numeric: tabular-nums; }
/* The timer window (#/timer, 1 Dec): laid out for a window about 360 pixels wide, parked beside the work. */
.screen--timer { max-width: 480px; padding-top: var(--s3); gap: var(--s3); }
.timer-who { display: flex; align-items: center; gap: var(--s2); }
.timer-who .label { margin: 0; white-space: nowrap; }
.timer-who .select { flex: 1; min-width: 0; }
.timer__job { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.timer__job small, .timer-recent__go small { color: var(--muted); font: var(--t-small); }
.timer__big { margin: 0; font: 600 44px/1.05 var(--font-text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.timer--running { border-left: 4px solid var(--primary); }
.timer-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.timer-recent form { margin: 0; }
.timer-recent__go { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: 8px 12px; text-align: left;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); font: inherit; cursor: pointer; }
.timer-recent__go:hover, .timer-recent__go:focus-visible { border-color: var(--line-strong); }
.timer-recent__go span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.timer-recent__go b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar__bell { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--on-brand); opacity: 0.75; }
.appbar__bell--on { opacity: 1; }
.appbar__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--unmet); color: #fff; font: 700 11px/18px var(--font-text); text-align: center; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line); }
.alert:first-child { border-top: 0; }
.alert__main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.alert__main a { color: var(--ink); font-weight: 600; text-decoration: none; }
.alert--seen .alert__main a { font-weight: 400; color: var(--muted); }
.alert__kind { font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--unmet); }
.alert--seen .alert__kind { color: var(--muted); }

/* A rule between the forms inside one card (settings.js). */
.divider { border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ the shell's menu (nav.js, 2 Dec 2026)
   One list drawn three ways. A narrow window gets the bottom bar (and More); from 900 px the sidebar takes
   over and the bottom bar goes. The main column is its own "app" container, so the design's tablet rules
   (two panes from 768 px) follow the room the screen really has beside the sidebar. */
.shell { flex: 1; display: flex; min-height: 0; }
.shell__main { flex: 1; min-width: 0; container: app / inline-size; }
.side { display: none; }
.screen__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }

.tabs { position: sticky; bottom: 0; z-index: 9; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center;
  padding: 4px max(var(--s1), env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(var(--s1), env(safe-area-inset-left));
  background: var(--surface); border-top: 1px solid var(--line); }
.tabs__tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tap);
  color: var(--muted); text-decoration: none; font: 500 12px/1.2 var(--font-text); border-radius: var(--r); }
.tabs__tab[aria-current="page"] { color: var(--primary); font-weight: 600; }
.tabs__add { justify-self: center; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); }
.tabs__add[aria-current="page"] { outline: 2px solid var(--primary); outline-offset: 2px; }
.tabs a:focus-visible, .side a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* A job's tabs (nav.js JOB_TABS): a strip above the job's screens that scrolls sideways when it is too long. */
.jobtabs { display: flex; gap: 2px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 max(var(--s2), env(safe-area-inset-right)) 0 max(var(--s2), env(safe-area-inset-left)); }
.jobtabs__tab { flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-bottom: 3px solid transparent;
  color: var(--ink); text-decoration: none; font: var(--t-body); white-space: nowrap; }
.jobtabs__tab[aria-current="page"] { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.jobtabs__tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media print { .jobtabs { display: none !important; } }

/* "New" in the app bar is the desktop's "+"; a tab's own landing screen needs no back arrow. */
.appbar__new { display: none; }
.appbar--tab .appbar__back { display: none; }
.appbar--tab .appbar__title { padding-left: var(--s4); }

@media (min-width: 900px) {
  .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 2px; flex: none; width: 232px; box-sizing: border-box; padding: var(--s4) var(--s3);
    background: var(--surface-2); border-right: 1px solid var(--line);
    position: sticky; top: calc(var(--bar) + 3px); align-self: flex-start; height: calc(100dvh - var(--bar) - 3px); overflow-y: auto; }
  .side__group { margin: var(--s4) 0 var(--s1); padding: 0 var(--s3); font: var(--t-label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
  .side__link { display: flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r); color: var(--ink); text-decoration: none; font: var(--t-body); }
  .side__link:hover { background: var(--line); }
  .side__link[aria-current="page"] { background: var(--primary-bg, var(--waiting-bg)); color: var(--primary); font-weight: 600; }
  .appbar__new { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s4); margin-right: var(--s2); border-radius: var(--r);
    background: #4EFFC0; color: #062E1F; font: 600 15px/1 var(--font-text); text-decoration: none; }
  .appbar--landing .appbar__back { display: none; }
  .appbar--landing .appbar__title { padding-left: var(--s4); }
}
@media print { .side, .tabs { display: none !important; } }

/* Customers (2 Dec 2026): a list of things each with its own small form (a name offered from the jobs, a
   person behind a customer). */
.offers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.offers > li + li { border-top: 1px solid var(--line); padding-top: var(--s4); }

/* The price list (3 Dec 2026): a short figure beside a label, and cost codes set in under their parent. */
.input--short { width: 8.5rem; }
.offers > li[data-depth="1"] { padding-left: var(--s4); }
.offers > li[data-depth="2"], .offers > li[data-depth="3"] { padding-left: calc(var(--s4) * 2); }

/* Estimates (3 Dec 2026): quantity, cost and sell side by side; one under another on a narrow phone. */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
@media (max-width: 420px) { .trio { grid-template-columns: 1fr; } }

/* A document printed from its screen (the estimate's client copy, 3 Dec 2026): the screen is the page. A long
   option may run over a page, but a row, the totals and the place to accept are never split. */
.print-only { display: none; }
.doc__keep { display: grid; gap: var(--s3); }
.doc__accept { margin-top: var(--s5); }
.doc__line { display: flex; align-items: flex-end; gap: var(--s3); margin: var(--s5) 0 0; }
.doc__line::after { content: ""; flex: 1; border-bottom: 1px solid var(--line-strong); }
.doc__line span { min-width: 8.5rem; font: var(--t-small); color: var(--muted); }
@media print {
  .print-only { display: block; }
  .doc .card { border: 0; }
  .doc .card__head, .doc .card__body { padding-left: 0; padding-right: 0; }
  .doc .card__head { border-bottom: 2px solid var(--ink); break-after: avoid; }
  .doc .tbl tr, .doc .psums, .doc__keep, .doc__accept { break-inside: avoid; }
  .doc .tbl thead { display: table-header-group; }
  .doc .hint { color: var(--ink); }
}

/* The letterhead and a payment claim (5 Dec 2026, claimdoc.js): the practice's details at the head of a document,
   the claim's statement set apart under its heading, and the notice that goes with a claim on a page of its own. */
.letterhead { display: grid; gap: 2px; padding-bottom: var(--s3); border-bottom: 1px solid var(--line-strong); font: var(--t-small); }
.letterhead p { margin: 0; }
.letterhead__name { font: var(--t-h2, 600 1.25rem/1.3 var(--font-display, inherit)); }
.doc__meta li span:first-child { color: var(--muted); }
.doc__statement { font-weight: 600; margin: 0; }
.doc__attach { margin-top: var(--s5); padding-top: var(--s4); border-top: 2px solid var(--ink); }
.words p { margin: 0 0 var(--s2); }
.words__head { font-weight: 600; margin-top: var(--s3) !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s3); align-items: end; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
@media print {
  .doc__attach { break-before: page; border-top: 0; padding-top: 0; margin-top: 0; }
  .doc__attach p { font-size: 10pt; }
  .letterhead, .doc__statement { break-inside: avoid; }
}

/* The client portal (3 Dec 2026, app/c/index.html): one column, no menu. A choice with its price under it. */
.portal #main { max-width: 720px; margin: 0 auto; width: 100%; }
.portal .check span { display: grid; gap: 2px; }
.portal .check { align-items: flex-start; }
.portal-link { font: var(--t-small); font-family: var(--mono, ui-monospace, monospace); overflow-wrap: anywhere; }

/* Jobs (3 Dec 2026): the lists on a phone, one sortable table where the room beside the sidebar allows. */
.jobs-table { display: none; }
@container app (min-width: 900px) {
  .jobs-lists { display: none; }
  .jobs-table { display: block; }
}
.jobs-table .tbl td, .jobs-table .tbl th { padding: var(--s2) var(--s3); }
.jobs-table .tbl tbody tr:hover { background: var(--surface-2, transparent); }
.jobs-table .tbl a { color: inherit; text-decoration: none; font-weight: 500; }
.jobs-table .tbl a:hover { text-decoration: underline; }
.jobs-table .chip { vertical-align: middle; }
.jobs-table__note { padding: var(--s2) var(--s3); }
.tbl__sort { all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.tbl__sort:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.tbl__sort:hover { text-decoration: underline; }
th[aria-sort="ascending"] .tbl__sort::after { content: " \2191"; }
th[aria-sort="descending"] .tbl__sort::after { content: " \2193"; }

/* Ask (ask.js): what was asked sits to the right on the primary tint, the answer on the surface. */
.ask__thread { gap: var(--s4); }
.ask__q { align-self: flex-end; max-width: 85%; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--waiting-bg); color: var(--ink); }
.ask__q p { margin: 0; overflow-wrap: anywhere; }
.ask__a { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow-wrap: anywhere; }
.ask__a p, .ask__a ul, .ask__a ol { margin: 0; }
.ask__a ul, .ask__a ol { padding-left: var(--s5, 24px); }
.ask__a [data-text] { display: flex; flex-direction: column; gap: var(--s3); }
.ask__a [data-text]:empty, .ask__a [data-status]:empty { display: none; }
.ask__share { margin-top: var(--s4); }
.ask__examples { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ask__examples .btn { text-align: left; height: auto; padding-top: var(--s2); padding-bottom: var(--s2); }

/* A claim's schedule and its paper's "The work" on a phone (5 Dec 2026): the column that is the others'
   difference (claimed, claimed before) gives way and the text tightens, so "To claim" and "This claim" are
   on screen without a swipe. Screen only: paper keeps every column. */
@media screen and (max-width: 480px) {
  .tbl.tbl--claim .col-derived { display: none; }
  .tbl.tbl--claim { font-size: 13px; }
  .tbl.tbl--claim th, .tbl.tbl--claim td { padding: 5px 4px; }
  .tbl.tbl--claim thead th { white-space: normal; }
}
