/*
  Grainwork Contractors. Layout for the contractor app only.

  Colors, type, buttons, cards, status pills and the shared header and footer come from
  /assets/grainwork.css, which index.html loads first. This file lays out the app's own
  screens with those tokens: the signed-out and error pages, the brand-only loading frame,
  and the signed-in work tool (the desk, the project workspace, drawers). Its only colors of
  its own are the chart ramp and the desk tokens in :root; the desk layer at the end of this
  file draws the drafting-sheet look from them.
*/

:root {
  /* Charts. A forest ramp for money someone stands behind, warm taupe for reference prices,
     and ochre for the AI estimate, the one part of a price a contractor still has to check.
     Every bar has a legend that names each part in dollars, so color is never the only cue.
     Checked with the dataviz palette validator: adjacent parts differ by at least ΔE 18. */
  --chart-verified-vendor-quote: var(--forest-deep);
  --chart-project-supplier-price-selection: #5f8f71;
  --chart-contractor-rate-book: #a9c6b1;
  --chart-curated-listing: #8a8170;
  /* A retail price found on the web: a reference, in its own slate so it never reads as a quote. */
  --chart-web-price: #6f8f96;
  --chart-public-wage-derived: #d6cdb9;
  --chart-model-allowance: #b07d1e;
  --stack-material: var(--forest-deep);
  --stack-labor: #5f8f71;
  --stack-other: #a9c6b1;
  --stack-tax: #8a8170;
  --stack-overhead: #d6cdb9;
  --stack-profit: #a88a4a;
  --stack-scope: #a9c6b1;

  --app-header-height: 64px;
  --mobile-nav-height: 64px;

  /* The desk: Grainwork's forest as the drafting pane, bone paper as the sheet. Every color the
     desk layer uses is here, checked for AA contrast against the surface it sits on. */
  --desk-pane: var(--forest-deep);
  --desk-pane-edge: rgba(0, 0, 0, 0.28);
  --desk-pane-ink: var(--on-dark);
  --desk-pane-muted: var(--on-dark-muted);
  --desk-pane-accent: #a9c6b1;
  --desk-pane-alert: #e4c07a;
  --desk-pane-rule: rgba(244, 239, 228, 0.16);
  --desk-pane-grid: rgba(244, 239, 228, 0.045);
  --desk-pane-hover: rgba(244, 239, 228, 0.06);
  --desk-pane-active: rgba(244, 239, 228, 0.11);
  --desk-pane-field: rgba(0, 0, 0, 0.18);
  --desk-sheet: var(--paper);
  --desk-grid-minor: rgba(47, 93, 67, 0.045);
  --desk-grid-major: rgba(47, 93, 67, 0.085);
  --desk-plate: var(--paper-raised);
  --desk-phase: color-mix(in srgb, var(--kraft) 45%, var(--paper-raised));
  --desk-row-hover: color-mix(in srgb, var(--kraft) 35%, var(--paper-raised));
  --desk-phonebar: rgba(249, 245, 237, 0.96);
  --desk-rule: var(--line-strong);
  --desk-rule-soft: var(--line);
  --desk-annotation: var(--faint);
  --desk-dim: var(--accent);
  --desk-ink-tick: var(--line-control);
  --desk-radius: 3px;
  --desk-pane-width: 264px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Which frame a screen uses. index.html carries the shared site header and footer; they show
   only on the signed-out, no-access and error pages (body[data-chrome="site"]). */
body:not([data-chrome="site"]) > :is(.skip-link, .site-header, .site-footer) { display: none; }
body[data-chrome="app"] { background: var(--paper); }
.noscript { padding-block: 48px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.tabular, .metric strong, .estimate-row strong, .estimate-range, .estimate-phase strong, .price-range, .provenance-row > strong, .supplier-row > strong, .verified-share strong, .needs-quote-card strong, .ai-estimate-card strong, .chart-value, .chart-legend-value, .chart-legend-share { font-variant-numeric: tabular-nums; }

/* Buttons. .button (filled) and .button--secondary come from grainwork.css; the app marks its
   one loud button with .button-primary so a screen can demote any other. */
.button:disabled, .button[aria-disabled="true"] { cursor: wait; opacity: 0.55; }
.button--secondary:disabled:hover { background: transparent; color: var(--accent); border-color: var(--line-control); }
.button--quiet { background: transparent; border-color: transparent; color: var(--accent); }
.button--quiet:hover { background: var(--accent-wash); border-color: transparent; color: var(--accent-hover); }
.text-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 var(--text-small)/1.3 var(--sans);
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.text-button:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.text-button:disabled, .text-button[aria-disabled="true"] { cursor: wait; opacity: 0.55; }

/* Text helpers the app shares with grainwork.css's .muted and .caption. */
.muted-small { font-size: var(--text-caption); line-height: 1.5; color: var(--muted); }
.source-note { font-size: var(--text-caption); line-height: 1.5; color: var(--faint); }
.form-status { margin: 0; font-size: var(--text-small); line-height: 1.5; color: var(--brick); }
.form-status:empty { display: none; }
.form-status-neutral { color: var(--muted); }
.error { color: var(--brick); font-size: var(--text-small); }

/* ------------------------------------------------------------------ site pages */

/* Sign-in, shared-project sign-in, no access and error screens: members of grainwork.app. */
.gw-page { padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 8vw, 112px); }
.gw-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.gw-page__grid--single { grid-template-columns: minmax(0, 44rem); }
.gw-page h1 { max-width: 16em; }
.gw-page .lede { margin-top: 24px; }
.gw-page .lede strong { color: var(--ink); overflow-wrap: anywhere; }
.gw-page .lede + p { margin-top: 16px; max-width: var(--max-text); color: var(--muted); }
.gw-page .actions .form-status { flex-basis: 100%; }
.gw-page .actions .form-status-neutral { color: var(--muted); }
.gw-page__after { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); max-width: var(--max-text); }
.gw-page__after p { color: var(--muted); font-size: var(--text-small); }

.pilot-card { gap: 16px; }
.pilot-card > .status { align-self: flex-start; }
.pilot-card .pilot-card__amount { display: block; font: 560 clamp(2.75rem, 2.2rem + 2vw, 3.5rem)/1 var(--serif); letter-spacing: -0.03em; color: var(--heading); }
.pilot-card .pilot-card__amount small { display: block; margin-top: 8px; font: 600 var(--text-h4)/1.35 var(--sans); letter-spacing: 0; color: var(--ink); }
.pilot-card ul { margin: 0; padding: 0; list-style: none; }
.pilot-card li { padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-small); }
.pilot-card .actions { margin-top: 8px; }

/* ------------------------------------------------------------------ loading frame */

.loading-screen {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px var(--gutter);
  text-align: center;
}
.loading-home { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; color: var(--muted); text-decoration: none; }
.loading-home img { width: 132px; height: auto; }
.loading-home span { padding-left: 14px; border-left: 1px solid var(--line-strong); font: 600 var(--text-small)/20px var(--sans); color: var(--muted); }
.loading-message { max-width: 30rem; margin-top: 24px; color: var(--muted); }
.loading-message::before {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  margin: 0 auto 20px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 50% 100% no-repeat, var(--line);
  animation: loading-sweep 1.4s ease-in-out infinite;
}
@keyframes loading-sweep { from { background-position: -60px 0, 0 0; } to { background-position: 180px 0, 0 0; } }

.mobile-nav { display: none; }
.nav-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; border: 1.5px solid currentColor; border-radius: 5px; }
.nav-icon-capture::before { content: "+"; position: absolute; inset: -3px 0 0; text-align: center; font-weight: 600; font-size: 15px; }
.nav-icon-estimate::before { content: "$"; position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 700; line-height: 15px; }
.nav-icon-plan { border-radius: 50%; }
.nav-icon-plan::after { content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(35deg); }
.nav-icon-work { border-radius: 3px; transform: rotate(45deg) scale(0.8); }
.nav-icon-record::before { content: ""; position: absolute; left: 4px; top: 4px; width: 7px; height: 1.5px; background: currentColor; box-shadow: 0 3px currentColor, 0 6px currentColor; }
.nav-icon-overview::before { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; background: currentColor; box-shadow: 6px 0 currentColor, 0 6px currentColor, 6px 6px currentColor; }

/* Start a project: the job address and, optionally, the request. Inline on the desk. */
.start-form { display: grid; gap: 10px; }
.start-field { display: flex; flex-direction: column; gap: 8px; font-size: var(--text-small); font-weight: 600; color: var(--ink); }
.start-field small { color: var(--muted); font-weight: 400; }
.start-field textarea { min-height: 72px; resize: vertical; }
/* The label is bold; what the contractor types (and the placeholder) is not. */
:is(.start-field, .job-edit-field) :is(input, textarea), .scope-answer-field input { font-weight: 400; }
.start-address-read { margin: -2px 0 4px; }
.start-address-read--ok { color: var(--accent); font-weight: 600; }
.start-form .actions { margin-top: 4px; }
.start-known { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.start-known-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* New project form (a dialog). */
.create-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(24, 59, 49, 0.36); }
.create-form { position: relative; display: flex; flex-direction: column; gap: 18px; width: min(560px, 100%); max-height: calc(100dvh - 32px); padding: clamp(24px, 4vw, 36px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: var(--shadow); }
.create-form h2 { font-size: var(--text-h3); }
.create-form .eyebrow { margin: 0; }

/* ------------------------------------------------------------------ forms */

:is(.create-form, .drawer) label:not(.evidence-choice):not(.supplier-quote-option) { display: flex; flex-direction: column; gap: 8px; font-size: var(--text-small); font-weight: 600; color: var(--ink); }
/* :where keeps these at zero specificity, so a wrapper such as .currency-input can restyle its field. */
:where(.create-form, .drawer, .workspace-main, .start-card, .capture-address-step) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink);
  font: 400 var(--text-body)/1.4 var(--sans);
}
:where(.create-form, .drawer) textarea { min-height: 96px; resize: vertical; }
:where(.create-form, .drawer, .workspace-main, .start-card, .capture-address-step) :where(input, select, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
:where(.create-form, .drawer, .workspace-main, .start-card, .capture-address-step) :where(input, textarea)::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.currency-input, .percent-input { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-control); border-radius: var(--radius-sm); background: var(--paper-raised); }
.currency-input > span, .percent-input > span { color: var(--muted); font-weight: 600; }
:is(.drawer, .create-form) :is(.currency-input, .percent-input) input { min-height: 46px; padding: 0; border: 0; background: transparent; }
:is(.currency-input, .percent-input):focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
:is(.currency-input, .percent-input) input:focus-visible { outline: 0; }
.percent-input { max-width: 200px; }

/* ------------------------------------------------------------------ workspace */

.app-shell { min-height: 100vh; }
.workspace-main { font-size: 1rem; }
.workspace-main .eyebrow, .drawer .eyebrow { margin: 0; }
.workspace-main .card, .drawer .card { gap: 12px; padding: clamp(20px, 2.4vw, 28px); border-radius: var(--radius); }
.workspace-main .card h2 { font-size: 1.375rem; line-height: 1.25; }
.workspace-main .button, .drawer .button, .sync-notice .button { min-height: 44px; padding: 0 18px; font-size: var(--text-small); }
.workspace-main .card p, .drawer p { text-wrap: pretty; }
.workspace-main .card > .button, .drawer-body > .button, .drawer-body > section > .button { align-self: flex-start; }
.inline-actions, .page-actions, .drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page { display: flex; flex-direction: column; gap: 16px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 8px; }
.page-header > div:first-child { max-width: 44rem; }
.page-header h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); }
.page-description { margin-top: 8px; color: var(--muted); }
.page-actions { justify-content: flex-end; }

.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric-label { color: var(--faint); font: 600 var(--text-eyebrow)/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.metric strong { overflow-wrap: anywhere; font-size: var(--text-body); font-weight: 600; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.compact-list { display: grid; gap: 6px; margin: 0; padding-left: 1.2em; color: var(--muted); font-size: var(--text-small); }
.phase-pill, .status-chip, .confidence, .count-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--kraft);
  color: var(--muted);
  font: 600 var(--text-eyebrow)/1.25 var(--sans);
  white-space: nowrap;
}
.count-badge { background: var(--accent-wash); color: var(--accent); }

/* Notices across the top of a view: something to review, or something that failed. */
.sync-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ochre);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.sync-notice-error { border-left-color: var(--brick); }
.sync-notice > div:first-child, .sync-notice > strong + p { flex: 1 1 28rem; }
.sync-notice strong { display: block; margin: 2px 0; }
.sync-notice p { margin: 0; max-width: 46rem; }

/* Today */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; }
.price-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 4px 0 4px; }
.price-range strong { font: 560 clamp(2rem, 1.6rem + 1.4vw, 2.625rem)/1.05 var(--serif); letter-spacing: -0.02em; color: var(--heading); white-space: nowrap; }
.price-range .muted { font-size: var(--text-small); }
.next-card { border-color: var(--line-strong); }
.next-card h2 { font-size: var(--text-h3); }
.next-card .inline-actions { margin-top: 4px; }
.consideration-preview { border-top: 1px solid var(--line); }
.suggestion-row {
  appearance: none;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-small);
  text-align: left;
  cursor: pointer;
}
.suggestion-row:hover { color: var(--accent); }
.suggestion-severity { width: 8px; height: 8px; border-radius: 50%; background: var(--line-control); }
.severity-risk { background: var(--ochre); }
.severity-safety { background: var(--brick); }
.chevron { color: var(--faint); font-size: 1.25rem; line-height: 1; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: var(--kraft); }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.status-list { display: grid; gap: 10px; }
.status-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--text-small); }
.status-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 50%; color: var(--on-accent); font-size: 12px; line-height: 1; }
.status-complete { border-color: var(--accent); background: var(--accent); }

