/* Basim Estimate — premium/tactile construction-tech UI.
   Steel accent on a warm-grey ground, Barlow Condensed over Barlow.
   Elevated cards, recessed input wells, substantial touch targets.
   The printed proposal keeps the drafting language: hairlines and
   registration marks, with every radius and shadow reset for paper. */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@400;600;700&display=swap');

:root {
  --color-bg: #eceded;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-accent-100: #eef6ff;
  --color-accent-200: #d6ebff;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-accent-900: #1d2d3d;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);
  --hairline: color-mix(in srgb, var(--color-text) 10%, transparent);
  --muted: color-mix(in srgb, var(--color-text) 52%, transparent);
  --muted-deep: color-mix(in srgb, var(--color-text) 64%, transparent);

  /* Surfaces: cards sit above the ground, inputs sit below it. */
  --surface: #ffffff;
  --surface-sunken: #e4e6e7;
  --surface-raised: #f7f8f8;

  --radius-control: 8px;
  --radius-card: 12px;
  --radius-sheet: 18px;
  --control-h: 48px;
  --control-h-lg: 56px;

  --shadow-card: 0 1px 2px rgba(29, 45, 61, .06), 0 4px 14px rgba(29, 45, 61, .08);
  --shadow-card-hover: 0 2px 4px rgba(29, 45, 61, .08), 0 10px 26px rgba(29, 45, 61, .13);
  --shadow-sheet: 0 2px 6px rgba(29, 45, 61, .08), 0 18px 44px rgba(29, 45, 61, .16);
  --shadow-button: 0 1px 2px rgba(29, 45, 61, .18), 0 4px 12px rgba(41, 97, 148, .28);
  --shadow-inset: inset 0 2px 4px rgba(29, 45, 61, .10), inset 0 0 0 1px rgba(29, 45, 61, .05);

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 16px 72px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #f6f7f7 0%, transparent 70%),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  -webkit-font-smoothing: antialiased;
}

.phone { width: 440px; max-width: 100%; }
.doc-area { width: 8.5in; max-width: 100%; }

/* ── cards: raised surfaces, not line drawings ─────────────────────── */

.blueprint {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* Registration marks belong to the document, not to the app chrome. */
.blueprint > .corner { display: none; }
.blueprint > .corner::before, .blueprint > .corner::after { content: ""; position: absolute; background: currentColor; }
.corner.tl { top: -6px; left: -6px; }
.corner.tr { top: -6px; right: -6px; }
.corner.bl { bottom: -6px; left: -6px; }
.corner.br { bottom: -6px; right: -6px; }

.sheet > .corner {
  display: block;
  position: absolute; width: 11px; height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.sheet > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.sheet > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }

/* ── type ──────────────────────────────────────────────────────────── */

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
h2 { font-size: 30px; }
h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.kicker { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent-700); font-weight: 600; }
.kicker-muted { color: var(--muted); }
.sub { font-size: 12.5px; color: var(--muted); }
.note { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
code { font-family: var(--mono); font-size: .92em; }

.masthead { margin-bottom: 20px; padding: 0 2px; }
.masthead h2 { margin: 4px 0 3px; }

section.card { padding: 20px 18px 22px; margin-bottom: 24px; }
section.card > .kicker { display: block; margin-bottom: 14px; }

/* ── inputs: recessed wells ────────────────────────────────────────── */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-deep); margin-bottom: 7px; font-weight: 600;
}
.input {
  width: 100%; min-height: var(--control-h); font: inherit; font-size: 15px;
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 12px 14px;
  box-shadow: var(--shadow-inset);
  transition: background .12s ease, box-shadow .12s ease;
}
.input:hover { background: color-mix(in srgb, var(--surface-sunken) 88%, #fff); }
.input:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
  background: var(--surface); box-shadow: none; border-color: var(--color-accent);
}
textarea.input { min-height: 118px; resize: vertical; line-height: 1.55; }
.input.numeric { font-family: var(--mono); font-size: 16px; letter-spacing: .01em; }

/* ── steppers ──────────────────────────────────────────────────────── */

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .input { text-align: center; }
.step-btn {
  flex: none; width: var(--control-h); height: var(--control-h);
  background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius-control);
  font-size: 20px; line-height: 1; color: var(--color-accent-800); cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.step-btn:hover { background: var(--color-accent-100); border-color: var(--color-accent); }
.step-btn:active { transform: translateY(1px); box-shadow: none; }
.step-btn:disabled { opacity: .38; cursor: not-allowed; background: var(--surface-raised); border-color: var(--hairline); box-shadow: none; }

/* ── derived figures: reversed, inset ──────────────────────────────── */

.derived {
  margin-top: 18px; padding: 18px 18px 16px;
  background: linear-gradient(180deg, #24374a 0%, var(--color-accent-900) 100%);
  color: #f4f6f7; border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), var(--shadow-card);
}
.derived .kicker { color: rgba(244,246,247,.62); display: block; margin-bottom: 8px; }
.derived .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; }
.derived .row + .row { border-top: 1px solid rgba(255,255,255,.14); }
.derived .row span:first-child { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .74; }
.derived .row span:last-child { font-family: var(--mono); font-size: 15px; }
.derived .row.total { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.42); }
.derived .row.total span:first-child { opacity: 1; }
.derived .row.total span:last-child { font-family: var(--font-heading); font-weight: 700; font-size: 30px; letter-spacing: -.01em; }