/* Capture */
.capture-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: clamp(24px, 3vw, 36px); border: 1.5px dashed var(--line-control); border-radius: var(--radius-lg); background: var(--paper-raised); }
.capture-zone h2 { font-size: var(--text-h3); }
.capture-destination-step, .capture-address-step { display: grid; gap: 12px; width: 100%; min-width: 0; }
.capture-destination-step .button, .capture-address-step .button, .capture-selection { white-space: normal; overflow-wrap: anywhere; }
.capture-zone p { max-width: 40rem; color: var(--muted); }
.capture-icon { display: none; }
.upload-list { display: grid; gap: 8px; width: min(640px, 100%); margin-top: 8px; }
.upload-row { display: grid; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.upload-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.upload-row-head strong { overflow: hidden; font-size: var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.upload-progress { height: 6px; overflow: hidden; border-radius: 99px; background: var(--kraft); }
.upload-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.15s linear; }
.upload-failed { border-color: var(--brick); }
.upload-failed .upload-row-head .muted-small { color: var(--brick); }
.upload-verified { border-color: var(--accent); }
.media-heading { margin-top: 12px; font-size: 1.25rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }

/* A room saved to this project from a phone scan, drawn from its surfaces. Evidence to look
   at, never a quantity. */
.saved-room { gap: 10px; }
.saved-room-error { border-left: 3px solid var(--brick); }
.saved-room-error > .button { align-self: flex-start; }
.saved-room-frame { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.saved-room-canvas { display: block; width: 100%; height: clamp(240px, 34vw, 380px); cursor: grab; touch-action: none; }
.saved-room-canvas:active { cursor: grabbing; }
.saved-room-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.saved-room-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; padding: 0 16px; border-top: 1px solid var(--line); }
.saved-room-caption { color: var(--muted); font-size: var(--text-caption); }
.saved-room-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-room-choice { appearance: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-control); border-radius: 999px; background: var(--paper-raised); color: var(--accent); font: 600 var(--text-small)/1 var(--sans); cursor: pointer; }
.saved-room-choice:hover { border-color: var(--accent); }
.saved-room-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.saved-room-choice:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.media-tile { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.media-tile img, .media-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-placeholder { display: grid; place-items: center; background: var(--kraft); color: var(--muted); font-size: var(--text-caption); font-weight: 600; }
.media-placeholder-loading { animation: pulse 1.1s ease-in-out infinite alternate; }
.media-placeholder-failed { gap: 4px; align-content: center; }
.media-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px 14px; font-size: var(--text-small); }
.media-meta strong { overflow-wrap: anywhere; }
.verification { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--kraft); color: var(--muted); font: 600 var(--text-eyebrow)/1.25 var(--sans); }
.verification-verified { background: var(--accent-wash); color: var(--accent); }
.verification-uploading, .verification-verifying { background: var(--ochre-wash); color: var(--ochre-text); }

/* Estimate */
.estimate-evidence { gap: 8px; }
.estimate-evidence > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; min-height: 44px; cursor: pointer; list-style: none; }
.estimate-evidence > summary::-webkit-details-marker { display: none; }
.estimate-evidence > summary::after { content: "Choose"; color: var(--accent); font-weight: 600; font-size: var(--text-small); text-decoration: underline; text-underline-offset: 0.22em; }
.estimate-evidence[open] > summary::after { content: "Done"; }
.evidence-choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--text-small); cursor: pointer; }
.evidence-choice > span { display: flex; flex-direction: column; gap: 2px; }
.evidence-choice small { color: var(--muted); }
.scope-support-boundary { border-left: 3px solid var(--ochre); }
.scope-support-checklist { display: grid; gap: 6px; margin: 0; padding-left: 1.2em; color: var(--ink); font-size: var(--text-small); }
.scope-support-boundary .button { align-self: flex-start; }
.estimate-stale { border-left-color: var(--ochre); }

/* The job on Today: address, the contractor's own words (editable in place) and, once, what
   Grainwork prices about it. */
.job-card { gap: 8px; }
.job-address { color: var(--ink); font-weight: 600; }
.job-request { color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.job-request.muted { color: var(--muted); }
.job-understood { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: var(--ink); font-size: var(--text-small); line-height: 1.5; }
.job-understood li { padding-left: 2px; overflow-wrap: anywhere; }
.job-edit { display: grid; gap: 10px; }
.job-edit-field { display: flex; flex-direction: column; gap: 8px; font-size: var(--text-small); font-weight: 600; color: var(--ink); }
.job-edit-field textarea { min-height: 96px; resize: vertical; }
.job-support { display: grid; gap: 4px; margin-top: 6px; padding: 12px 16px; border-left: 3px solid var(--ochre); border-radius: var(--radius-sm); background: var(--ochre-wash); }
.job-support-evidence { border-left-color: var(--accent); background: var(--accent-wash); }
.job-support p { margin: 0; color: var(--ink); font-size: var(--text-small); }

/* Open questions on the estimate, each answered in place. */
.open-questions { gap: 10px; border-left: 3px solid var(--ochre); }
.open-questions h2 { font-size: var(--text-h3); }
.open-question-list { display: grid; }
.more-open-questions { border-top: 1px solid var(--line); }
.more-open-questions > summary { padding: 14px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.more-open-questions > summary:hover { text-decoration: underline; }
.open-question { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.open-question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.open-question-kind { background: var(--ochre-wash); color: var(--ochre-text); }
.open-question-answered .open-question-kind { background: var(--accent-wash); color: var(--accent); }
.open-question > p { margin: 0; color: var(--ink); }
.open-question-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.open-question-saved .scope-saved-answer { flex: 1 1 20rem; margin: 0; }
.open-question .button--small { justify-self: start; }
.scope-answer-form { display: grid; gap: 6px; }
.scope-answer-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workspace-main .scope-answer-field input { flex: 1 1 16rem; width: auto; min-width: min(16rem, 100%); max-width: 34rem; }
.media-placeholder-note { gap: 2px; align-content: center; padding: 8px; text-align: center; }
.media-placeholder-note small { color: var(--muted); font-weight: 400; }
.scope-answer-field .button { min-height: 48px; }
.open-question-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.open-question-footer p { flex: 1 1 20rem; margin: 0; }

/* The whole requested job, including work not priced yet, and the questions that stand between
   it and a price. Shown on the estimate and on the shared review. */
.scope-decisions { gap: 12px; }
.scope-original-request { color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.scope-outcomes { display: grid; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.scope-outcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scope-outcome > strong { font-size: var(--text-small); font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.scope-outcome > small { grid-column: 1 / -1; }
.scope-outcome-status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 10px; border-radius: 999px; background: var(--ochre-wash); color: var(--ochre-text); font: 600 var(--text-eyebrow)/1.25 var(--sans); white-space: nowrap; }
.scope-outcome-represented .scope-outcome-status { background: var(--accent-wash); color: var(--accent); }
.scope-pending-price-note { padding: 12px 16px; border-left: 3px solid var(--ochre); border-radius: var(--radius-sm); background: var(--ochre-wash); color: var(--ink); font-size: var(--text-small); }
.scope-decisions > h3 { margin-top: 8px; font: 600 var(--text-h4)/1.35 var(--sans); color: var(--ink); }
.scope-question { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.scope-question > p { margin: 0; }
.scope-question-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.scope-saved-answer { padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--paper); font-size: var(--text-small); overflow-wrap: anywhere; white-space: pre-wrap; }
.scope-question > .button { justify-self: start; }
.scope-answer-form textarea { min-height: 120px; }
.job-payment { gap: 8px; }
.job-payment > .button, .job-payment > .inline-actions { align-self: flex-start; }
.job-payment strong { font-size: var(--text-h4); }
.job-payment p { max-width: 44rem; }
.job-payment-unpaid, .job-payment-support { border-left: 3px solid var(--ochre); }
.job-payment-unknown { border-left: 3px solid var(--line-control); }
.job-payment-paid { border-left: 3px solid var(--accent); }
.job-payment-loading { border-style: dashed; }
.pricing-setup { gap: 4px; }
.pricing-setup > strong { font-size: var(--text-h4); }
.pricing-setup-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.pricing-setup-row > span { display: flex; flex: 1 1 22rem; flex-direction: column; gap: 2px; }
.pricing-setup-row small { color: var(--muted); font-size: var(--text-caption); line-height: 1.5; }
.rate-basis-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.labor-rate-row .rate-basis-note { margin: 0 0 10px; }

.estimate-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); overflow: hidden; }
.estimate-strip .metric { padding: 16px 20px; border-right: 1px solid var(--line); }
.estimate-strip .metric:last-child { border-right: 0; }
.estimate-strip .metric strong { font: 560 1.375rem/1.2 var(--serif); color: var(--heading); }
.verified-share > strong { font-size: var(--text-h4); line-height: 1.4; }
.verified-share-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: var(--text-small); }
.verified-share-ai strong { color: var(--ink); }
.supplier-availability { color: var(--muted); font-size: var(--text-small); }

.estimate-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 8px; }
.workspace-main .estimate-search { flex: 1 1 280px; width: auto; min-width: min(280px, 100%); min-height: 44px; border-radius: 999px; padding: 0 18px; font-size: var(--text-small); }
.estimate-filter-row { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.estimate-filter {
  appearance: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--muted);
  font: 500 var(--text-caption)/1.2 var(--sans);
  cursor: pointer;
}
.estimate-filter:hover { border-color: var(--line-control); color: var(--ink); }
.estimate-filter-active { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); font-weight: 600; }

.chart { margin: 0; }
.chart-canvas { display: block; width: 100%; overflow: hidden; border-radius: 3px; }
.chart-composition .chart-canvas rect, .chart-price-stack .chart-canvas rect { stroke: var(--paper-raised); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.chart-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 24px; margin-top: 12px; }
.chart-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; font-size: var(--text-caption); }
.chart-swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend-label { color: var(--muted); overflow-wrap: anywhere; }
.chart-legend-value { color: var(--ink); font-weight: 600; }
.chart-legend-share { color: var(--faint); }
.chart-waterfall { padding: clamp(20px, 2.4vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.chart-waterfall figcaption { margin-bottom: 12px; }
.chart-rows { display: grid; gap: 8px; }
.chart-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) minmax(80px, auto); gap: 16px; align-items: center; font-size: var(--text-small); }
.chart-row .chart-label { color: var(--muted); line-height: 1.35; overflow-wrap: break-word; }
.chart-row .chart-value { text-align: right; }
.chart-row-total { padding-top: 10px; border-top: 1px solid var(--line); }
.chart-row-total :is(.chart-label, .chart-value) { color: var(--ink); font-weight: 600; }
.phase-share { display: grid; grid-template-columns: 64px auto; gap: 8px; align-items: center; }
.phase-share-value { color: var(--muted); font-size: var(--text-caption); }

.estimate-table { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.estimate-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(88px, 0.65fr)) 28px;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-small);
  text-align: left;
}
.estimate-header { min-height: 44px; padding-block: 10px; background: var(--paper); color: var(--faint); font: 600 var(--text-eyebrow)/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.estimate-phase { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.estimate-phase > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.estimate-phase > span:first-child > strong { font: 560 1.125rem/1.3 var(--serif); color: var(--heading); }
.estimate-phase small { color: var(--muted); font-size: var(--text-caption); }
.estimate-line { border-bottom: 1px solid var(--line); }
.estimate-line .estimate-row { border-bottom: 0; }
.estimate-item { cursor: pointer; transition: background-color 0.12s ease; }
.estimate-item:hover, .estimate-line-expanded { background: var(--paper); }
.estimate-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.estimate-name strong { font-size: var(--text-body); font-weight: 600; }
.estimate-name small:not(.ai-estimate-chip):not(.estimate-provenance) { color: var(--muted); font-size: var(--text-caption); }
.estimate-range { color: var(--muted); font-size: var(--text-caption); }
.estimate-unpriced { color: var(--ochre-text); font-weight: 600; }
.estimate-provenance, .ai-estimate-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  overflow: hidden;
  border-radius: 999px;
  font: 600 var(--text-eyebrow)/1.3 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.estimate-provenance-verified { background: var(--accent-wash); color: var(--accent); }
.estimate-provenance-open, .ai-estimate-chip { background: var(--ochre-wash); color: var(--ochre-text); }
.estimate-ai-estimate, .estimate-needs-quote { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 0 20px 10px; color: var(--muted); font-size: var(--text-caption); line-height: 1.45; }
.estimate-ai-estimate-copy { flex: 1 0 100%; }
.estimate-inline-detail { display: grid; grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.5fr); gap: 16px 24px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.estimate-math { display: flex; flex-direction: column; gap: 6px; }
.estimate-math span { color: var(--muted); font-size: var(--text-caption); line-height: 1.45; overflow-wrap: anywhere; }
.estimate-costs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.estimate-inline-detail > :is(.defend-line, .provenance-list, .source-note) { grid-column: 1 / -1; }
.estimate-inline-detail > .button { justify-self: start; }
.defend-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--paper-raised); }
.defend-line .eyebrow { grid-column: 1; }
.defend-line-sentence { grid-column: 1; font-size: var(--text-small); }
.defend-line .text-button { grid-column: 2; grid-row: 1 / span 2; }
.estimate-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 28px 20px; }
.estimate-total { background: var(--paper); font-weight: 600; border-top: 1px solid var(--line-strong); }

.provenance-list { display: flex; flex-direction: column; }
.provenance-list .eyebrow { margin-bottom: 6px; }
.provenance-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.provenance-row > span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.provenance-row > span > strong { font-size: var(--text-small); }
.provenance-row > strong { flex: 0 0 auto; font-size: var(--text-small); }
.provenance-source { font-size: var(--text-caption); font-weight: 600; }
.provenance-source.provenance-verified { color: var(--accent); }
.provenance-source.provenance-open { color: var(--ochre-text); }
.provenance-detail { color: var(--muted); font-size: var(--text-caption); line-height: 1.45; }
.provenance-allowance { color: var(--ochre-text); font-size: var(--text-caption); line-height: 1.45; }

/* Plan, work and record */
.delivery-operations { gap: 14px; }
.delivery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.delivery-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.delivery-card > strong { font-size: var(--text-h4); }
.delivery-card > h2 { font-size: var(--text-h4) !important; font-family: var(--sans); font-weight: 600; color: var(--ink); }
.delivery-card details { width: 100%; font-size: var(--text-small); }
.delivery-card summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; }
.delivery-list { display: grid; width: 100%; gap: 6px; }
.delivery-status { overflow: hidden; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--kraft); color: var(--ink); font-size: var(--text-caption); text-overflow: ellipsis; white-space: nowrap; }
.delivery-status-received, .delivery-status-ready_for_install { background: var(--accent-wash); color: var(--accent); }
.delivery-status-backordered, .delivery-status-cancelled, .delivery-status-returned { background: var(--ochre-wash); color: var(--ochre-text); }

.plan-timeline { display: grid; gap: 10px; }
.plan-step { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.step-number { display: grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 560 0.9375rem/1 var(--serif); }
.plan-complete .step-number { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.step-copy h2 { margin-top: 2px; font-size: 1.125rem !important; line-height: 1.3; }
.step-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; color: var(--muted); font-size: var(--text-caption); }
.step-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.step-dependencies { display: block; margin-top: 4px; color: var(--muted); font-size: var(--text-caption); }
/* What the estimate is still unsure of, in front of the plan before anyone orders against it. */
.plan-uncertainty .metric-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.uncertainty-list { gap: 8px; }
.uncertainty-list > p { margin: 0; padding-left: 12px; border-left: 2px solid var(--ochre); }

.active-work-card { gap: 14px; border-left: 3px solid var(--accent); }
.work-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: var(--text-small); }
.completion-ready { border-left: 3px solid var(--accent); }

.record-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 16px; align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
.record-timeline { display: flex; flex-direction: column; margin-top: 8px; }
.record-event { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 16px; padding: 0 0 22px; }
.record-event:not(:last-child) { background: linear-gradient(var(--line-strong), var(--line-strong)) 7px 16px / 1.5px calc(100% - 4px) no-repeat; }
.record-event strong { display: block; }
.record-event p { margin: 2px 0; color: var(--muted); font-size: var(--text-small); }
.record-dot { width: 16px; height: 16px; margin-top: 3px; border: 4px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.record-dot--change { background: var(--ochre); box-shadow: 0 0 0 1px var(--ochre); }
.record-dot--completion { background: var(--forest-deep); box-shadow: 0 0 0 1px var(--forest-deep); }
.record-dot--event { background: var(--paper-raised); box-shadow: 0 0 0 1.5px var(--line-control); }

/* A project someone shared with a homeowner or agent */
.page-customer-review .customer-price-summary h2 { font: 560 clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem)/1.1 var(--serif); }
.page-customer-review .card > .card { margin: 4px 0; background: var(--paper); }
.page-customer-review > .button { align-self: flex-start; }
.page-customer-review h4 { margin-top: 4px; font-size: var(--text-small); }

/* ------------------------------------------------------------------ drawers */

.drawer-layer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(24, 59, 49, 0.36); cursor: default; }
.drawer {
  position: relative;
  z-index: 1;
  width: min(560px, 94vw);
  height: 100%;
  padding: 28px clamp(20px, 3vw, 36px) 40px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--paper-raised);
  box-shadow: -24px 0 48px -24px rgba(38, 36, 31, 0.3);
  font-size: 1rem;
  animation: drawer-in 0.18s ease-out;
}
.drawer-close {
  appearance: none;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-control);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}