/* ── buttons ───────────────────────────────────────────────────────── */

.btn {
  flex: 1; min-height: var(--control-h); padding: 13px 16px;
  border-radius: var(--radius-control); cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface-raised); color: var(--color-accent-800);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-card);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { background: var(--color-accent-100); border-color: var(--color-accent); box-shadow: var(--shadow-card-hover); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary {
  flex: 1.6;
  background: linear-gradient(180deg, #6a90b5 0%, var(--color-accent) 55%, #4d7396 100%);
  border-color: var(--color-accent-700); color: #fff;
  box-shadow: var(--shadow-button), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-primary:hover { background: linear-gradient(180deg, #759bc0 0%, #5c85ab 55%, #47698a 100%); border-color: var(--color-accent-800); color: #fff; }
.btn-block { width: 100%; flex: none; min-height: var(--control-h-lg); margin-top: 16px; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ── estimate list ─────────────────────────────────────────────────── */

.estimate-list, .sign-in { padding: 20px 18px 22px; }
.btn-signout { flex: none; margin-top: 12px; min-height: 40px; padding: 9px 16px; font-size: 12px; }
.est-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; min-height: var(--control-h-lg); padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; text-align: left;
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
  font: inherit; color: var(--color-text);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.est-row:hover { background: var(--color-accent-100); border-color: var(--color-accent); box-shadow: var(--shadow-card-hover); }
.est-row:active { transform: translateY(1px); }
.est-row.is-open { border-color: var(--color-accent); background: var(--color-accent-100); box-shadow: var(--shadow-card-hover); }
.est-row .est-id { font-family: var(--mono); font-size: 10.5px; color: var(--color-accent-700); letter-spacing: .04em; }
.est-row .est-client { font-size: 14.5px; line-height: 1.25; font-weight: 500; }
.est-row .est-status { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.est-row .est-total { font-family: var(--font-heading); font-weight: 700; font-size: 18px; }
.est-empty { font-size: 12px; color: var(--muted); padding: 4px 2px; }

/* ── send panel ────────────────────────────────────────────────────── */

.send-panel { margin-top: 24px; padding: 20px 18px 22px; }
.send-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.status-chip {
  flex: none; padding: 7px 12px; border: 1px solid var(--hairline);
  border-radius: var(--radius-control); background: var(--surface-raised);
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-deep); font-weight: 600;
}
.status-chip.is-sent { border-color: var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); }
.status-chip.is-accepted { border-color: var(--color-accent-900); background: var(--color-accent-900); color: #f4f6f7; }
.btn-send { width: 100%; flex: none; min-height: var(--control-h-lg); margin-top: 16px; }
.btn-send:disabled {
  opacity: .45; cursor: not-allowed; box-shadow: none; transform: none;
  background: linear-gradient(180deg, #8fa8bf 0%, #7e97ae 100%);
}

.history { margin-top: 16px; }
.history:empty { display: none; }
.history .h-label { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.history .h-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-deep);
}
.history .h-row .h-when { color: var(--color-text); }
.history .h-tag { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-accent-700); }
.history .h-open {
  width: 100%; min-height: var(--control-h); margin-bottom: 8px; font: inherit;
  font-family: var(--mono); font-size: 10.5px; text-align: left; cursor: pointer;
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-control); box-shadow: var(--shadow-card);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.history .h-open:hover { background: var(--color-accent-100); border-color: var(--color-accent); box-shadow: var(--shadow-card-hover); }
.history .h-open:active { transform: translateY(1px); box-shadow: none; }

.accept-link { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.accept-link .kicker { display: block; margin-bottom: 8px; }
.link-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 7px; }
.link-text {
  flex: 1; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--color-accent-200); border-radius: var(--radius-control);
  font-family: var(--mono); font-size: 10px; line-height: 1.45;
  color: var(--color-accent-800); word-break: break-all; background: var(--color-accent-100);
}
.link-copy { flex: 0 0 84px; min-height: var(--control-h); padding: 10px 0; font-size: 11px; }

.accepted-panel {
  margin-top: 18px; padding: 18px;
  background: linear-gradient(180deg, #24374a 0%, var(--color-accent-900) 100%);
  color: #f4f6f7; border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), var(--shadow-card);
}
.accepted-panel .kicker { color: rgba(244,246,247,.62); display: block; margin-bottom: 7px; }
.accepted-panel .note { color: rgba(244,246,247,.66); margin-top: 10px; }
.accepted-panel .mono { color: rgba(244,246,247,.74); }
.accepted-name { font-family: var(--font-heading); font-weight: 600; font-size: 19px; line-height: 1.2; }
.accepted-sig {
  display: block; width: 100%; max-width: 260px; margin-top: 12px;
  background: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-control);
}

.actions { display: flex; gap: 10px; margin-top: 18px; }
.error {
  margin-top: 12px; padding: 10px 12px; font-size: 12px;
  color: var(--color-accent-800); background: var(--color-accent-100);
  border-left: 3px solid var(--color-accent); border-radius: var(--radius-control);
}
.error:empty { display: none; }
.toast { margin-top: 12px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-accent-700); min-height: 14px; }
.footnote { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--hairline); }

/* ═══ the proposal sheet — letter, and what prints ═══════════════════ */

.sheet {
  width: 8.5in; max-width: 100%; min-height: 11in;
  display: flex; flex-direction: column;
  padding: .7in .75in .55in;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-sheet);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}

.s-label { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: 6px; }

.letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 13px; border-bottom: 2px solid var(--color-accent-900); }
.company-name { font-family: var(--font-heading); font-weight: 700; font-size: 31px; line-height: 1; letter-spacing: .005em; text-transform: uppercase; color: var(--color-accent-900); }
.company-tag { font-size: 10.5px; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.company-contact { font-size: 10.5px; line-height: 1.55; color: var(--muted); margin-top: 6px; }
.lh-meta { flex: none; text-align: right; }
.doc-type { font-family: var(--font-heading); font-weight: 600; font-size: 16px; letter-spacing: .24em; text-transform: uppercase; color: var(--color-accent-700); }
.meta-list { margin: 8px 0 0; font-family: var(--mono); font-size: 10px; }
.meta-list > div { display: flex; justify-content: flex-end; gap: 10px; padding: 1px 0; }
.meta-list dt { letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.meta-list dd { margin: 0; min-width: .95in; text-align: right; color: var(--color-text); }

.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding-top: 18px; }
.party-name { font-family: var(--font-heading); font-weight: 600; font-size: 17px; line-height: 1.2; }
.party-line { font-size: 11.5px; line-height: 1.45; color: var(--muted-deep); margin-top: 2px; }

.sheet-section { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--hairline); }
.scope-body { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }

.pricing .line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; font-size: 12.5px; border-bottom: 1px solid var(--hairline); }
.pricing .line span:last-child { font-family: var(--mono); font-size: 13px; }
.pricing .line.discount span { color: var(--color-accent-700); }
.grand-total {
  margin-top: 13px; padding: 16px 18px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  background: var(--color-accent-900); color: #fff; border-radius: var(--radius-control);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.gt-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .72; }
.gt-value { font-family: var(--font-heading); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: -.02em; }

.terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.term-list { margin: 0; padding: 0; list-style: none; }
.term-list li { position: relative; padding-left: 11px; margin-bottom: 6px; font-size: 10.5px; line-height: 1.5; color: var(--muted-deep); }
.term-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 1px; background: var(--color-accent); }

.acceptance { margin-top: auto; }
.accept-note { font-size: 11px; line-height: 1.5; color: var(--muted-deep); margin: 0 0 22px; max-width: 5.6in; }
.sig-row { display: flex; gap: 26px; margin-bottom: 15px; }
.sig { flex: 1; }
.sig-short { flex: 0 0 1.9in; }
.sig-line { display: block; height: 1px; background: color-mix(in srgb, var(--color-text) 45%, transparent); margin-bottom: 5px; }
.sig-cap { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.sheet-footer { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ═══ client acceptance page ═════════════════════════════════════════ */

.accept-body { display: block; padding: 32px 16px 80px; }
.accept-page { max-width: 720px; margin: 0 auto; }
.accept-state { max-width: 480px; margin: 0 auto; }
.accept-head { margin-bottom: 20px; padding: 0 2px; }
.accept-head h2 { margin: 5px 0 3px; }
.problem-text { font-size: 14px; line-height: 1.5; margin: 10px 0 12px; }

.paper {
  display: block; width: 100%; height: 78vh; min-height: 460px;
  border: 1px solid var(--hairline); background: #fff;
  border-radius: var(--radius-sheet); box-shadow: var(--shadow-sheet);
}

.sign-card, .receipt { margin-top: 24px; padding: 22px 20px 24px; }

.sig-pad {
  position: relative; background: var(--surface-sunken);
  border: 1px solid transparent; border-radius: var(--radius-card);
  box-shadow: var(--shadow-inset);
}
.sig-pad canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-clear {
  position: absolute; top: 10px; right: 10px;
  min-height: 36px; padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-control);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-deep); cursor: pointer; box-shadow: var(--shadow-card);
}
.sig-clear:hover { border-color: var(--color-accent); color: var(--color-accent-700); background: var(--color-accent-100); }