.drawer-close:hover { border-color: var(--accent); color: var(--accent); }
.drawer-body { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; }
.drawer-body > h2 { max-width: 20em; padding-right: 48px; font-size: var(--text-h3); }
.drawer-body h3 { margin-top: 10px; font: 600 var(--text-h4)/1.35 var(--sans); color: var(--ink); }
.drawer-lead { color: var(--muted); }
.drawer-list { border-top: 1px solid var(--line); }
.drawer-actions { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-metrics, .drawer-costs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.drawer-metrics { padding: 16px; border-radius: var(--radius-sm); background: var(--paper); }
.drawer-costs .metric { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.drawer-math { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-sm); background: var(--paper); }
.drawer-math strong { font: 560 1.375rem/1.2 var(--serif); color: var(--heading); }
.drawer-math :is(span, small) { color: var(--muted); font-size: var(--text-small); }
.impact-card, .progress-requirements, .ai-estimate-card, .needs-quote-card, .supplier-unavailable {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}
:is(.ai-estimate-card, .needs-quote-card, .impact-card) { border-left: 3px solid var(--ochre); background: var(--ochre-wash); }
:is(.ai-estimate-card, .needs-quote-card) > strong { font: 560 1.5rem/1.2 var(--serif); color: var(--heading); }
.supplier-unavailable span { color: var(--muted); font-size: var(--text-small); }
.stop-card { padding: 16px; border-left: 3px solid var(--brick); border-radius: var(--radius-sm); background: var(--paper); }
.stop-card .compact-list { margin-top: 8px; color: var(--ink); }
.walkthrough-section { padding-top: 12px; border-top: 1px solid var(--line); }
.supplier-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.supplier-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.supplier-row > span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.supplier-row small { color: var(--muted); font-size: var(--text-caption); line-height: 1.4; }
a.supplier-row:hover strong:first-child { color: var(--accent); }
.evidence-picker { display: flex; flex-direction: column; margin: 0; padding: 0; border: 0; }
.evidence-picker legend { margin-bottom: 4px; padding: 0; font-weight: 600; font-size: var(--text-small); }
.evidence-picker > p { padding: 8px 0; }
.evidence-picker .progress-field { padding: 10px 0; border-top: 1px solid var(--line); }
.progress-field small { color: var(--muted); font-weight: 400; font-size: var(--text-caption); }
.labor-rate-list, .rate-book-list, .pricing-policy-list, .procurement-plan-list { display: grid; gap: 4px; }
:is(.labor-rate-row, .rate-book-row, .procurement-plan-row) { margin: 0; padding: 14px 0; border: 0; border-top: 1px solid var(--line); }
:is(.labor-rate-row, .rate-book-row, .procurement-plan-row) legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-weight: 600; }
.labor-rate-inputs, .rate-book-fields { clear: both; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rate-book-fields { display: flex; flex-wrap: wrap; }
.rate-book-field { display: flex; flex: 1 1 140px; flex-direction: column; gap: 6px; min-width: 0; }
.rate-book-field[hidden] { display: none; }
:is(.labor-rate-field, .rate-book-field) { font-size: var(--text-caption) !important; color: var(--muted) !important; }
.pricing-policy-field { display: grid; gap: 6px; }
.closeout-punch-list { display: grid; gap: 12px; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.closeout-punch-list > legend { float: left; width: 100%; padding: 0; font-weight: 600; }
.closeout-punch-rows { display: grid; gap: 12px; }
.closeout-punch-row { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.job-cost-form .currency-input input { text-align: left; }

/* The ordering plan, prepared from the accepted scope: what is ready to order, what needs
   nothing, and one question per material nobody has priced. */
.procurement-required-by { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); }
/* A label that wraps to two lines must not push its number below the others. */
.procurement-summary .metric { justify-content: space-between; }
.procurement-group { display: grid; gap: 10px; margin-top: 8px; }
.procurement-group > .muted-small { margin: 0; }
.procurement-order { gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.procurement-order-label { font-size: var(--text-small); font-weight: 600; overflow-wrap: anywhere; }
.procurement-order-quantity { font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.procurement-band { display: block; color: var(--ochre-text); font-size: var(--text-caption); line-height: 1.45; }
.procurement-open-row > :not(legend) { clear: both; }
.procurement-open-known { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); }
.procurement-open-requirement { display: grid; gap: 8px; padding-top: 12px; }
.procurement-open-requirement + .procurement-open-requirement { border-top: 1px solid var(--line); }
.procurement-open-requirement > .muted-small { margin: 0; }
.procurement-open-material { font-weight: 600; }
/* A field the answer has not called for is out of the way, not greyed in the way. The drawer's
   label rule would otherwise beat the hidden attribute. */
.procurement-open-requirement .progress-field[hidden] { display: none; }
.delivery-status-not_ordered { border: 1px solid var(--line); background: var(--paper); color: var(--muted); }

/* Supplier quotes: a decision desk with one price per material. */
.drawer.supplier-prices-drawer { width: min(940px, 96vw); animation: none; }
.supplier-review-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 0 12px; border-bottom: 1px solid var(--line-strong); }
.supplier-review-heading > strong { font-size: var(--text-h4); }
.supplier-adoption-banner { padding: 16px 20px; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--paper); }
.supplier-adoption-banner > strong { display: block; }
.supplier-adoption-banner > p { margin-top: 4px; }
.supplier-source-history > summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; }
.supplier-saved-quote { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.supplier-product-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.supplier-material { min-width: 0; margin: 0; padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); }
.supplier-material > legend { float: left; width: 100%; margin-bottom: 6px; padding: 0; font: 560 1.25rem/1.3 var(--serif); color: var(--heading); }
.supplier-material-head { clear: both; display: grid; gap: 4px; margin-bottom: 12px; }
.supplier-material-quantity { color: var(--muted); font-size: var(--text-small); }
.supplier-quote-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 14px; align-items: start; margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-raised); cursor: pointer; font-size: var(--text-small); }
.supplier-quote-option:hover:not(.is-unavailable) { border-color: var(--line-control); }
.supplier-quote-option:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.supplier-quote-option.is-selected { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); background: var(--paper); }
.supplier-quote-option.is-unavailable { background: var(--paper); cursor: default; }
.supplier-option-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.supplier-option-copy > strong { font-size: var(--text-body); }
.supplier-option-copy > span:empty { display: none; }
.supplier-package-math { font-variant-numeric: tabular-nums; }
.supplier-option-price { display: grid; gap: 4px; text-align: right; }
.supplier-option-total { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.supplier-keep-current .supplier-option-total { color: var(--muted); }
.supplier-quote-note, .supplier-review-notice { color: var(--muted); font-size: var(--text-caption); line-height: 1.5; }
.supplier-quote-blocked { color: var(--brick); font-size: var(--text-caption); }
.supplier-review-status { font-size: var(--text-small); }
.supplier-review-status:empty { display: none; }
.supplier-review-footer { position: sticky; bottom: -40px; z-index: 1; margin: 0 -12px -40px; padding: 20px 12px 32px; border-top: 1px solid var(--line-strong); background: var(--paper-raised); }
.supplier-review-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; margin-bottom: 10px; }
.supplier-review-totals > span:nth-child(2) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.supplier-review-totals > span:last-child { grid-column: 1 / -1; }
.supplier-review-footer [hidden] { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: min(36rem, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--forest-deep);
  color: var(--on-dark);
  font-size: var(--text-small);
  box-shadow: var(--shadow);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.toast-visible { transform: translate(-50%, 0); opacity: 1; }

@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.7; } to { transform: none; opacity: 1; } }
@keyframes drawer-up { from { transform: translateY(24px); opacity: 0.7; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ narrower screens */


@media (max-width: 860px) {
  .gw-page__grid { grid-template-columns: minmax(0, 1fr); }
  .pilot-card { max-width: 36rem; }
}

@media (max-width: 760px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .page-actions .button { flex: 1 1 100%; }
  .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scope-outcome { grid-template-columns: minmax(0, 1fr); }
  .procurement-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  /* On a phone the next step comes before the numbers. */
  .overview-grid .next-card { order: -1; }
  .status-row { grid-template-columns: 22px minmax(0, 1fr); }
  .status-row .muted-small { grid-column: 2; }
  .estimate-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-strip .metric { border-bottom: 1px solid var(--line); }
  .estimate-strip .metric:nth-child(2n) { border-right: 0; }
  .estimate-strip .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .chart-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .chart-row .chart-canvas { grid-column: 1 / -1; grid-row: 2; }
  .estimate-ai-estimate, .estimate-needs-quote { padding: 0 16px 10px; }
  .estimate-inline-detail { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 16px; }
  .estimate-costs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .defend-line { grid-template-columns: minmax(0, 1fr); }
  .defend-line .text-button { grid-column: 1; grid-row: auto; }
  .work-checklist { grid-template-columns: minmax(0, 1fr); }
  .record-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-summary .button { grid-column: 1 / -1; }
  .drawer { width: 100%; height: min(92dvh, 820px); margin-top: auto; padding: 24px 18px 32px; border-left: 0; border-top: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation-name: drawer-up; }
  .drawer.supplier-prices-drawer { width: 100%; height: 94dvh; }
  .labor-rate-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .supplier-quote-option { grid-template-columns: 20px minmax(0, 1fr); gap: 8px 12px; padding: 14px; }
  .supplier-option-price { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; text-align: left; }
  /* "Use normal estimate pricing" carries its total directly, not in a price block; it lines up with the copy too. */
  .supplier-quote-option > .supplier-option-total { grid-column: 2; text-align: left; }
  .supplier-review-totals { grid-template-columns: minmax(0, 1fr); }
  .supplier-review-totals > span:nth-child(2) { text-align: left; }
  .supplier-review-footer { position: static; margin: 0; padding: 20px 0 max(20px, env(safe-area-inset-bottom)); }
  .supplier-review-footer .button { width: 100%; }
  .start-form .actions .button, .open-question-footer .button { width: 100%; }
  .scope-answer-field .button:not(.scope-answer-choice) { flex: 1 1 100%; }
  .media-meta { padding: 10px 12px 12px; }
  /* Trade and phase chips scroll sideways on a phone instead of stacking five rows deep. */
  .estimate-filter-row { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .estimate-filter-row::-webkit-scrollbar { display: none; }
  .estimate-filter { flex: 0 0 auto; }
}

@media (max-width: 560px) {
  .gw-page .actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-message::before { animation: none; background: var(--accent); width: 40px; }
}

/* Where a line came from, and whether it is licensed-trade work. Quiet next to the price chip:
   a drafted line reads as a kraft tag, a checked line as plain text, a licensed-trade line as a
   brick outline. Color is never the only cue; each says its meaning in words. */
.estimate-line-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.line-origin, .line-risk {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 var(--text-eyebrow)/1.3 var(--sans);
  white-space: nowrap;
}
.line-origin-drafted { background: var(--kraft); color: var(--ink); }
.line-origin-checked { padding-inline: 0; color: var(--muted); font-weight: 500; }
.line-risk { border: 1px solid currentColor; color: var(--brick); }
.line-origin-note, .line-risk-note { margin: 0; color: var(--muted); font-size: var(--text-caption); line-height: 1.45; }
.line-risk-note { color: var(--brick); }
.line-origin-summary { margin-top: 4px; }
.step-boundary { display: block; margin-top: 4px; color: var(--brick); font-size: var(--text-caption); line-height: 1.45; }

/* ================================================================== desk layer
   The signed-in contractor tool, drawn like a drafting set: a forest-green pane on the left in
   Grainwork's own green (the dark sidebar of the September workspace), and the work on a bone
   drafting sheet with a faint grid. Plates have hairline rules and square corners; quantities,
   measurements, sheet numbers and labels are set in the device's monospace, the way a drawing
   annotates them. Everything below is layout and drawing detail over the component rules above;
   colors come from the tokens in :root. Sections, in order:
     1. frame (pane, sheet, phone bar)      5. estimate takeoff table
     2. title block and stage track          6. plan: your steps, comparison, schedule
     3. plates, sheet headers, dimension      7. contact sheet
     4. desk landing (start, waiting, board)  8. phone and tablet
   ================================================================== */

/* ---------------------------------------------------------------- 1. frame */

body[data-chrome="app"] { background: var(--desk-sheet); }
.desk { display: grid; grid-template-columns: var(--desk-pane-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.desk-main {
  min-width: 0;
  padding: 24px clamp(20px, 2.6vw, 40px) 88px;
  background-color: var(--desk-sheet);
  background-image:
    linear-gradient(var(--desk-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--desk-grid-major) 1px, transparent 1px),
    linear-gradient(var(--desk-grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--desk-grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.desk-sheet-body { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.desk .workspace-main { font-size: 0.9375rem; }
.desk [id] { scroll-margin-top: 20px; }

.desk-pane {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  height: 100dvh;
  padding: 20px 14px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  color: var(--desk-pane-ink);
  background-color: var(--desk-pane);
  background-image:
    linear-gradient(var(--desk-pane-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--desk-pane-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border-right: 1px solid var(--desk-pane-edge);
}
.desk-pane :focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: 2px; }
.desk-lockup { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 6px; color: var(--muted); text-decoration: none; }
.desk-lockup img { width: 112px; height: auto; }
.desk-lockup span { padding-left: 12px; border-left: 1px solid var(--line-strong); font: 600 var(--text-small)/20px var(--sans); color: var(--muted); }
.desk-lockup--light span { border-left-color: var(--desk-pane-rule); color: var(--desk-pane-muted); }

.pane-label {
  margin: 0 6px 6px;
  color: var(--desk-pane-muted);
  font: 500 0.8125rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pane-nav, .pane-views { display: grid; gap: 2px; }
.pane-link, .pane-view {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--desk-radius);
  background: transparent;
  color: var(--desk-pane-ink);
  font: 500 var(--text-small)/1.2 var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pane-link:hover, .pane-view:hover { background: var(--desk-pane-hover); color: var(--desk-pane-ink); }
.pane-link[aria-current="page"], .pane-view[aria-pressed="true"] { background: var(--desk-pane-active); box-shadow: inset 2px 0 var(--desk-pane-accent); }
.pane-link--back::before { content: "←"; margin-right: 2px; color: var(--desk-pane-muted); }
.pane-link--back { justify-content: flex-start; }
.pane-link--back .pane-count { margin-left: auto; }
.pane-count {
  min-width: 26px;
  padding: 1px 7px;
  border: 1px solid var(--desk-pane-rule);
  border-radius: 2px;
  color: var(--desk-pane-muted);
  font: 500 0.8125rem/1.5 var(--mono);
  text-align: center;
}
.pane-link .pane-count { border-color: var(--desk-pane-alert); color: var(--desk-pane-alert); }

.pane-project-block { display: grid; gap: 4px; padding: 14px 8px 8px; border-top: 1px solid var(--desk-pane-rule); border-bottom: 1px solid var(--desk-pane-rule); }
.pane-project-block > .pane-label { margin: 0 0 4px; }
.pane-current-title { font: 560 1.125rem/1.25 var(--serif); color: var(--desk-pane-ink); overflow-wrap: anywhere; }
.pane-current-address { color: var(--desk-pane-muted); font: 400 0.8125rem/1.4 var(--mono); }
.pane-areas { margin-top: 10px; }
.pane-area-list, .pane-sections, .pane-projects { margin: 0; padding: 0; list-style: none; }
.pane-area {
  appearance: none;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--desk-radius);
  background: transparent;
  color: var(--desk-pane-ink);
  font: 500 var(--text-small)/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
}
.pane-area:hover { background: var(--desk-pane-hover); }
.pane-area[aria-current="page"] { background: var(--desk-pane-active); box-shadow: inset 2px 0 var(--desk-pane-accent); font-weight: 600; }
.pane-area-no { color: var(--desk-pane-muted); font: 500 0.8125rem/1 var(--mono); }
.pane-area[aria-current="page"] .pane-area-no { color: var(--desk-pane-accent); }
.pane-area-meta { color: var(--desk-pane-muted); font: 400 0.8125rem/1 var(--mono); white-space: nowrap; }
.pane-area-meta--alert { color: var(--desk-pane-alert); }
.pane-sections { margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--desk-pane-rule); }
.pane-section {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--desk-pane-muted);
  font: 400 0.875rem/32px var(--sans);
  text-align: left;
  cursor: pointer;
}
.pane-section:hover { color: var(--desk-pane-ink); }

.desk-pane > * { flex-shrink: 0; }
.desk-pane > .pane-projects-block { display: grid; gap: 4px; }
.pane-find {
  width: 100%;
  min-height: 36px;
  margin-bottom: 4px;
  padding: 0 10px;
  border: 1px solid var(--desk-pane-rule);
  border-radius: var(--desk-radius);
  background: var(--desk-pane-field);
  color: var(--desk-pane-ink);
  font: 400 var(--text-small)/1.2 var(--sans);
}
.pane-find::placeholder { color: var(--desk-pane-muted); }
.pane-project {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 8px;
  border-radius: var(--desk-radius);
  color: var(--desk-pane-ink);
  text-decoration: none;
}
.pane-project:hover { background: var(--desk-pane-hover); color: var(--desk-pane-ink); }
.pane-project[aria-current="page"] { background: var(--desk-pane-active); }
.pane-project-mark { width: 8px; height: 8px; border: 1px solid var(--desk-pane-muted); }
.pane-project-mark[data-stage="estimate"], .pane-project-mark[data-stage="locked"] { border-color: var(--desk-pane-accent); }
.pane-project-mark:is([data-stage="agreed"], [data-stage="ordering"], [data-stage="work"]) { border-color: var(--desk-pane-accent); background: var(--desk-pane-accent); }
.pane-project-mark:is([data-stage="closeout"], [data-stage="warranty"]) { border-color: var(--desk-pane-muted); background: var(--desk-pane-muted); }
.pane-project-copy { display: grid; min-width: 0; }
.pane-project-title { overflow: hidden; font: 500 var(--text-small)/1.3 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.pane-project-meta { overflow: hidden; color: var(--desk-pane-muted); font: 400 0.8125rem/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.pane-project-flag { min-width: 22px; padding: 0 5px; border: 1px solid var(--desk-pane-alert); border-radius: 2px; color: var(--desk-pane-alert); font: 500 0.8125rem/1.5 var(--mono); text-align: center; }
.pane-empty { margin: 4px 8px; color: var(--desk-pane-muted); font-size: 0.875rem; }

/* The footer stays at the bottom of the pane while the rest of it scrolls. */
.pane-foot { position: sticky; bottom: -14px; z-index: 1; display: grid; gap: 8px; margin: auto -14px -14px; padding: 10px 16px 12px; border-top: 1px solid var(--desk-pane-rule); background: var(--desk-pane); }
.pane-account { display: grid; gap: 2px; min-width: 0; }
.pane-account strong { font: 600 var(--text-small)/1.3 var(--sans); }
.pane-account span { overflow: hidden; color: var(--desk-pane-muted); font: 400 0.8125rem/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.pane-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pane-actions .sync-pill { flex: 1 1 auto; justify-content: flex-start; min-height: 36px; padding: 0 10px; border-color: var(--desk-pane-rule); background: transparent; color: var(--desk-pane-ink); border-radius: var(--desk-radius); }
.pane-actions .avatar { width: 36px; height: 36px; border-color: var(--desk-pane-rule); background: transparent; color: var(--desk-pane-ink); border-radius: var(--desk-radius); }
.pane-signout {
  appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--desk-pane-rule);
  border-radius: var(--desk-radius);
  background: transparent;
  color: var(--desk-pane-ink);
  font: 500 var(--text-small)/1 var(--sans);
  cursor: pointer;
}
.pane-signout:hover, .pane-actions .avatar:hover, .pane-actions .sync-pill:hover { border-color: var(--desk-pane-ink); color: var(--desk-pane-ink); }
.pane-keys { margin: 0; color: var(--desk-pane-muted); font: 400 0.75rem/1.7 var(--sans); }
.pane-keys kbd {
  display: inline-block;
  min-width: 20px;
  margin-right: 2px;
  padding: 0 5px;
  border: 1px solid var(--desk-pane-rule);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--desk-pane-ink);
  font: 500 0.8125rem/1.5 var(--mono);
  text-align: center;
}

/* Whether the project is saved (a tap refreshes it), and the account. */
.sync-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--muted);
  font: 500 var(--text-caption)/1.2 var(--sans);
  cursor: pointer;
}
.sync-pill:hover { border-color: var(--line-control); color: var(--ink); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
:is(.sync-offline, .sync-waiting, .sync-reconnecting) .sync-dot { background: var(--ochre); }
:is(.sync-needs_review, .sync-error) .sync-dot { background: var(--brick); }
:is(.sync-refreshing, .sync-syncing, .sync-analyzing, .sync-uploading, .sync-loading) .sync-dot { animation: pulse 1s infinite alternate; }
.avatar {
  appearance: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-control);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--heading);
  font: 600 var(--text-caption)/1 var(--sans);
  cursor: pointer;
}
.avatar:hover { border-color: var(--accent); color: var(--accent); }

/* The phone's top bar stands in for the pane. */
.desk-phonebar { display: none; }

/* ---------------------------------------------------------------- 2. title block and stage track */

.title-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  margin-bottom: 16px;
  border: 1px solid var(--desk-rule);
  border-top: 3px double var(--heading);
  background: var(--desk-plate);
}
/* Registration ticks at two corners, as on a plotted sheet. */
.title-block::before, .title-block::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.title-block::before { top: -9px; left: -9px; border-top: 1px solid var(--desk-ink-tick); border-left: 1px solid var(--desk-ink-tick); }
.title-block::after { right: -9px; bottom: -9px; border-right: 1px solid var(--desk-ink-tick); border-bottom: 1px solid var(--desk-ink-tick); }
.tb-head { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 16px 20px 14px; border-right: 1px solid var(--desk-rule); }
.tb-kicker { margin: 0; color: var(--desk-annotation); font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.title-block .tb-title { font-size: clamp(1.5rem, 1.1rem + 0.9vw, 1.875rem); line-height: 1.12; overflow-wrap: anywhere; }
.tb-address { margin: 2px 0 0; color: var(--muted); font: 400 0.875rem/1.4 var(--mono); overflow-wrap: anywhere; }
.tb-cells { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; align-content: stretch; margin: 0; }
.tb-cell { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 12px 16px; border-bottom: 1px solid var(--desk-rule-soft); border-left: 1px solid var(--desk-rule-soft); }
.tb-cell dt { color: var(--desk-annotation); font: 500 0.75rem/1.25 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.tb-cell dd { margin: 0; color: var(--ink); font: 600 1rem/1.25 var(--sans); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tb-cell--money dd { font-family: var(--mono); font-size: 0.9375rem; }
.title-block--desk .tb-cell { padding-block: 12px; }
.title-block--desk .tb-cell dd:not(.tb-note) { color: var(--heading); font: 600 1.625rem/1.1 var(--mono); letter-spacing: -0.01em; }
.title-block--desk .tb-cell:has(.tb-note) dd:not(.tb-note) { font-size: 1.25rem; line-height: 1.3; }
.tb-cell--alert dd { color: var(--ochre-text); }
.tb-cell .tb-note { color: var(--muted); font: 400 0.8125rem/1.3 var(--sans); }
.title-block > .stage-track { grid-column: 1 / -1; border-top: 1px solid var(--desk-rule); }

.stage-track { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 0; padding: 10px 12px 8px; list-style: none; counter-reset: stage; }
.stage-step { position: relative; display: grid; justify-items: start; gap: 6px; min-width: 0; padding-right: 6px; }
/* The track: a hairline from each mark to the next, solid where the job has been. */
.stage-step::before { content: ""; position: absolute; top: 5px; left: 12px; right: 0; border-top: 1px dashed var(--line-strong); }
.stage-step:last-child::before { display: none; }
.stage-step.is-done::before { border-top: 1px solid var(--accent); }
.stage-mark { position: relative; z-index: 1; width: 11px; height: 11px; border: 1px solid var(--line-control); background: var(--desk-plate); }
.stage-step.is-done .stage-mark { border-color: var(--accent); background: var(--accent); }
.stage-step.is-current .stage-mark { border: 2px solid var(--heading); background: var(--desk-plate); box-shadow: 0 0 0 3px var(--accent-wash); }
.stage-name { overflow: hidden; color: var(--faint); font: 400 0.8125rem/1.2 var(--sans); text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.stage-step.is-done .stage-name { color: var(--muted); }
.stage-step.is-current .stage-name { color: var(--heading); font-weight: 600; }
.stage-track--compact { display: flex; gap: 2px; padding: 0; }
.stage-track--compact .stage-step { display: block; padding: 0; }
.stage-track--compact .stage-step::before { display: none; }
.stage-track--compact .stage-mark { display: block; width: 12px; height: 6px; border: 0; background: var(--line); }
.stage-track--compact .is-done .stage-mark { background: var(--accent); }
.stage-track--compact .is-current .stage-mark { height: 10px; margin-top: -2px; background: var(--heading); box-shadow: none; }

/* ---------------------------------------------------------------- 3. plates, sheet headers, dimension lines */

.desk .card, .desk .sheet, .desk .sync-notice, .desk .estimate-table, .desk .estimate-strip, .desk .chart-waterfall, .desk .record-summary, .desk .capture-zone {
  border: 1px solid var(--desk-rule);
  border-radius: var(--desk-radius);
  background: var(--desk-plate);
  box-shadow: none;
}
.desk .card { gap: 10px; padding: 16px 18px; }
.desk .card h2 { font-size: 1.25rem; }
.desk .eyebrow, .desk .metric-label, .desk-annotation {
  margin: 0;
  color: var(--desk-annotation);
  font: 500 0.8125rem/1.3 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.desk .button { border-radius: var(--desk-radius); }
.desk .status, .desk .phase-pill, .desk .status-chip, .desk .count-badge, .desk .confidence, .desk .verification { border-radius: 2px; }
.desk .metric strong { font-family: var(--mono); font-weight: 600; }
.desk .metric-row { border-color: var(--desk-rule-soft); }

.desk .page { gap: 14px; }
.desk .page-header { align-items: flex-end; margin: 4px 0 2px; padding-bottom: 12px; border-bottom: 1px solid var(--desk-rule); }
.desk .page-header h2 { display: flex; align-items: baseline; gap: 12px; font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); }
.sheet-no {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--heading);
  color: var(--heading);
  font: 600 0.875rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  transform: translateY(-3px);
}
.desk .page-description { margin-top: 6px; font-size: 0.9375rem; max-width: 48rem; }

.sheet { display: grid; gap: 12px; padding: 16px 18px 18px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--desk-rule-soft); }
.sheet-title { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.sheet-empty { margin: 0; }

/* A price band as a dimension: extension lines at the ends, slashes where they meet the line,
   the target marked where it falls. The printed numbers carry the meaning; the drawing places them. */
.dim { margin: 6px 0 2px; }
.dim-line { position: relative; height: 38px; margin: 0 1px; }
.dim-line::before, .dim-line::after { content: ""; position: absolute; top: 8px; bottom: 0; border-left: 1px solid var(--desk-dim); }
.dim-line::before { left: 0; }
.dim-line::after { right: 0; }
.dim-rule { position: absolute; left: 0; right: 0; top: 26px; border-top: 1px solid var(--desk-dim); }
.dim-rule::before, .dim-rule::after { content: ""; position: absolute; top: -6px; width: 1px; height: 12px; background: var(--desk-dim); transform: rotate(45deg); }
.dim-rule::before { left: 0; }
.dim-rule::after { right: 0; }
.dim-target { position: absolute; top: 20px; width: 0; height: 12px; }
.dim-target::before { content: ""; position: absolute; top: 0; left: -6px; width: 11px; height: 11px; border: 1px solid var(--heading); background: var(--desk-plate); transform: rotate(45deg); }
.dim-target-value { position: absolute; bottom: 16px; left: 0; padding: 0 4px; background: var(--desk-plate); color: var(--heading); font: 600 0.8125rem/1.2 var(--mono); white-space: nowrap; transform: translateX(-50%); }
.dim-ends { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; margin-top: 4px; color: var(--muted); font: 500 0.8125rem/1.3 var(--mono); }
.dim-caption { color: var(--desk-annotation); letter-spacing: 0.07em; text-align: center; text-transform: uppercase; }

/* Today: the next step leads, then the price, the job, the contractor's steps, checks, progress. */
.desk .overview-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 14px; }
.desk .overview-grid > .next-card { grid-column: span 5; }
.desk .overview-grid > .price-card { grid-column: span 7; }
.desk .overview-grid > .job-card { grid-column: span 5; }
.desk .overview-grid > .steps-summary { grid-column: span 7; }
.desk .overview-grid > .considerations-card { grid-column: span 5; }
.desk .overview-grid > .progress-card { grid-column: span 7; }
.desk .overview-grid > .next-card:only-child, .desk .overview-grid > :last-child:nth-child(odd):not(.price-card) { grid-column: 1 / -1; }
.desk .next-card { border-left: 3px solid var(--ochre); }
.desk .price-card .price-range strong { font-family: var(--mono); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.01em; }
.steps-summary-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--desk-rule-soft); }
.steps-summary-counts > div { padding: 10px 12px 8px 0; border-bottom: 1px solid var(--desk-rule-soft); }
.steps-summary-counts dt { color: var(--desk-annotation); font: 500 0.8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.steps-summary-counts dd { margin: 2px 0 0; font: 600 1.25rem/1.2 var(--mono); color: var(--ink); }
.steps-summary-counts .is-alert dd { color: var(--ochre-text); }

/* ---------------------------------------------------------------- 4. desk landing */

.title-block--desk { grid-template-columns: minmax(0, 1fr); }
.title-block--desk .tb-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.desk--home .index-notices { margin: 0; }
.desk--home .index-notices:not(:has(:not(:empty))) { display: none; }

.start-card { gap: 10px; }
.start-card--first { border-left: 3px solid var(--accent); }
.start-lede { margin: 0; max-width: 52rem; color: var(--muted); }
.desk .start-form { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: end; gap: 10px 14px; }
.desk .start-form .start-address-read, .desk .start-form .start-note, .desk .start-form .form-status { grid-column: 1 / -1; margin: 0; }
.desk .start-form .start-actions { grid-column: 3; grid-row: 1; margin: 0; }
.desk .start-field { font-size: 0.875rem; }
.desk .start-field textarea { min-height: 48px; height: 48px; resize: vertical; }
.address-field { position: relative; display: block; }
.address-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--desk-rule);
  border-radius: var(--desk-radius);
  background: var(--desk-plate);
  box-shadow: var(--shadow);
}
.address-suggestion { display: grid; gap: 1px; min-height: 44px; padding: 7px 12px; cursor: pointer; }
.address-suggestion[aria-selected="true"], .address-suggestion:hover { background: var(--accent-wash); }
.address-suggestion-main { color: var(--ink); font: 500 0.9375rem/1.3 var(--sans); }
.address-suggestion-rest { color: var(--muted); font: 400 0.8125rem/1.3 var(--mono); }
.address-suggestions-credit { padding: 6px 12px 2px; border-top: 1px solid var(--desk-rule-soft); color: var(--faint); font: 400 0.8125rem/1.3 var(--sans); }

.board-find { flex: 1 1 220px; max-width: 360px; min-height: 40px !important; margin-left: auto; border-radius: var(--desk-radius) !important; font-size: 0.875rem !important; }
.board-views { display: flex; flex-wrap: wrap; gap: 6px; }
.board-view {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--desk-rule);
  border-radius: var(--desk-radius);
  background: var(--desk-plate);
  color: var(--muted);
  font: 500 0.875rem/1 var(--sans);
  cursor: pointer;
}
.board-view:hover { border-color: var(--line-control); color: var(--ink); }
.board-view[aria-pressed="true"] { border-color: var(--heading); background: var(--heading); color: var(--on-dark); }
.board-view-count { font: 500 0.8125rem/1 var(--mono); opacity: 0.85; }
/* Keep wide project columns inside the board, without stretching its toolbar. */
.board-sheet { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.board { display: grid; overflow-x: auto; border-top: 1px solid var(--heading); }
.board-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) 132px minmax(240px, 2.2fr) 96px 148px 68px;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--desk-rule-soft);
  font-size: 0.875rem;
  cursor: pointer;
}
.board-row:hover { background: var(--desk-row-hover); }
.board-header { min-height: 36px; padding-block: 6px; white-space: nowrap; color: var(--desk-annotation); font: 500 0.8125rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: default; }
.board-header:hover { background: transparent; }
.board-name { display: grid; gap: 2px; min-width: 0; }
.board-title { overflow: hidden; color: var(--heading); font: 600 0.9375rem/1.3 var(--sans); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.board-title:hover { text-decoration: underline; }
.board-address { overflow: hidden; color: var(--muted); font: 400 0.8125rem/1.3 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.board-stage { display: grid; gap: 5px; justify-items: start; }
.board-stage .status { padding: 2px 7px; font-size: 0.8125rem; }
.board-next { color: var(--ink); line-height: 1.35; }
.board-price, .board-updated { font-family: var(--mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.board-row--yours { box-shadow: inset 3px 0 var(--ochre); }
.board-next { display: grid; gap: 2px; min-width: 0; }
.board-step { width: fit-content; color: var(--heading); font-weight: 600; text-decoration: none; }
.board-step:hover { text-decoration: underline; }
.board-question { overflow: hidden; color: var(--muted); font-size: 0.8125rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.board-question::before { content: "Q "; color: var(--ochre-text); font: 600 0.75rem/1 var(--mono); }
.board-price { color: var(--ink); }
.board-updated { color: var(--muted); }
.board-dim { color: var(--faint); }
.board-row--finished .board-title { color: var(--muted); }
.board-empty { margin: 0; padding: 18px 10px; color: var(--muted); }
.desk-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 2px; font: 500 0.8125rem/1.4 var(--mono); white-space: nowrap; }
.desk-chip--you { background: var(--ochre-wash); color: var(--ochre-text); }
.desk-chip--customer { background: var(--accent-wash); color: var(--accent); }
.desk-chip--none { color: var(--faint); }
.desk .index-paging { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }

/* ---------------------------------------------------------------- 5. estimate takeoff table */

.estimate-totals { display: grid; gap: 4px; padding: 0 0 12px; border: 1px solid var(--desk-rule); border-radius: var(--desk-radius); background: var(--desk-plate); }
.desk .estimate-totals .estimate-strip { border: 0; border-bottom: 1px solid var(--desk-rule-soft); border-radius: 0; }
.desk .estimate-totals .dim { margin: 4px 18px 0; }
.desk .estimate-strip .metric { padding: 12px 16px; }
.desk .estimate-strip .metric strong { font: 600 1.125rem/1.2 var(--mono); color: var(--heading); }
.estimate-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }

.desk .estimate-table { overflow: visible; }
.desk .estimate-row {
  grid-template-columns: 56px minmax(200px, 1.6fr) 104px minmax(150px, 1.35fr) 64px 92px 124px 20px;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 0.875rem;
}
.desk .estimate-header { min-height: 36px; padding-block: 8px; background: var(--desk-plate); border-bottom: 1px solid var(--heading); color: var(--desk-annotation); font: 500 0.8125rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.desk .estimate-phase { grid-template-columns: minmax(0, 1fr) auto auto; padding: 10px 14px 8px; background: var(--desk-phase); border-bottom: 1px solid var(--desk-rule-soft); }
.desk .estimate-phase > span:first-child { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: baseline; }
.desk .estimate-phase > span:first-child > :not(.estimate-phase-no) { grid-column: 2; }
.estimate-phase-no { grid-row: 1 / span 3; padding: 1px 0; border: 1px solid var(--heading); color: var(--heading); font: 600 0.8125rem/1.3 var(--mono); text-align: center; }
.desk .estimate-phase > strong, .desk .estimate-phase > small { font-family: var(--mono); }
.est-no { color: var(--faint); font: 500 0.8125rem/1.2 var(--mono); }
.est-qty, .est-labor, .est-target, .desk .estimate-range, .desk .estimate-unpriced { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.est-qty { color: var(--ink); font-size: 0.8125rem; }
.est-math { display: -webkit-box; overflow: hidden; color: var(--muted); font: 400 0.8125rem/1.35 var(--mono); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.est-math--missing { color: var(--ochre-text); }
.est-labor { color: var(--muted); font-size: 0.8125rem; }
.desk .estimate-row .est-target { font-size: 0.875rem; }
.desk .estimate-range { font-size: 0.8125rem; }
.desk .estimate-name { flex-flow: row wrap; align-items: center; gap: 4px 6px; }
.desk .estimate-name > strong, .desk .estimate-name > small:first-of-type { flex: 1 0 100%; }
.desk .estimate-name strong { font-size: 0.9375rem; }
.desk .estimate-line-tags { display: contents; }
/* The line's AI-estimate note: one quiet row under the work, with its two ways to replace it. */
.desk .estimate-ai-estimate, .desk .estimate-needs-quote { flex-wrap: nowrap; gap: 0 14px; margin-top: -4px; padding: 0 14px 10px calc(56px + 26px); font-size: 0.8125rem; }
.desk .estimate-ai-estimate-copy { flex: 0 1 auto; }
.desk .estimate-ai-estimate .text-button, .desk .estimate-needs-quote .text-button { min-height: 32px; flex: 0 0 auto; font-size: 0.8125rem; }
.desk .estimate-item:hover, .desk .estimate-line-expanded { background: var(--desk-row-hover); }
.desk .estimate-total { background: var(--desk-phase); border-top: 1px solid var(--heading); }
.desk .estimate-inline-detail { margin-left: 56px; border-left: 1px dashed var(--desk-rule); }
.desk .estimate-search { border-radius: var(--desk-radius) !important; }
.desk .estimate-filter { min-height: 36px; border-radius: var(--desk-radius); }
.desk .estimate-filter-active { border-color: var(--heading); background: var(--heading); color: var(--on-dark); }
.provenance-link { font: 500 0.8125rem/1.4 var(--sans); color: var(--accent); }

/* ---------------------------------------------------------------- 6. plan: your steps, comparison, schedule */

.steps-editor { border-left: 3px solid var(--heading) !important; }
.my-steps { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--desk-rule-soft); }
.my-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--desk-rule-soft); }
.my-step-no { color: var(--faint); font: 500 0.8125rem/1 var(--mono); }
.my-step-copy { display: grid; gap: 2px; min-width: 0; }
.my-step-copy strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.my-step-detail { color: var(--muted); font: 400 0.8125rem/1.45 var(--sans); overflow-wrap: anywhere; }
.my-step--kept .my-step-no { color: var(--heading); }
.my-step-actions { display: flex; align-items: center; gap: 4px 12px; }
.icon-button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--desk-rule);
  border-radius: var(--desk-radius);
  background: var(--desk-plate);
  color: var(--muted);
  font: 500 0.9375rem/1 var(--mono);
  cursor: pointer;
}
.icon-button:hover:not(:disabled) { border-color: var(--line-control); color: var(--ink); }
.icon-button:disabled { opacity: 0.35; cursor: default; }
.my-step-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.my-step-edit .form-status { grid-column: 1 / -1; }
.plan-recording { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--desk-rule-soft); }
.plan-recording p { flex: 1 1 200px; margin: 0; overflow-wrap: anywhere; }

.compare-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.compare-count { padding: 1px 7px; border: 1px solid var(--desk-rule); border-radius: 2px; color: var(--muted); font: 500 0.8125rem/1.5 var(--mono); }
.compare-count--differs, .compare-count--suggested_only { border-color: var(--ochre); color: var(--ochre-text); }
.compare-count--matched { border-color: var(--accent); color: var(--accent); }
.compare-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--heading); }
.compare-row { display: grid; grid-template-columns: 30px minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.6fr) 84px 216px; align-items: start; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--desk-rule-soft); font-size: 0.875rem; }
.compare-header { padding-block: 6px; color: var(--desk-annotation); font: 500 0.8125rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.compare-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--desk-rule); color: var(--muted); font: 600 0.9375rem/1 var(--mono); }
.compare-row--matched .compare-mark { border-color: var(--accent); color: var(--accent); }
.compare-row--differs .compare-mark, .compare-row--suggested_only .compare-mark { border-color: var(--ochre); background: var(--ochre-wash); color: var(--ochre-text); }
.compare-row--contractor_only .compare-mark { border-color: var(--heading); color: var(--heading); }
.compare-row--dismissed { color: var(--muted); }
.compare-mine, .compare-theirs { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.compare-mine strong, .compare-theirs strong { font-weight: 600; color: var(--ink); }
.compare-detail { color: var(--muted); font: 400 0.8125rem/1.45 var(--sans); }
.compare-empty { color: var(--faint); }
.compare-diffs { display: grid; gap: 8px; margin: 0; }
.compare-diffs > div { display: grid; gap: 2px; }
.compare-diffs dt { color: var(--desk-annotation); font: 500 0.8125rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.compare-diffs dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.compare-diff-theirs { color: var(--muted) !important; }
.compare-diffs .desk-annotation { margin-right: 4px; }
.compare-price { font: 600 0.875rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.compare-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; justify-content: flex-end; }
.compare-actions .button { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }

.desk .plan-timeline { display: grid; gap: 0; border: 1px solid var(--desk-rule); border-radius: var(--desk-radius); background: var(--desk-plate); }
.plan-schedule-header, .desk .plan-step, .plan-schedule-total {
  display: grid;
  grid-template-columns: 48px minmax(220px, 2fr) minmax(120px, 1fr) 92px 92px 104px 100px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--desk-rule-soft);
  border-radius: 0;
  background: transparent;
}
.desk .plan-step { align-items: start; }
.plan-schedule-header > :last-child, .plan-schedule-total > :last-child { display: none; }
.desk .plan-step > .step-actions { grid-column: 2 / -1; justify-content: flex-start; }
.desk .plan-step > .step-actions:empty { display: none; }
.plan-schedule-header { padding-block: 8px; border-bottom: 1px solid var(--heading); color: var(--desk-annotation); font: 500 0.8125rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.plan-schedule-total { background: var(--desk-phase); border-bottom: 0; border-top: 1px solid var(--heading); }
.desk .step-number { width: auto; height: auto; border: 0; border-radius: 0; color: var(--faint); font: 500 0.8125rem/1 var(--mono); place-items: start; }
.desk .plan-complete .step-number { background: transparent; color: var(--accent); }
.desk .step-copy h2 { margin: 1px 0 0; font: 600 0.9375rem/1.3 var(--sans) !important; color: var(--ink); }
.desk .step-copy .eyebrow { font-size: 0.8125rem; }
.desk .step-meta { font-family: var(--mono); font-size: 0.8125rem; }
.step-yours { color: var(--heading); font-weight: 600; }
.step-timing { display: grid; gap: 6px; min-width: 0; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--desk-rule-soft); overflow-wrap: anywhere; font: 400 0.8125rem/1.45 var(--sans); }
.step-timing p, .step-timing ul { margin: 0; }
.step-timing-active { color: var(--ink); font-weight: 600; }
.step-timing-waits { display: grid; gap: 8px; padding: 0; list-style: none; }
.step-timing-wait { display: grid; gap: 2px; }
.step-timing-wait strong { color: var(--ink); font-weight: 500; }
.step-timing-basis summary { cursor: pointer; min-height: 32px; padding-block: 6px; color: var(--accent); }
.step-timing-basis p, .step-timing-basis ul { margin-top: 6px; }
.step-timing-basis ul { padding-left: 18px; }
.plan-step--yours { box-shadow: inset 3px 0 var(--heading); }
.step-hours { display: grid; grid-template-columns: minmax(6ch, max-content) minmax(0, 1fr); align-items: center; gap: 8px; }
.step-hours-label { display: none; }
.step-hours-track { position: relative; display: block; height: 12px; border: 1px solid var(--desk-rule-soft); }
.step-hours-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-wash); border-right: 1px solid var(--accent); }
.step-hours-value { color: var(--ink); font: 500 0.8125rem/20px var(--mono); white-space: nowrap; }
.step-money { color: var(--ink); font: 400 0.8125rem/1.3 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.step-money--zero { color: var(--faint); }
.step-price { font: 600 0.875rem/1.3 var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.step-price--missing { color: var(--ochre-text); }
.plan-empty { margin: 0; padding: 16px; }

/* ---------------------------------------------------------------- 7. contact sheet */

.contact-sheet-plate { display: grid; gap: 0; border: 1px solid var(--desk-pane-edge); border-radius: var(--desk-radius); background: var(--desk-pane); color: var(--desk-pane-ink); }
.contact-sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 12px 14px 10px; border-bottom: 1px solid var(--desk-pane-rule); }
.contact-sheet-plate .media-heading { margin: 0; color: var(--desk-pane-ink); font-size: 1.0625rem; }
.contact-sheet-plate .desk-annotation { color: var(--desk-pane-muted); }
.desk .media-grid.contact-sheet { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; padding: 14px; }
.desk .contact-sheet .media-tile { border: 0; border-radius: 0; background: transparent; }
.media-frame { position: relative; border: 1px solid var(--desk-pane-rule); background: var(--desk-pane-field); }
.desk .contact-sheet .media-placeholder { background: var(--desk-pane-field); color: var(--desk-pane-muted); }
.media-frame-no { position: absolute; top: 6px; left: 6px; padding: 1px 5px; background: var(--desk-pane); color: var(--desk-pane-ink); font: 500 0.8125rem/1.4 var(--mono); }
.desk .contact-sheet .media-meta { gap: 3px; padding: 7px 2px 0; color: var(--desk-pane-ink); font-size: 0.8125rem; }
.desk .contact-sheet .media-meta strong { overflow: hidden; max-width: 100%; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.media-facts { color: var(--desk-pane-muted); font: 400 0.8125rem/1.3 var(--mono); }
.desk .contact-sheet .verification { background: transparent; color: var(--desk-pane-accent); padding: 0; }
.desk .contact-sheet .button--secondary { border-color: var(--desk-pane-rule); color: var(--desk-pane-ink); }
.desk .capture-zone { border-style: dashed; border-color: var(--line-control); }

/* ---------------------------------------------------------------- 8. tablet and phone */

@media (max-width: 1280px) {
  .desk .estimate-row { grid-template-columns: 48px minmax(180px, 1.6fr) 96px 60px 88px 116px 20px; }
  .desk .estimate-row > .est-math { display: none; }
}

@media (max-width: 1180px) {
  .desk { grid-template-columns: 232px minmax(0, 1fr); }
  .desk-pane .desk-lockup { flex-direction: column; align-items: flex-start; gap: 4px; }
  .desk-pane .desk-lockup span { padding-left: 0; border-left: 0; }
  .desk .start-form { grid-template-columns: minmax(0, 1fr); }
  .desk .start-form .start-actions { grid-column: auto; grid-row: auto; }
  .tb-cells { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .title-block, .title-block--desk { grid-template-columns: minmax(0, 1fr); }
  .tb-head { border-right: 0; border-bottom: 1px solid var(--desk-rule); }
  .board-row { grid-template-columns: minmax(170px, 1.5fr) 124px minmax(200px, 2.2fr) 80px 132px; }
  .board-row > .board-updated, .board-header > :last-child { display: none; }
  .desk .overview-grid > * { grid-column: span 6 !important; }
  .plan-schedule-header, .desk .plan-step, .plan-schedule-total { grid-template-columns: 40px minmax(180px, 2fr) minmax(100px, 1fr) 84px 84px 96px 92px; }
  .plan-schedule-header > :last-child, .desk .plan-step > .step-actions:empty, .plan-schedule-total > :last-child { display: none; }
  .compare-row { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) 84px; }
  .compare-row > .compare-actions { grid-column: 2 / -1; justify-content: flex-start; }
}

/* Keep quantities and prices visible when the full estimate table no longer fits beside the desk. */
@media (max-width: 1040px) {
  .desk .estimate-header { display: none; }
  .desk .estimate-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; gap: 4px 12px; padding: 12px 14px; }
  .desk .estimate-row > .est-no, .desk .estimate-row > .est-labor, .desk .estimate-row > .chevron { display: none; }
  .desk .estimate-row > .estimate-name { grid-column: 1; grid-row: 1; }
  .desk .estimate-row > .est-target, .desk .estimate-row > .estimate-unpriced { grid-column: 2; grid-row: 1; align-self: start; text-align: right; }
  /* An estimator standing in the room still needs the quantity behind each line: it keeps its
     own second-row place on the compact card, and the arithmetic follows beneath. */
  .desk .estimate-row > .est-qty { display: block; grid-column: 1; grid-row: 2; color: var(--muted); }
  .desk .estimate-row > .estimate-range { grid-column: 2; grid-row: 2; text-align: right; }
  .desk .estimate-row > .est-math { display: -webkit-box; grid-column: 1 / -1; grid-row: 3; }
  .desk .estimate-inline-detail { margin-left: 0; border-left: 0; }
  .desk .estimate-phase > span:first-child { grid-template-columns: 36px minmax(0, 1fr); }
  .desk .estimate-table { border: 1px solid var(--desk-rule); background: var(--desk-plate); }
  .desk .estimate-line { margin: 0; border: 0; border-bottom: 1px solid var(--desk-rule-soft); border-radius: 0; }
}

@media (max-width: 760px) {
  .desk { display: block; }
  .desk-pane { display: none; }
  .desk-phonebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    margin: 0 -16px 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--desk-rule);
    background: var(--desk-phonebar);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .desk-phonebar .desk-lockup img { width: 100px; }
  .desk-phonebar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .desk-phonebar .sync-pill { min-height: 40px; padding: 0 10px; border-radius: var(--desk-radius); }
  .desk-phonebar .avatar { width: 40px; height: 40px; border-radius: var(--desk-radius); }
  .desk-main { padding: 0 16px calc(var(--mobile-nav-height) + 32px + env(safe-area-inset-bottom)); background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; }
  .title-block { margin-bottom: 12px; }
  .title-block::before, .title-block::after { display: none; }
  .tb-head { padding: 12px 14px; }
  .tb-cells { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-cell { padding: 9px 12px; }
  .stage-track { padding: 8px 10px 6px; }
  .stage-name { display: none; }
  .stage-step.is-current .stage-name { display: block; position: absolute; top: 16px; left: 0; overflow: visible; max-width: none; }
  .title-block > .stage-track { padding-bottom: 28px; }
  .stage-track .is-current:nth-last-child(-n+3) .stage-name { left: auto; right: 0; }
  .desk .page-header { align-items: stretch; }
  .desk .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .desk .overview-grid > * { grid-column: auto !important; }
  .desk .start-form { grid-template-columns: minmax(0, 1fr); }
  .desk .start-form .start-actions { grid-column: auto; grid-row: auto; }
  .board-header { display: none; }
  .board-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "stage waiting" "next next"; gap: 6px 12px; padding: 12px 4px; }
  .board-name { grid-area: name; }
  .board-stage { grid-area: stage; grid-auto-flow: column; align-items: center; }
  .board-next { grid-area: next; font-size: 0.875rem; }
  .board-waiting { grid-area: waiting; justify-self: end; }
  .board-price { grid-area: price; justify-self: end; }
  .board-row > .board-updated { display: none; }
  .board-find { max-width: none; margin-left: 0; flex-basis: 100%; }
  .board-view { min-height: 44px; }
  .plan-schedule-header { display: none; }
  .desk .plan-step { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "no copy price" "no hours hours" "no labor labor" "no materials materials" "no other other" "no actions actions"; row-gap: 8px; }
  .desk .plan-step > .step-number { grid-area: no; }
  .desk .plan-step > .step-copy { grid-area: copy; }
  .desk .plan-step > .step-price { grid-area: price; align-self: start; }
  .desk .plan-step > .step-hours { grid-area: hours; }
  .desk .step-hours-label { display: block; color: var(--faint); font: 400 0.8125rem/1.4 var(--sans); }
  .desk .plan-step > .step-money { display: inline-block; }
  .desk .plan-step > .step-money::before { content: attr(data-label) " "; color: var(--faint); }
  .desk .plan-step > .step-money { text-align: left; }
  .desk .plan-step > .step-money[data-label="Labor"] { grid-area: labor; }
  .desk .plan-step > .step-money[data-label="Materials"] { grid-area: materials; }
  .desk .plan-step > .step-money[data-label="Equipment and other"] { grid-area: other; }
  .desk .plan-step--price-note { grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "no copy" "no price" "no hours" "no labor" "no materials" "no other" "no actions"; }
  .desk .plan-step--price-note > .step-price { text-align: left; }
  .desk .plan-step > .step-actions { grid-area: actions; justify-content: flex-start; }
  .plan-schedule-total { grid-template-columns: minmax(0, 1fr) auto; }
  .plan-schedule-total > :not(strong) { display: none; }
  .compare-header { display: none; }
  .compare-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "mark mine price" "mark theirs theirs" "mark diff diff" "mark actions actions"; row-gap: 6px; }
  .compare-mark { grid-area: mark; }
  .compare-mine { grid-area: mine; }
  .compare-theirs { grid-area: theirs; }
  .compare-difference { grid-area: diff; }
  .compare-price { grid-area: price; text-align: right; }
  .compare-row > .compare-actions { grid-area: actions; grid-column: auto; justify-content: flex-start; }
  .my-step { grid-template-columns: 28px minmax(0, 1fr); }
  .my-step-actions { grid-column: 2; flex-wrap: wrap; }
  .my-step-edit { grid-template-columns: minmax(0, 1fr); }
  .desk .media-grid.contact-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    padding: 4px 2px env(safe-area-inset-bottom);
    border-top: 1px solid var(--desk-pane-edge);
    background: var(--desk-pane);
  }
  .mobile-nav-button { appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: var(--desk-radius); background: none; color: var(--desk-pane-muted); font: 500 0.8125rem/1.1 var(--sans); cursor: pointer; }
  .mobile-nav-button[aria-current="page"] { background: var(--desk-pane-active); color: var(--desk-pane-ink); font-weight: 600; box-shadow: inset 0 2px var(--desk-pane-accent); }
  .mobile-nav-button:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: -3px; }
  .toast { bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- refinements after the first render */

/* The start card, compact once a contractor has projects: one row of fields, notes beneath. */
.start-card--compact { gap: 8px; padding-block: 12px 14px; }
.start-card--compact .sheet-head { padding-bottom: 6px; }
.start-card--compact .start-note { font-size: 0.8125rem; }
.desk .start-field textarea { field-sizing: content; max-height: 140px; }
.start-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--desk-rule-soft); counter-reset: start; }
.start-steps li { display: grid; gap: 4px; padding: 12px 16px 2px 0; counter-increment: start; }
.start-steps li + li { padding-left: 16px; border-left: 1px solid var(--desk-rule-soft); }
.start-steps strong { font: 600 0.9375rem/1.3 var(--sans); color: var(--heading); }
.start-steps strong::before { content: counter(start, decimal-leading-zero); margin-right: 10px; padding: 1px 6px; border: 1px solid var(--heading); font: 600 0.8125rem/1.2 var(--mono); }
.start-steps span { color: var(--muted); font-size: 0.875rem; }
.desk .start-known { gap: 6px; padding-top: 10px; }
.desk .start-known-home { min-height: 36px; padding: 0 10px; font: 500 0.8125rem/1 var(--mono); }
.desk .capture-choice { min-height: 48px; width: 100%; padding: 12px 16px; justify-content: flex-start; text-align: left; white-space: normal; overflow-wrap: anywhere; font: 500 1rem/1.4 var(--sans); }

.board-also { display: block; color: var(--accent); font: 400 0.8125rem/1.35 var(--sans); }

/* The upload plate shrinks to one row once the project has files. */
.desk .capture-zone--compact { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 18px; }
.desk .capture-zone--compact h2 { font-size: 1.0625rem; }
.desk .capture-zone--compact p { flex: 1 1 24rem; margin: 0; font-size: 0.875rem; }
.desk .capture-zone--compact .upload-list { flex: 1 0 100%; }

/* Drawers open over the desk: square plates, the desk's labels. */
.drawer { border-radius: 0; border-left-color: var(--desk-rule); background: var(--desk-plate); }
.drawer .button, .drawer-close, .drawer .card { border-radius: var(--desk-radius); }
.drawer .eyebrow { color: var(--desk-annotation); font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; }
.drawer .job-payment { border-color: var(--desk-rule); box-shadow: none; }
.step-price--shared { color: var(--faint); font-weight: 500; }

@media (max-width: 1180px) {
  .start-steps { grid-template-columns: minmax(0, 1fr); }
  .start-steps li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--desk-rule-soft); }
}

@media (max-width: 760px) {
  .desk .estimate-ai-estimate, .desk .estimate-needs-quote { flex-wrap: wrap; padding: 0 14px 10px; margin-top: 0; }
  .desk .capture-zone--compact .button { flex: 1 1 100%; }
  .desk .capture-zone--compact p { display: none; }
  /* On a phone the title block is the project and where it stands; the rest is one tap away. */
  .title-block:not(.title-block--desk) .tb-cell:nth-child(n+3) { display: none; }
  .title-block .tb-title { font-size: 1.375rem; }
  .desk .page-header h2 { font-size: 1.25rem; }
  .desk .page-description { font-size: 0.875rem; }
  .drawer { border-radius: var(--desk-radius) var(--desk-radius) 0 0; }
}