.agree { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.agree input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--color-accent); }
.btn-accept { width: 100%; flex: none; min-height: var(--control-h-lg); margin-top: 20px; font-size: 14px; }
.btn-accept:disabled {
  opacity: .45; cursor: not-allowed; box-shadow: none; transform: none;
  background: linear-gradient(180deg, #8fa8bf 0%, #7e97ae 100%);
}

.receipt-name { font-family: var(--font-heading); font-weight: 700; font-size: 22px; margin-top: 8px; }
.receipt-sig {
  display: block; width: 100%; max-width: 340px; margin: 14px 0 4px;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-control);
}

/* ── print: the sheet alone, flat, edge to edge of the page margin ─── */

/* ── AI-assisted drafting ──────────────────────────────────────────── */

.btn-quiet {
  flex: none; min-height: 36px; padding: 7px 14px; font-size: 12px;
  background: transparent; box-shadow: none; color: var(--muted-deep);
}
.btn-quiet:hover { background: var(--color-accent-100); box-shadow: none; }
.btn-inline { margin: 0; }

.ai-progress {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  background: var(--surface-sunken); border-radius: var(--radius-control);
  box-shadow: var(--shadow-inset);
  font-size: 12.5px; color: var(--muted-deep);
}
.ai-spinner {
  width: 14px; height: 14px; flex: none;
  border: 2px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ai-spinner { animation-duration: 2.4s; }
}