/* Open questions read like a question sheet on a wide screen: the question on the left, the
   answer beside it, one row each. */
@media (min-width: 1100px) {
  .desk .open-question { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr); align-items: center; column-gap: 24px; row-gap: 4px; padding: 10px 0; }
  .desk .open-question > .open-question-meta, .desk .open-question > .scope-question-text { grid-column: 1; }
  .desk .open-question > :is(.scope-answer-form, .open-question-saved, .muted-small, .button) { grid-column: 2; grid-row: 1 / span 2; }
  .desk .open-question .scope-answer-field input { max-width: none; }
}

/* Record and delivery plates: square cards inside a plate, and the history drawn on its own plate. */
.desk .delivery-card, .desk .upload-row, .desk .closeout-punch-row { border-radius: var(--desk-radius); }
.desk .delivery-card { border-color: var(--desk-rule-soft); background: var(--desk-phase); }
.desk .record-timeline { padding: 18px 18px 4px; border: 1px solid var(--desk-rule); border-radius: var(--desk-radius); background: var(--desk-plate); }
.desk .record-event .muted-small { font-family: var(--mono); }

/* Google's Search Suggestions beside a web price: Google's own chip, in a quiet frame. */
.search-suggestions { display: block; width: 100%; height: 64px; margin-top: 4px; border: 0; background: transparent; }
.provenance-suggestions { display: grid; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--desk-rule-soft); }

/* ---------------------------------------------------------------- taste pass, September 24 */

/* The totals plate: the band as a dimension line on the left carries low, target and high; the
   numbers that are not on the line sit beside it. */
.estimate-totals--drawn { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; gap: 0; padding: 0; }
.desk .estimate-totals--drawn .dim { align-self: center; margin: 14px 24px 12px; }
.desk .estimate-totals--drawn .estimate-strip { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border-bottom: 0; border-left: 1px solid var(--desk-rule-soft); }
.desk .estimate-totals--drawn .estimate-strip .metric { padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--desk-rule-soft); }
.desk .estimate-totals--drawn .estimate-strip .metric strong { min-width: 0; white-space: normal; }
.desk .estimate-result-actions { justify-content: flex-start; margin: 12px 0 14px; }

/* A title block, the desk's or a project's: the name across the top, its numbers in one row
   beneath it (every label on one line), then a project's stage track. */
.title-block { grid-template-columns: minmax(0, 1fr); }
.title-block .tb-head { padding-bottom: 12px; border-right: 0; border-bottom: 1px solid var(--desk-rule); }
.title-block .tb-cell { padding: 10px 16px; border-bottom: 0; }
.title-block .tb-cell:first-child { border-left: 0; }
.desk .estimate-totals--drawn .dim-target-value { font-size: 1rem; }
.desk .estimate-totals--drawn .dim-line { height: 46px; }
.desk .estimate-totals--drawn .dim-line::before, .desk .estimate-totals--drawn .dim-line::after { top: 14px; }
.desk .estimate-totals--drawn .dim-rule { top: 34px; }
.desk .estimate-totals--drawn .dim-target { top: 28px; }
.desk .estimate-totals--drawn .dim-ends { font-size: 0.875rem; color: var(--ink); }

/* While payments open the note is one line, not a plate. */
.desk .job-payment-pilot { display: flex; flex-flow: row wrap; align-items: baseline; gap: 4px 14px; padding: 9px 16px; border-left: 3px solid var(--accent); }
.desk .job-payment-pilot strong { font: 500 var(--text-small)/1.4 var(--sans); color: var(--ink); }

/* The AI-estimate row under a line: the replace actions sit right after their lead. */
.desk .estimate-ai-estimate { justify-content: flex-start; color: var(--muted); }

@media (max-width: 1180px) {
  .estimate-totals--drawn { grid-template-columns: minmax(0, 1fr); }
  .desk .estimate-totals--drawn .estimate-strip { border-left: 0; border-top: 1px solid var(--desk-rule-soft); }
}