.ai-banner {
  margin: 4px 0 16px; padding: 10px 12px;
  background: var(--color-accent-100);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-control);
  font-size: 11.5px; line-height: 1.5; color: var(--color-accent-900);
}

.ai-section { margin-bottom: 20px; }
.ai-section > .kicker { display: block; margin: 16px 0 8px; }
.ai-section > .kicker:first-child { margin-top: 0; }

.ai-list { margin: 0 0 4px; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: var(--muted-deep); }
.ai-list li { margin-bottom: 4px; }
.ai-list:empty { display: none; }

.ai-item {
  padding: 12px 14px; margin-bottom: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius-control);
}
.ai-item-head { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.ai-item-meta {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px;
}

.ai-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; font-size: 12.5px;
}
.ai-row + .ai-row { border-top: 1px solid var(--hairline); }
.ai-row span:last-child { font-family: var(--mono); font-size: 12px; }
.ai-row.is-missing span:last-child { color: var(--muted); font-style: italic; }

.ai-edit-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ai-edit-row label {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-deep); font-weight: 600;
}
.ai-edit-row .input { min-height: 40px; padding: 8px 12px; max-width: 120px; }

/* A missing price is a finding, not a footnote: it is the difference
   between a total and a guess. */
.ai-missing {
  margin-top: 14px; padding: 12px 14px;
  background: color-mix(in srgb, #b4762a 10%, var(--surface));
  border-left: 3px solid #b4762a;
  border-radius: var(--radius-control);
}
.ai-missing-head {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; color: #7c4f14; margin-bottom: 8px;
}
.ai-missing .ai-list { color: #7c4f14; }

.ai-total { margin-top: 18px; }
.ai-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ai-actions .btn { min-width: 96px; }

@media print {
  body { display: block; padding: 0; gap: 0; background: #fff; }
  .no-print { display: none !important; }
  .doc-area { width: auto; max-width: none; }
  .sheet {
    width: auto; max-width: none; min-height: 0; padding: 0;
    border: 0; border-radius: 0; box-shadow: none; display: block;
  }
  .grand-total { border-radius: 0; }
  .letterhead, .parties, .sheet-section, .sig-row { break-inside: avoid; }
  .acceptance { margin-top: .3in; }
  .sheet-footer { margin-top: .25in; }
  @page { size: letter; margin: .6in .7in; }
}

/* ── the workspace pricebook ───────────────────────────────────────── */

.pb-head { display: block; margin: 22px 0 10px; }
.pb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pb-grid .field { margin-bottom: 12px; }
.pb-grid .input { min-height: 42px; padding: 9px 12px; font-size: 14px; }

.pb-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pb-chip {
  padding: 5px 11px; font-size: 11px; letter-spacing: .04em;
  background: var(--surface-raised); color: var(--muted-deep);
  border: 1px solid var(--hairline); border-radius: 999px; cursor: pointer;
}
.pb-chip:hover { border-color: var(--color-accent); color: var(--color-accent-800); }
.pb-chip.is-on {
  background: var(--color-accent-100); border-color: var(--color-accent);
  color: var(--color-accent-900); font-weight: 600;
}

.pb-row {
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius-control);
}
.pb-row.is-inactive { opacity: .55; }
.pb-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pb-row-head span:first-child { font-size: 13.5px; font-weight: 500; }
.pb-row-head span:last-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.pb-row-meta {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px; line-height: 1.5;
}

/* A rate nobody has set reads as a gap, never as a number. */
.pb-missing {
  color: #7c4f14; font-family: var(--font-body) !important;
  font-size: 11px !important; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.pb-deactivate { margin-top: 8px; min-height: 30px; padding: 5px 10px; font-size: 11px; }

.pb-add { margin: 6px 0 4px; }
.pb-add > summary {
  cursor: pointer; font-size: 12px; color: var(--color-accent-700);
  padding: 8px 2px; font-weight: 500;
}
.pb-add[open] > summary { margin-bottom: 10px; }