@media (max-width: 760px) {
  .title-block--desk .tb-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .title-block--desk .tb-cell { padding: 9px 10px; border-left: 0; }
  .title-block--desk .tb-cell:not(:nth-child(3n+1)) { border-left: 1px solid var(--desk-rule-soft); }
  .title-block--desk .tb-cell:nth-child(n+4) { border-top: 1px solid var(--desk-rule-soft); }
  .title-block--desk .tb-cell:last-child:nth-child(5) { grid-column: span 2; }
  .title-block--desk .tb-cell dt { font-size: 0.6875rem; letter-spacing: 0.03em; }
  .title-block--desk .tb-cell dd:not(.tb-note) { font-size: 1.25rem; }
  .board-row--yours { box-shadow: inset 3px 0 var(--ochre); padding-left: 10px; }
  .board-question { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

@media (max-width: 400px) {
  /* The wordmark and accessible link name retain the product identity. */
  .desk-phonebar .desk-lockup span { display: none; }
}

/* A retained first capture asks for one unavailable fact, within its own card. */
.capture-address-step { display: grid; gap: 12px; width: min(100%, 38rem); min-width: 0; }
.capture-address-step input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; }
.capture-address-step .button { justify-self: start; min-height: 44px; white-space: normal; }

/* Keep the customer document visible beneath its controls on small screens. */
@media (max-width: 560px) {
  .customer-estimate-toolbar strong { flex-basis: 100%; }
  .customer-estimate-toolbar .button { padding: 10px 14px; min-height: 44px; font-size: 13px; }
}

/* Project intent stays in context, with one primary next action per step. */
.job-intake { max-width: 860px; }
.job-intake-content { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 18px; }
.job-intake-content > .start-field, .job-intake-content > .intake-optional { width: 100%; }
.job-intake .start-field { display: grid; gap: 8px; }
.job-intake input:not([type=file]), .job-intake textarea { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 5px; padding: 12px; font: inherit; background: var(--paper); color: inherit; }
.job-intake textarea { resize: vertical; }
.job-intake .address-field { width: 100%; }
.intake-context { font-weight: 600; overflow-wrap: anywhere; }
.intake-scope { white-space: pre-wrap; overflow-wrap: anywhere; }
.intake-optional { padding: 16px 0; border-top: 1px solid var(--line); }
.intake-optional summary { cursor: pointer; min-height: 44px; }
.intake-optional .start-field { margin: 14px 0; }
.intake-file-list { list-style: none; width: 100%; margin: 0; padding: 0; }
.intake-file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.intake-file-list li span { overflow-wrap: anywhere; min-width: 0; }
.intake-file-list button { flex: 0 0 auto; max-width: 48%; overflow-wrap: anywhere; font-size: 12px; }
.location-choices { display: grid; width: 100%; gap: 12px; }
.location-choices button { text-align: left; }
.locations-sheet { display: grid; gap: 20px; }
.location-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.location-row h3 { overflow-wrap: anywhere; }
.desk-quick-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
@media(max-width: 560px) { .job-intake-content > button { max-width: 100%; white-space: normal; } .intake-file-list li { align-items: flex-start; } }

.project-management { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.project-management:empty { display:none; }
.project-management .start-field { width:100%; }
.desk-quick-actions { display: none; }
.quick-back-desk { display:none; }
@media(max-width:840px) {
  .desk-quick-actions { display:flex; }
  .desk--starting .desk-quick-actions > :not(.quick-back-desk), .desk--locations .desk-quick-actions > :not(.quick-back-desk) { display:none; }
  .desk--starting .quick-back-desk, .desk--locations .quick-back-desk { display:inline-flex; }
}

/* The project is a working surface: evidence, sequence, then the decisions it supports. */
.workbench .desk-pane { background-image: none; }
.workbench .title-block { border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; }
.workbench .title-block::before, .workbench .title-block::after { display: none; }
.workbench .tb-head { padding: 22px 0 12px; }
.workbench .tb-title { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.15; }
.workbench .tb-kicker { display: none; }
.workbench .tb-cells { display: flex; flex-wrap: wrap; gap: 16px 28px; padding: 0 0 18px; border: 0; }
.workbench .tb-cell { padding: 0; border: 0; min-width: 0; }
.workbench .tb-cell dt { font-size: .7rem; }
.workbench .tb-cell dd { font-size: .9rem; }
.workbench .tb-cell--range dd { font-size: 1.1rem; }
.workbench .stage-track { margin: 0; border: 0; background: transparent; }
.stage-link { appearance: none; display: grid; gap: 8px; width: 100%; min-height: 54px; padding: 8px 4px; background: transparent; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.stage-link:hover { background: var(--surface-alt, var(--kraft)); }
.stage-link:focus-visible { outline: 2px solid var(--forest, var(--focus)); outline-offset: -2px; }
.workbench .stage-step { padding: 0; }
.workbench .stage-name { font: 500 .72rem/1.3 var(--sans); }
.workbench .desk-sheet-body { padding-top: 24px; }
.workbench .page-header { margin-bottom: 24px; padding-bottom: 0; border: 0; }
.workbench .sheet-no { display: none; }
.workbench .page-title { font-size: 1.7rem; }
.workbench .page-subtitle { max-width: 58ch; }
.workbench .card { border: 0; border-top: 1px solid var(--line); background: transparent; box-shadow: none; border-radius: 0; padding: 22px 0; }
.workbench .card::before, .workbench .card::after { display: none; }
.project-start-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 36px; align-items: start; }
.project-start-work { min-width: 0; }
.workbench .project-start-work > .job-card { padding-top: 0; border-top: 0; }
.workbench .job-request { font: 450 1.16rem/1.55 var(--sans); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font: 500 1.35rem/1.3 var(--serif); }
.room-evidence { min-width: 0; }
.room-evidence-frame { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--kraft); overflow: hidden; }
.room-evidence-frame > img, .room-evidence-frame > video { width: 100%; height: 100%; max-height: 520px; object-fit: contain; }
.room-evidence-empty { display: grid; align-content: center; justify-items: start; min-height: 300px; padding: 36px; background: var(--accent-wash); }
.room-evidence-empty > p:first-child { font: 500 1.8rem/1.25 var(--serif); margin: 0 0 8px; }
.room-evidence-caption { margin: 8px 0 12px; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.room-evidence-rail { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.room-evidence-pick { flex: 0 0 76px; width: 76px; height: 60px; border: 2px solid transparent; padding: 2px; background: var(--accent-wash); cursor: pointer; }
.room-evidence-pick[aria-pressed="true"] { border-color: var(--accent); }
.room-evidence-pick img { height: 100%; width: 100%; object-fit: cover; }
.room-video-label { display: grid; place-items: center; color: var(--accent); font: 500 .8rem/1.3 var(--sans); }
.room-evidence-pick .media-placeholder { min-height: 0; font-size: .6rem; }
.project-more { margin: 24px 0; border-top: 1px solid var(--line-strong); padding: 16px 0; }
.project-more > summary { cursor: pointer; font-weight: 600; min-height: 30px; }
.workbench .estimate-evidence { display: block; }
.workbench .estimate-evidence[open] { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.workbench .estimate-evidence > summary { grid-column: 1 / -1; }
.workbench .evidence-choice { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-content: start; padding: 0; border: 0; }
.evidence-choice-preview { display: grid; grid-column: 1 / -1; height: 110px; background: var(--kraft); overflow: hidden; }
.evidence-choice-preview img { width: 100%; height: 100%; object-fit: cover; }
.workbench .evidence-choice > span:last-child { font-size: .78rem; overflow-wrap: anywhere; }
.evidence-video { width: 100%; height: 100%; object-fit: contain; background: var(--forest-deep); }
.workbench .page > .room-evidence { max-width: 850px; margin-bottom: 24px; }
.workbench .capture-zone { padding: 22px 0; background: none; border: 0; border-top: 1px solid var(--line); }
.workbench .contact-sheet-plate { border: 0; background: none; }
.workbench .media-meta { background: transparent; }
.plan-workbench { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 28px; align-items: start; }
.plan-workbench > .room-evidence { position: sticky; top: 20px; }
.plan-workbench > .plan-timeline { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.workbench .plan-schedule-header { display: none; }
.plan-workbench .plan-step { display: grid; min-width: 0; grid-template-columns: 32px minmax(0, 1fr); gap: 8px 14px; padding: 20px 0; border-width: 0 0 1px; background: none; }
.plan-workbench .step-number { grid-column: 1; grid-row: 1 / span 8; }
.plan-workbench .step-copy, .plan-workbench .step-hours, .plan-workbench .step-actions { grid-column: 2; }
.plan-workbench .step-cost { grid-column: 2; }
.plan-workbench .plan-step > .step-money { grid-column: 2; text-align: left; }
.plan-workbench .plan-step > .step-money::before { content: attr(data-label) " "; color: var(--faint); }
.plan-workbench .plan-step > .step-money--zero { display: none; }
.plan-workbench .step-instructions > summary { min-height: 44px; display: flex; align-items: center; width: fit-content; color: var(--accent); font-weight: 600; cursor: pointer; }
.plan-workbench .step-instructions > p { margin: 0 0 8px; }
.plan-workbench .plan-schedule-total { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
.plan-workbench .plan-schedule-total > :empty { display: none; }
.plan-workbench .plan-schedule-total > .step-money { grid-column: 1; }
.plan-workbench .plan-schedule-total > .step-money::before { content: attr(data-label) " "; color: var(--faint); }
.plan-workbench .plan-schedule-total > .step-price { grid-column: 2; grid-row: 1; justify-self: end; }
.plan-workbench .step-copy h2 { font-size: 1.2rem; }
.plan-workbench .step-hours { max-width: 260px; }
@media (max-width: 1100px) {
  .project-start-grid, .plan-workbench { grid-template-columns: minmax(0, 1fr); }
  .plan-workbench > .room-evidence { position: static; max-width: 620px; }
  .workbench .tb-cells { gap: 12px 20px; }
}
@media (max-width: 620px) {
  .workbench .tb-head { padding-top: 16px; }
  .workbench .tb-cells { gap: 12px 20px; }
  .workbench .tb-cell:last-child { display: none; }
  .workbench .stage-track { display: flex; overflow-x: auto; }
  .workbench .stage-step { flex: 0 0 88px; }
  .stage-link { min-height: 60px; padding: 8px 6px; }
  .project-start-grid { gap: 24px; }
  .room-evidence-empty { min-height: 220px; padding: 24px; }
  .workbench .desk-sheet-body { padding-top: 20px; }
  .workbench .page-header { margin-bottom: 18px; }
  .workbench .page-header .header-actions { width: 100%; }
}
.workbench { background-image: none; background-color: var(--paper, var(--paper)); }
.workbench .desk-main { background-image: none; }
.workbench .tb-head { padding-top: 18px; }
.workbench .tb-title { font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.workbench .tb-address { margin-bottom: 8px; }
.workbench .tb-cells { padding-bottom: 14px; border-top: 0; }
.project-tasks { display: flex; gap: 26px; overflow-x: auto; border-top: 1px solid var(--line); }
.project-task { padding: 16px 8px 13px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: none; white-space: nowrap; font: 550 .95rem/1.3 var(--sans); cursor: pointer; }
.project-task:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.project-task[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.project-task:hover { color: var(--accent); }
.workbench .page-overview > .page-header { display: none; }
.workbench .room-evidence + .capture-zone { margin-top: 22px; }
.workbench .title-block { margin-bottom: 0; }
.workbench .page-header-number { display: none; }
@media (max-width: 620px) {
 .project-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; overflow: visible; }
 .project-tasks--review { grid-template-columns: repeat(4, minmax(0, 1fr)); }
 .project-task { min-width: 0; min-height: 44px; font-size: .82rem; padding: 8px 4px; white-space: normal; text-align: center; }
 .workbench .mobile-nav { display: none; }
 .workbench .project-tasks { position: sticky; top: 0; }
 .workbench .desk-main { padding-bottom: 28px; }
}
.job-intake { max-width: 1080px; }
.intake-stages { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.intake-stages .button { border: 0; background: transparent; color: var(--muted); }
.intake-stages .button[aria-current="step"] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.intake-stage { padding: 26px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 18px; }
.intake-stage > h3 { font: 500 1.6rem/1.3 var(--serif); margin-top: 0; }
.intake-stage > .button { margin: 12px 10px 0 0; }
.intake-stage > .start-field { margin: 18px 0; }
.intake-file-list.intake-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin: 22px 0; }
.intake-file-list.intake-media > li { display: flex; flex-direction: column; padding: 0; border: 0; }
.intake-preview { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--kraft); }
.intake-preview-unavailable { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--kraft); padding: 22px; }
.intake-media-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; padding: 9px 0; overflow-wrap: anywhere; }
.intake-media-caption .button { overflow: hidden; font-size: 0; flex: 0 0 38px; width: 38px; min-height: 38px; padding: 4px; }
.intake-media-caption .button::after { content: "×"; font-size: 1.25rem; }
.intake-optional { border: 0; border-top: 1px solid var(--line); padding: 24px 0 12px; }
.intake-optional > h3 { font: 500 1.4rem/1.3 var(--serif); margin: 0 0 8px; }
.intake-optional > .start-field { margin-top: 18px; }
.workbench .pane-area { display: flex; gap: 10px; }
.workbench .pane-area-meta { margin-left: auto; }
.workbench .pane-keys, .workbench .page-no { display: none; }
.plan-start { margin-top: 12px; }
.plan-start .job-card { padding-top: 0; }
.plan-start .project-start-work > h2 { margin-top: 22px; font-size: 1.3rem; }
