/* ═══════════════════════════════════════════
   STAGE PILLS (used everywhere)
═══════════════════════════════════════════ */
.stage-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
}

/* ═══════════════════════════════════════════
   WORKSPACE LEDGERS — shared anatomy for operational list pages.
   The topbar owns location; this header owns purpose, counts, filters, and
   actions. Rows carry records. Cards are reserved for genuine grouped detail.
═══════════════════════════════════════════ */
.workspace-ledger {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
}

.workspace-ledger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface), var(--surface-hi));
}

.workspace-ledger__identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.workspace-ledger__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brass) 20%, transparent);
  border-radius: 9px;
}

.workspace-ledger__title {
  margin: 0;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}

.workspace-ledger__subtitle {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.workspace-ledger__tools,
.workspace-ledger__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-ledger__count {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.manage-workspace-head { margin-bottom: 12px; }
.manage-workspace-head .workspace-ledger__head { min-height: 68px; }

/* A ledger supplies the outside radius. Tables and full-width subsections
   joined inside it should read as one workspace, not as stacked cards. */
.workspace-ledger > .table-wrap,
.workspace-ledger > .workspace-section,
.workspace-ledger .workspace-section > .table-wrap,
.workspace-ledger .lowes-coverage-section > .table-wrap {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.workspace-metric {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--border-lo);
}

.workspace-metric:last-child { border-right: 0; }
.workspace-metric strong {
  display: block;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
}
.workspace-metric span {
  display: block;
  margin-top: 5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.workspace-metric--warn strong { color: var(--warning); }
.workspace-metric--danger strong { color: var(--danger); }
.workspace-metric--good strong { color: var(--success); }

.workspace-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hi);
}
.workspace-filter .form-group { margin: 0; min-width: 140px; }
.workspace-filter .form-control { min-height: 36px; }

.workspace-empty {
  display: flex;
  min-height: 240px;
  padding: 34px 22px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: var(--text-3);
  text-align: center;
}
.workspace-empty__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, var(--surface));
  border-radius: 999px;
  font-size: 16px;
}
.workspace-empty strong {
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 16px;
}
.workspace-empty p { margin: 0; max-width: 48ch; font-size: 12px; line-height: 1.5; }

.workspace-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Canonical in-card header: title and icon on the left, compact context or
   action on the right. Page/workspace headers intentionally keep their own
   hierarchy; this is for the contents of a card or ledger section. */
.card-section-head,
.detail-card > .flex-between:first-child,
.panel > .flex-between:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-section-head {
  min-height: 24px;
  margin-bottom: 14px;
}
.card-section-head__title,
.card-section-head > .detail-card-title,
.card-section-head > .panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
}
.card-section-head__title i,
.card-section-head > .detail-card-title i,
.card-section-head > .panel-title i {
  color: var(--brass);
  font-size: 13px;
}
.card-section-head__meta {
  flex: 0 0 auto;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.workspace-section-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.workspace-section-head h2 i { color: var(--brass); }
.workspace-section-head small { color: var(--text-3); font-family: var(--font-mono); }

.profile-settings-workspace,
.ai-review-workspace {
  max-width: 840px;
}
.profile-settings-workspace__body,
.ai-review-workspace__body {
  padding: 18px;
}
.profile-settings-workspace form { max-width: 720px; }
.profile-settings-workspace .form-actions { margin-bottom: 0; }
.form-help {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.45;
}
.ai-review-workspace__explanation {
  max-width: 78ch;
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
}
.ai-review-workspace__body .svr-row {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.ai-review-workspace__foot { justify-content: flex-start; }
.ai-review-workspace__foot a { color: var(--brass-lo); font-weight: 600; text-decoration: none; }

.pricing-disclosure__toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pricing-disclosure__toggle .chevron { transition: transform 0.14s ease; }
.pricing-disclosure__toggle .chevron.is-collapsed { transform: rotate(-90deg); }

.flash-dismiss {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.public-slot-button,
.public-callback-button { transition: border-color 0.15s, transform 0.1s; }
.public-slot-button:hover,
.public-callback-button:hover { border-color: var(--brass, #b8731a) !important; }

@media (max-width: 700px) {
  .workspace-ledger__head { align-items: flex-start; flex-direction: column; }
  .workspace-ledger__tools,
  .workspace-ledger__actions { justify-content: flex-start; width: 100%; }
  .workspace-filter { align-items: stretch; }
  .workspace-filter .form-group { flex: 1 1 100%; }
  .workspace-filter .btn-primary,
  .workspace-filter .btn-ghost-sm { justify-content: center; min-height: 42px; }
  .workspace-metric { border-bottom: 1px solid var(--border-lo); }
}

.users-table__identity,
.users-table__badges,
.users-table__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.users-table__identity .user-avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: 11px; }
.users-table__identity span:last-child { min-width: 0; }
.users-table__identity strong,
.users-table__identity small { display: block; }
.users-table__identity small { margin-top: 2px; color: var(--text-3); font-size: 11px; }
.users-table__badges { flex-wrap: wrap; }
.users-table__actions { justify-content: flex-end; flex-wrap: wrap; }
.users-table__actions form { margin: 0; }
.user-form-workspace { max-width: 860px; }
.user-form-workspace--wide { max-width: 1040px; }
.user-form-workspace--narrow { max-width: 760px; }
.user-form-workspace__body { padding: 18px 20px 20px; }
.user-form-workspace .form-actions { margin: 20px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-hi); }
.user-form-workspace .detail-field-grid { margin: 0; }
.job-edit-layout { max-width: 1040px; }
.job-edit-form { min-width: 0; }
.job-edit-workspace { overflow: visible; }
.job-edit-section-body { padding: 18px 20px 4px; }
.job-edit-section-body > :last-child { margin-bottom: 14px; }
.job-edit-field--constrained { max-width: 560px; }
.job-edit-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.job-edit-choice {
  display: inline-flex !important;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.job-edit-choice:has(input:checked) { border-color: color-mix(in srgb, var(--brass) 55%, var(--border)); background: color-mix(in srgb, var(--brass) 8%, var(--surface)); color: var(--text-1); }
.job-edit-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--brass); }
.job-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-hi); }
.job-edit-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 16px; }
.job-edit-danger-zone strong { display: block; color: var(--text-1); font-size: 12px; }
.job-edit-danger-zone p { margin: 3px 0 0; color: var(--text-3); font-size: 11px; }
.job-edit-danger-zone form { margin: 0; }
.job-edit-danger-zone__action { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 42%, var(--border)) !important; }
.workspace-notice { display:flex; align-items:flex-start; gap:10px; margin:0 0 12px; padding:11px 14px; border:1px solid var(--border); background:var(--surface); color:var(--text-2); font-size:12px; line-height:1.5; }
.workspace-notice i { margin-top:3px; color:var(--brass); }
.workspace-notice p { margin:0; }
.workspace-notice--warning { border-left:3px solid var(--warning); }
.workspace-notice--danger { border-left:3px solid var(--danger); }
.workspace-notice--danger i { color:var(--danger); }

@media (max-width: 760px) {
  .job-edit-section-body { padding: 16px 14px 2px; }
  .job-edit-actions { align-items: stretch; flex-direction: column-reverse; padding: 12px 14px; }
  .job-edit-actions .btn-primary,
  .job-edit-actions .btn-ghost-sm { justify-content: center; width: 100%; min-height: 42px; }
  .job-edit-danger-zone { align-items: stretch; flex-direction: column; }
  .job-edit-danger-zone__action { justify-content: center; width: 100%; min-height: 42px; }
  .users-table table,
  .crews-table table { min-width: 760px; }
}
.stage-pill--wrap {
  max-width: 100%;
  white-space: normal;
  line-height: 1.3;
  text-align: left;
}
.sp-new {
  background: #f1f5f9;
  color: #627188;
}
.sp-visit {
  background: #eff6ff;
  color: #2563eb;
}
.sp-estimate {
  background: #e0f2fe;
  color: #0172ad;
}
.sp-sold {
  background: #f0fdf4;
  color: #12853c;
}
.sp-preprod {
  background: #fffbeb;
  color: #b45309;
}
.sp-scheduled {
  background: #fff7ed;
  color: #c2410c;
}
.sp-inprog {
  background: var(--brass-pill);
  color: var(--brass-lo);
}
.sp-punch {
  background: #fefce8;
  color: #854d0e;
}
.sp-complete {
  background: #f0fdf4;
  color: #15803d;
}
.sp-lost {
  background: #fef2f2;
  color: #d92525;
}
.sp-cancelled {
  background: #f8fafc;
  color: #697382;
}

/* Contact type pills */
.ctp-lead {
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}
.ctp-customer {
  background: #f0fdf4;
  color: var(--s-complete);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}

/* Status pills for contacts */
.csp-new {
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  display: inline-block;
}
.csp-contacted {
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  display: inline-block;
}
.csp-converted {
  background: #f0fdf4;
  color: var(--s-complete);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  display: inline-block;
}
.csp-lost {
  background: #fef2f2;
  color: #dc2626;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  display: inline-block;
}

/* Service tags */
.stag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
}

/* ═══════════════════════════════════════════
   LEDGER
   The shared operational list surface. Pages own their grid tracks and
   lifecycle colors; this primitive owns the house surface, rules and type.
═══════════════════════════════════════════ */
.ledger {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.ledger__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 10px;
  padding: 11px 14px;
  background: var(--surface-lo);
  border-bottom: 1px solid var(--border);
}
.ledger__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 14px;
  background: var(--surface-lo);
  border-top: 1px solid var(--border);
}
.ledger__columns {
  padding: 9px 14px 9px 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.ledger__columns > * {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
}
.ledger__row {
  background: var(--surface);
  padding: 11px 14px 11px 0;
  transition: background-color 0.12s;
}
.ledger__row + .ledger__row {
  border-top: 1px solid var(--border-lo);
}
.ledger__row:hover {
  background: rgba(184, 146, 74, 0.055);
}
.ledger__group {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
}
.ledger__empty a {
  color: var(--brass);
}

/* Shared ledger-head furniture. The installs ledger predates these names and
   keeps its own .jobs-ledger__count (see pages/jobs.css); every other ledger
   head uses the primitives below. Workflow lanes are NOT in here on purpose —
   they belong in the topbar's workspace strip, where Jobs and Follow-ups both
   put them. */
.ledger__count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  white-space: nowrap;
}
/* [#3] The narrowed-state chip sits beside the count, because the count is
   already the head's statement of "what am I looking at". Its ✕ removes only
   the search. */
.narrow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.narrow-chip__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 10px;
  text-decoration: none;
}
.narrow-chip__clear:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
/* The filter row is the head's right-hand slot: no submit button ever, only
   auto-submitting controls and a Clear link when something is narrowed.
   Selects are capped so one long option ("All production stages") cannot set
   the row's width — that cap plus short zero-state labels is what keeps three
   filters on one line. */
.ledger__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.ledger__filters .select-filter,
.ledger__filters .search-input-inline {
  min-height: 34px;
}
.ledger__filters .select-filter {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 190px;
  text-overflow: ellipsis;
}
/* Below the head's comfortable width the row stops floating and becomes an
   aligned grid on its own line under the tabs and count: two equal columns,
   full-width controls, one gap. Ragged two-line wrapping was the whole
   complaint. */
@media (max-width: 900px) {
  .ledger__filters {
    flex: 1 1 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }
  .ledger__filters .select-filter,
  .ledger__filters .search-input-inline,
  .ledger__filters .btn-ghost-sm {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .ledger__filters {
    grid-template-columns: 1fr;
  }
  .ledger__filters .select-filter,
  .ledger__filters .btn-ghost-sm {
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════
   PANELS / CARDS
═══════════════════════════════════════════ */
/* No hover: a panel is a surface, not a control. */
.panel {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.panel-title > i {
  margin-right: 7px;
  color: var(--brass);
  font-size: 13px;
}

/* No hover: a card is a surface, not a control. */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: 14px;
}
.detail-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 14px;
}
.detail-card-title > i {
  color: var(--brass);
  font-size: 13px;
}

/* [wave-ui-polish] Lead Loop cadence panel rows — reuses .detail-card's
   spacing convention (var(--border-lo) row dividers, var(--text-3) meta
   text) instead of the ad hoc inline styles it shipped with. */
.lead-loop-cadence-row {
  padding: 10px 0;
}
.lead-loop-cadence-row--rule {
  border-top: 1px solid var(--border-lo);
}
.lead-loop-cadence-row__line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-loop-cadence-row__meta {
  color: var(--text-3);
  font-size: 12px;
}
.lead-loop-cadence-touches {
  margin-top: 8px;
}
.lead-loop-cadence-touches > summary {
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
}
.lead-loop-cadence-touches__list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 12px;
}
.lead-loop-cadence-touches__list li {
  padding: 4px 0;
  color: var(--text-3);
}
.lead-loop-cadence-touches__status--ok {
  color: var(--success);
}
.lead-loop-cadence-touches__status--blocked {
  color: var(--danger);
}

/* ═══════════════════════════════════════════
   DETAIL FIELD GRID
═══════════════════════════════════════════ */
.detail-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}
.detail-field {
  min-width: 0;
}
.detail-field label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 3px;
}
.detail-field .val {
  font-size: 13.5px;
  color: var(--text-1);
  font-weight: 500;
}
.detail-field .val.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════
   BADGES (legacy / compat)
═══════════════════════════════════════════ */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  display: inline-block;
}
.badge-new {
  background: #f1f5f9;
  color: #475569;
}
.badge-warning {
  background: #fffbeb;
  color: #b45309;
}
.badge-active {
  background: #f0fdf4;
  color: var(--s-complete);
}
.badge-lost {
  background: #fef2f2;
  color: #b91c1c;
}
.badge-neutral {
  background: #f8fafc;
  color: #697382;
}
.badge-brass {
  background: var(--brass-pill);
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
/* [wave-ui-polish] Territory Assignments' inline "close this row" form. */
.territory-close-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.territory-close-form__reason {
  max-width: 220px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-1);
  background: var(--surface);
  transition: border-color 0.15s;
  appearance: none;
}
.form-control:focus:not(:focus-visible) {
  outline: none;
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%239aabb8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-control:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-soft);
}
textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row--three {
  grid-template-columns: repeat(3, 1fr);
}
.form-row--city-state-zip {
  grid-template-columns: 2fr 1fr 1fr;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border-lo);
}

/* ═══════════════════════════════════════════
   MINI FORM
   The small edit forms that open inside a card (HOA, 811, and their kin).
   One field grid, one muted note voice, one right-aligned action row — so
   every inline editor on a tab lines up with the next.
═══════════════════════════════════════════ */
.mini-form {
  margin-top: 12px;
}
.mini-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
  align-items: end;
}
.mini-form__field--wide {
  grid-column: 1 / -1;
}
.mini-form__field label:not(.toggle),
.mini-form__label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-3);
}
.mini-form .form-control {
  padding: 6px 8px;
  font-size: 12px;
}
/* A value the form shows but cannot edit — same box, no affordance. */
.mini-form__readonly {
  background: var(--surface-hi);
}
.mini-form__note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.45;
}
.mini-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.mini-form__actions .btn-primary,
.mini-form__actions input[type="submit"],
.mini-form__actions .btn-ghost-sm {
  font-size: 12px;
  padding: 6px 14px;
}
/* Progressive disclosure: the field only matters while the toggle is on. */
.mini-form:not(:has(.toggle__input:checked)) .mini-form__field--on-toggle {
  display: none;
}

/* Toggle switch — a checkbox that reads as a state, not a tickbox. */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.toggle__track {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.18s ease;
}
.toggle__track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}
.toggle__input:checked + .toggle__track {
  background: var(--brass);
}
.toggle__input:checked + .toggle__track::before {
  transform: translateX(16px);
}
.toggle__input:focus-visible + .toggle__track {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.toggle__text {
  font-size: 12.5px;
  color: var(--text-1);
}
@media (pointer: coarse) {
  .toggle {
    min-height: 44px;
  }
}

/* Form page layout: form on left, context sidebar on right.
   Used by users/edit, companies/edit, jobs/new, jobs/edit and any
   other view that pairs an editable form with a context panel.
   Collapses to a single stacked column under 1024px. */
.form-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
  gap: 20px;
  align-items: start;
  max-width: 1280px;
}
@media (max-width: 1024px) {
  .form-page-grid {
    grid-template-columns: 1fr;
  }
}

/* 2-column inline grid for zone-form Label / Center fields. Stacks on
   narrow widths so placeholder text doesn't truncate at 320–375px. */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .form-2col {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-wrap {
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

/* [wave-ui-polish] Simple centered pager for plain .table-wrap listings
   (e.g. Office Tasks) — mirrors .sched-availability__pager's centered
   layout, scoped here since .table-wrap is the shared listing wrapper. */
.office-tasks__pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.office-tasks__pager-state {
  font-size: 12px;
  color: var(--text-3);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 10px 14px;
  text-align: left;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-lo);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
td a {
  color: var(--brass-lo);
}
td a:hover {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════ */
.sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sec-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
}
.sec-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--brass-lo);
  cursor: pointer;
}
.sec-link:hover {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   FILTER TABS (pill style)
═══════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ftab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}
.ftab:hover {
  border-color: var(--text-3);
  color: var(--text-1);
}
.ftab.active {
  background: var(--text-1);
  border-color: var(--text-1);
  color: #fff;
}
.ftab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.ftab-n {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition:
    color 0.12s,
    border-color 0.12s;
  margin-bottom: -1px;
}
.tab-btn:hover {
  color: var(--text-1);
}
.tab-btn.active {
  color: var(--brass-lo);
  border-bottom-color: var(--brass);
}
.tab-btn i,
.tab-btn svg {
  pointer-events: none;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.tab-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  color: var(--text-3);
  font-size: 12px;
}
.tab-loading i {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   APPLICATION MODAL

   Shared by operational dialogs, drawers, and document previews. This
   replaces the deleted Virtual Visit naming rather than reviving a
   feature-specific prefix for a global interaction primitive.
═══════════════════════════════════════════ */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(12, 25, 42, 0.62);
}
.app-modal-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(12, 25, 42, 0.28);
}
.app-modal-dialog--wide {
  width: min(100%, 760px);
}
.app-modal-dialog--preview {
  width: min(95vw, 900px);
  height: min(92dvh, 900px);
  max-height: 92dvh;
}
.app-modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--border-lo);
  background: var(--surface);
}
.app-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.app-modal-title-detail {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.4;
}
.app-modal-close {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.app-modal-close:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.app-modal-close:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 1px;
}
.app-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}
.app-modal-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #525659;
}
.app-modal-text {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.app-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-lo);
  background: var(--surface-lo);
}
.app-modal-footer--split {
  justify-content: space-between;
  margin: 0;
}
.app-modal-footer__status {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.4;
}
.app-modal-footer__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.app-form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.app-form-row--inline {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.app-form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-form-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
}
textarea.app-form-input {
  min-height: 88px;
  resize: vertical;
}
.app-form-input:focus {
  border-color: var(--info);
  outline: 3px solid rgba(59, 130, 246, 0.14);
}
.permit-rule-findings {
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface-hi);
}
.permit-rule-findings > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.permit-rule-findings > summary::marker {
  color: var(--text-3);
}
.permit-rule-findings > summary i {
  color: var(--brass-lo);
}
.permit-rule-findings__content {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 0 12px 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}
@media (max-width: 600px) {
  .app-modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }
  .app-modal-dialog,
  .app-modal-dialog--wide {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }
  .app-modal-dialog--preview {
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .app-modal-header {
    min-height: 56px;
    padding: 6px 6px 6px 16px;
  }
  .app-modal-body {
    padding: 16px;
  }
  .app-modal-footer {
    margin: 16px -16px -16px;
    padding: 12px 16px;
  }
  .app-modal-footer--split {
    align-items: stretch;
    flex-direction: column;
    margin: 0;
  }
  .app-modal-footer__actions > * {
    flex: 1 1 auto;
  }
  .app-form-row--inline {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .permit-rule-modal .app-form-input,
  .permit-rule-modal .app-modal-footer .btn-primary,
  .permit-rule-modal .app-modal-footer .btn-ghost-sm {
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════
   JOB SHOW · HEADER (#14)
   One composed surface — identity, ledger meta line, and the section tabs in
   a single sticky ledger head. It condenses on scroll instead of handing off
   to a second bar, so the page never runs two headers that trade places.
═══════════════════════════════════════════ */
.job-ledger-sentinel {
  display: block;
  height: 1px;
}
.job-ledger {
  position: sticky;
  /* Dock against the scrollport's own top edge, not below the page padding,
     so no content shows in the band above the header while it is stuck. */
  top: calc(-1 * var(--view-pad-top, 0px));
  /* Above page content and any banner below it: the sticky header is its own
     stacking context, so an open header menu can only escape the content
     underneath if the header itself outranks it. */
  z-index: 30;
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--surface);
  /* No overflow clipping here — the header's own dropdowns (More, salesperson)
     have to hang past its bottom edge. */
}
/* One background for the whole composed header — the head band and the section
   tab strip share the card's surface, separated only by the hairline. */
.job-ledger__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 11px 20px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border-lo);
}
.job-ledger__identity {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.job-ledger__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-1);
}
.job-ledger__title a {
  color: inherit;
  text-decoration: none;
}
.job-ledger__title a:hover {
  color: var(--brass-lo);
  text-decoration: underline;
}
.job-ledger__address {
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 13px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-ledger__address:hover {
  color: var(--brass-lo);
  text-decoration: underline;
}
.job-ledger__badge--remote {
  white-space: nowrap;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
  font-size: 9px;
}
.job-ledger__badge--remote i {
  margin-right: 3px;
}
.job-ledger__facts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-width: 0;
}
/* Condensed: the facts line collapses, identity and tabs stay put. */
.job-ledger.is-condensed {
  box-shadow: 0 8px 22px rgba(28, 46, 66, 0.1);
}
.job-ledger.is-condensed .job-ledger__facts {
  display: none;
}
.job-ledger.is-condensed .job-ledger__head {
  padding-top: 8px;
  padding-bottom: 8px;
}
.job-ledger.is-condensed .job-ledger__title {
  font-size: 16px;
}
.job-ledger__fact {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 240px;
  padding: 0;
  color: inherit;
  text-decoration: none;
}
.job-ledger__fact[href]:hover {
  color: var(--brass-lo);
}
.job-ledger__fact--select {
  position: relative;
  max-width: 260px;
}
.job-ledger__fact--select > summary {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}
.job-ledger__fact--select > summary::-webkit-details-marker {
  display: none;
}
.job-ledger__fact--select > summary:hover .job-ledger__fact-value,
.job-ledger__fact--select[open] > summary .job-ledger__fact-value {
  color: var(--brass-lo);
}
.job-ledger__fact--select i {
  flex-shrink: 0;
  font-size: 8px;
  color: var(--text-3);
  transform: translateY(-1px);
}
.job-ledger__fact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  flex-shrink: 0;
}
.job-ledger__fact-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.job-ledger__actions {
  grid-column: 2;
  grid-row: 1;
  flex-shrink: 0;
}
/* [#14] A blocked production gate reads as a warning indicator, not a button. */
.job-ledger__blocked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 999px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.job-ledger__blocked:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.job-ledger__blocked i {
  font-size: 10px;
}
.job-header-actions-menu__panel.job-ledger__blocked-panel {
  /* Wide enough that a normal correction reason is readable as you type it. */
  min-width: 390px;
  padding: 12px;
}
.job-ledger__blocked-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 0;
}
.job-ledger__blocked-form .form-control {
  width: 100%;
}
.job-ledger__blocked-form button[type="submit"] {
  align-self: flex-end;
}

/* [#14] "More" is a soft trigger, not a bordered button. */
.job-ledger__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-size: 12.5px;
}
.job-ledger__more:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.job-header-select__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 230px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  box-shadow: var(--shadow-lg);
}
.job-header-select__form {
  margin: 0;
}
.job-header-select__select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 12px;
}
.job-header-actions-menu {
  position: relative;
}
.job-header-actions-menu > summary {
  list-style: none;
  cursor: pointer;
}
.job-header-actions-menu > summary::-webkit-details-marker {
  display: none;
}
.job-header-actions-menu--lowes > summary {
  gap: 5px;
}
.job-ledger__badge-chevron {
  margin-left: 1px;
  font-size: 8px;
  transition: transform 120ms ease;
}
.job-header-actions-menu--lowes[open] .job-ledger__badge-chevron {
  transform: rotate(180deg);
}
.job-header-actions-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 12px 26px rgba(27, 34, 44, 0.14);
}
.job-header-actions-menu__item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.job-header-actions-menu__form {
  margin: 0;
}
.job-header-actions-menu__item[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}
.job-header-actions-menu__item:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.job-header-actions-menu__item i {
  width: 13px;
  font-size: 11px;
  text-align: center;
}
.job-header-actions-menu__item--danger {
  color: var(--danger);
}
.job-header-actions-menu__item--warning {
  color: var(--warning);
}
.job-header-actions-menu__item--warning:hover {
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
}
.job-header-actions-menu__item--danger:hover {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}
@media (max-width: 900px) {
  .job-ledger__head {
    gap: 8px 12px;
  }
  .job-ledger__actions {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: wrap;
  }
  .job-ledger__facts {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .job-ledger__fact--secondary {
    display: none;
  }
}

@media (max-width: 720px) {
  .job-ledger__head {
    grid-template-columns: minmax(0, 1fr);
  }
  .job-ledger__actions {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .job-ledger__facts {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 520px) {
  .job-ledger {
    margin-bottom: 10px;
  }
  .job-ledger__head {
    gap: 6px;
    padding: 16px 16px 14px;
  }
  .job-ledger__title {
    font-size: 19px;
  }
  .job-ledger__actions {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .job-ledger__facts {
    grid-column: 1;
    grid-row: 3;
    gap: 4px 12px;
  }
  .job-header-actions-menu--more > summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .job-header-actions-menu--status {
    flex: 1 1 220px;
    min-width: 0;
  }
  .job-header-actions-menu--status > summary {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 44px;
    white-space: normal;
    text-align: left;
  }
  .job-header-actions-menu--status .job-header-actions-menu__panel {
    right: auto;
    left: 0;
    width: min(390px, calc(100vw - 32px));
    min-width: 0 !important;
  }
  .job-header-actions-menu--lowes .job-header-actions-menu__panel {
    right: auto;
    left: 0;
    width: min(340px, calc(100vw - 50px));
    min-width: 0;
  }
  .job-header-actions-menu--more {
    flex: 0 0 44px;
  }
  .job-header-actions-menu--more > summary {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }
  .job-ledger__fact {
    max-width: min(100%, 210px);
  }
}

/* ═══════════════════════════════════════════
   JOB SHOW · TWO-COLUMN MASTER/DETAIL
═══════════════════════════════════════════ */
.job-detail-layout {
  display: block;
  min-width: 0;
  container-name: job-detail;
  container-type: inline-size;
}
.job-section-picker {
  display: none;
  margin-bottom: 16px;
}
.job-section-picker__label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.job-section-picker__select {
  width: 100%;
  min-height: 44px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}
.job-rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  z-index: 3;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.job-rail__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-md);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background 0.1s ease,
    color 0.1s ease;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.job-rail__btn:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.job-rail__btn.is-active {
  background: var(--surface-hi);
  color: var(--text-1);
  border-bottom-color: var(--brass);
  font-weight: 600;
}
.job-rail__icon {
  font-size: 12px;
  width: 14px;
  color: var(--text-3);
}
.job-rail__btn.is-active .job-rail__icon {
  color: var(--brass-lo);
}
.job-rail__label {
  flex: 1;
}

/* Header dropdowns hang below the head row and over everything the header
   covers, including the section tab strip and the page content beneath. */
.job-ledger .job-header-actions-menu__panel,
.job-ledger .job-header-select__menu {
  z-index: 40;
}

/* [#14] Inside the composed header the section rail reads as the topbar's
   workspace tabs do: full-height, flush to the head's bottom hairline, gold
   underline on the active tab. Same system, one level down. */
.job-ledger .job-rail {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--surface);
  align-items: stretch;
}
.job-ledger .job-rail__btn {
  /* Vertical only — horizontal padding stays with the base rule so the
     container-query compact mode can still tighten the strip. */
  padding-top: 12px;
  padding-bottom: 12px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  font-family: var(--font-display);
}
.job-ledger .job-rail__btn:hover {
  background: none;
  color: var(--text-1);
}
.job-ledger .job-rail__btn.is-active {
  background: none;
  border-bottom-color: var(--brass);
}
.job-ledger .job-section-picker {
  margin: 0;
  padding: 10px;
}

/* Adapt to the job canvas, not the device. The label-only rail fits a normal
   laptop workspace at eleven sections; the picker takes over before the rail
   can scroll. */
@container job-detail (min-width: 961px) {
  .job-rail {
    gap: 2px;
  }
  .job-rail__btn {
    gap: 0;
    padding-left: 7px;
    padding-right: 7px;
    font-size: 13px;
  }
  .job-rail .job-rail__icon {
    display: none;
  }
  .job-rail__group + .job-rail__group {
    margin-left: 1px;
    padding-left: 5px;
  }
}
@container job-detail (max-width: 960px) {
  .job-section-picker {
    display: block;
  }
  .job-rail {
    display: none;
  }
}

/* Viewport fallback for browsers without container-query support. */
@supports not (container-type: inline-size) {
  @media (min-width: 1001px) {
    .job-rail {
      gap: 2px;
    }
    .job-rail__btn {
      gap: 0;
      padding-left: 9px;
      padding-right: 9px;
    }
    .job-rail .job-rail__icon {
      display: none;
    }
  }
  @media (max-width: 1000px) {
    .job-section-picker {
      display: block;
    }
    .job-rail {
      display: none;
    }
  }
}

/* Landscape tablets and short laptops need vertical working room as much as
   horizontal room. Keep all touch targets intact while trimming decorative
   spacing around the job context and section navigation. */
@media (orientation: landscape) and (min-width: 769px) and (max-height: 900px) {
  .app-body[data-page="job_show"] .view-scroll {
    padding-top: 16px;
    padding-bottom: 16px;
    --view-pad-top: 16px;
  }
  .app-body[data-page="job_show"] .job-ledger {
    margin-bottom: 14px;
  }
  .app-body[data-page="job_show"] .job-ledger__head {
    gap: 10px 18px;
    padding: 15px 20px 14px;
  }
  .app-body[data-page="job_show"] .job-workspace-toolbar {
    margin-bottom: 12px;
  }
}

.job-pane-stack {
  min-width: 0;
}
.job-pane[hidden] {
  display: none !important;
}
.job-pane {
  display: block;
  animation: jobPaneFade 0.12s ease-out;
}

.job-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: 52px;
  padding: 8px 12px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--r-md);
}
.job-workspace-toolbar--good {
  border-left-color: var(--success);
}
.job-workspace-toolbar--warn {
  border-left-color: var(--warning);
}
.job-workspace-toolbar--danger {
  border-left-color: var(--danger);
}
.job-workspace-toolbar--info {
  border-left-color: var(--brass-lo);
}
.job-workspace-toolbar__message {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.job-workspace-toolbar__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  color: var(--brass-lo);
  font-size: 12px;
}
.job-workspace-toolbar--good .job-workspace-toolbar__icon {
  color: var(--success);
  background: rgba(22, 163, 74, 0.09);
}
.job-workspace-toolbar--warn .job-workspace-toolbar__icon {
  color: var(--warning);
  background: rgba(217, 119, 6, 0.1);
}
.job-workspace-toolbar--danger .job-workspace-toolbar__icon {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}
.job-workspace-toolbar__copy {
  min-width: 0;
}
.job-workspace-toolbar__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
}
.job-workspace-toolbar__detail {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-2);
}
.job-workspace-toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
}
.estimate-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.job-workspace-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-lo);
  background: var(--surface-hi);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.job-workspace-badge[href] {
  text-decoration: none;
}
.job-workspace-badge[href]:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  transition:
    filter 0.12s ease,
    transform 0.12s ease;
}
.job-workspace-badge--good {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.22);
  color: #166534;
}
.job-workspace-badge--warn {
  background: rgba(202, 138, 4, 0.12);
  border-color: rgba(202, 138, 4, 0.25);
  color: #854d0e;
}
.job-workspace-badge--bad {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.22);
  color: #991b1b;
}
.job-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.job-status-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
.job-status-tile {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.job-status-tile__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 5px;
}
.job-status-tile__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.job-status-tile__meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.35;
}
.job-section {
  margin-bottom: 18px;
}
.job-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}
.job-section__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-3);
}
.job-section__title i {
  color: var(--brass-lo);
  font-size: 12px;
}
.job-section__meta {
  font-size: 11px;
  color: var(--text-3);
}
.job-card-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.job-card-stack > .detail-card,
.job-card-stack > turbo-frame > .detail-card {
  margin-bottom: 0;
}
/* [#23] Pre-sale production tab: one quiet line instead of eight placeholders. */
.production-presale-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-3);
}

/* [#16] A state line on a production row. `--caution` is for states a sold job
   can legitimately be in — a migrated acceptance with no geometry is history,
   not a failure, so it must not wear the red error treatment. */
.production-note {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.45;
}
.production-note--caution {
  border: 1px solid rgba(180, 131, 20, 0.28);
  border-left: 3px solid var(--brass-lo);
  background: rgba(180, 131, 20, 0.07);
  color: var(--text-2);
}

/* Production tab — fuse related cards into one panel. Inner turbo-frames stay
   intact (inline edit keeps working); the member .detail-cards are flattened so
   the group reads as a single unified card with divided sub-sections. */
.production-group {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.production-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 24px;
  margin: 0;
  padding: 18px 18px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.production-group__head i {
  color: var(--brass-lo);
  font-size: 12px;
}
.production-group__body {
  display: flex;
  flex-direction: column;
}
.production-group__body > turbo-frame {
  display: block;
}
.production-group__body > * + * {
  border-top: 1px solid var(--border-lo);
}
.production-group__body .detail-card {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
}
/* Recede the member sub-section titles a step below the group header so the
   group header reads as the card title and the members read as sub-sections.
   [#17] Sub-sections speak in the mono column-label voice, not as card titles. */
.production-group__body .detail-card-title,
.production-admin-details__body > .detail-card .detail-card-title,
.production-admin-details__body > turbo-frame > .detail-card .detail-card-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-3);
}
.sold-scope-card__head {
  margin-bottom: 10px;
}
.accepted-design-canvas-actions,
.accepted-design-canvas-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.accepted-design-canvas-actions {
  min-width: 0;
}
.accepted-design-canvas-links {
  min-width: 0;
}
.accepted-design-canvas-links .btn-ghost-sm {
  max-width: 100%;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}
.estimate-command-card__actions .accepted-design-canvas-links {
  display: grid;
  width: 100%;
}
.sold-scope-card__body {
  display: grid;
  gap: 8px;
}
.sold-scope-card__estimate {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 12px;
  text-decoration: none;
}
.sold-scope-card__estimate > span:last-child {
  margin-left: auto;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-weight: 700;
}
.sold-scope-card__estimate--primary {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.sold-scope-card__estimate--primary strong {
  color: var(--text-1);
  font-size: 13px;
}
.sold-scope-card__estimate--primary > span:last-child {
  font-size: 14px;
}
.sold-scope-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.sold-scope-card__timeline {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-lo);
}
.sold-scope-card__total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-3);
  font-size: 11px;
}
.sold-scope-card__total strong {
  color: var(--text-1);
  font-family: var(--font-mono);
}
.sold-package-card .sold-scope-card {
  padding-bottom: 10px;
}
.sold-package-card__design {
  margin: 0 16px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--border-lo);
}
.sold-package-card__design-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sold-package-card__design-title,
.preprod-spec-head__identity,
.preprod-spec-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sold-package-card__design-title {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.sold-package-card__design-title i {
  color: var(--brass);
}
.sold-package-card__design .production-note {
  margin-top: 10px;
}
.preprod-spec-head {
  display: block;
}
.preprod-spec-head__identity {
  justify-content: space-between;
}
.preprod-spec-footer {
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border-lo);
}
@media (max-width: 620px) {
  .sold-package-card__design-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .preprod-spec-head__identity,
  .preprod-spec-footer {
    justify-content: flex-start;
  }
}
.production-permitting-group .detail-card {
  padding: 16px;
}
.production-permitting-group .detail-card-title {
  margin-bottom: 10px;
}
.production-permitting-group [data-demo-target="permit-card"]:last-child {
  margin-bottom: 0 !important;
}
.overview-focus-card {
  border-color: rgba(170, 118, 44, 0.18);
}
.overview-focus-card__head {
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.overview-job-brief-card {
  margin-bottom: 14px;
}
.overview-job-brief-card__title i {
  margin-right: 6px;
  color: var(--brass);
  font-size: 13px;
}
.overview-job-brief-card__body {
  margin: 0;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.overview-job-brief-card__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-lo);
}
.overview-job-brief-card__meta span {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.overview-job-brief-card__meta p {
  margin: 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.note-mention-composer {
  position: relative;
}
/* Internal-note composer: textarea, optional mirror toggle, action right. */
.job-note-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.job-note-form__input {
  margin-bottom: 8px;
  background: var(--surface-hi);
}
.job-note-form__mirror {
  margin-right: auto;
}
.job-note-form__actions {
  align-items: center;
  margin-top: 0;
}
.note-mention-results {
  position: absolute;
  z-index: 20;
  right: 0;
  left: 0;
  margin-top: -7px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
}
/* [#897 review] `.detail-card` sets `overflow: hidden` at <=768px (pages/jobs.css),
   which clips this absolutely-positioned menu instead of scrolling with the
   card — most/all of its up-to-8 options end up invisible and untappable on
   mobile/iPad. In flow it just grows the (auto-height) Notes card instead. */
@media (max-width: 768px) {
  .note-mention-results {
    position: static;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
  }
}
.note-mention-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  color: var(--text-1);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.note-mention-option + .note-mention-option {
  border-top: 1px solid var(--border-lo);
}
.note-mention-option[aria-selected="true"],
.note-mention-option:hover {
  background: var(--surface-hi);
}
.note-mention-option span {
  color: var(--text-3);
  font-size: 11px;
}
.note-mention-selections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.note-mention-selections:empty {
  display: none;
}
.note-mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  color: var(--brass);
  background: rgba(170, 118, 44, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.note-mention-chip button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.note-mention {
  padding: 0 2px;
  color: var(--brass);
  background: rgba(170, 118, 44, 0.12);
  border-radius: 3px;
  font-weight: 600;
}
.overview-empty-state {
  display: flex;
  min-height: 132px;
  margin: 0;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}
.overview-empty-state__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  margin-bottom: 2px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brass);
  font-size: 15px;
  box-shadow: inset 0 0 0 1px var(--border-lo);
}
.overview-empty-state strong {
  color: var(--text-1);
  font-size: 13px;
}
.overview-empty-state > span:last-child {
  max-width: 340px;
  line-height: 1.45;
}
.overview-notes-history {
  margin-top: 0;
}
.important-dates-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.important-date-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) minmax(112px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-lo);
  color: inherit;
  text-decoration: none;
}
.important-date-row:last-child {
  border-bottom: 0;
}
.important-date-row:hover .important-date-row__label,
.important-date-row:hover .important-date-row__value {
  color: var(--brass-lo);
}
.important-date-row__label {
  min-width: 0;
  color: var(--text-3);
  font-size: 12px;
}
.important-date-row__value {
  min-width: 0;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}
.important-date-row__value small {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
}
.important-date-row.is-missing .important-date-row__value {
  color: var(--text-3);
  font-weight: 500;
}
.sales-estimate-sections {
  display: grid;
  gap: 14px;
}
.sales-estimate-section {
  display: grid;
  gap: 8px;
}
.sales-estimate-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sales-estimate-section__title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.sales-estimate-section__title i {
  color: var(--brass-lo);
  font-size: 11px;
}
.sales-estimate-section__rows {
  display: grid;
  gap: 8px;
}
/* [#883 r15] The History section renders as a <details>. An author
   display:grid on the rows defeats Chromium's closed-state hiding (verified
   empirically in Chrome 148: closed rows keep layout without this rule), so
   the collapse must be enforced at the author level too. */
details.sales-estimate-section:not([open]) .sales-estimate-section__rows {
  display: none;
}
.sales-estimate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.sales-estimate-row__main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.sales-estimate-row__version,
.sales-estimate-row__amount {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.sales-estimate-row__version {
  color: var(--text-3);
}
.sales-estimate-row__amount {
  color: var(--text-1);
}
.sales-estimate-row__copy {
  min-width: 0;
}
.sales-estimate-row__title {
  display: block;
  overflow: hidden;
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sales-estimate-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
}
.sales-estimate-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.sales-estimate-row__actions .btn-primary,
.sales-estimate-row__actions .btn-ghost-sm {
  font-size: 11px;
  padding: 5px 10px;
}
@media (max-width: 760px) {
  .sales-estimate-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-estimate-row__main {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .sales-estimate-row__amount {
    grid-column: 2;
  }
  .sales-estimate-row__actions {
    justify-content: flex-start;
  }
}
.production-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.production-section {
  margin-bottom: 0;
}
.production-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}
.production-command-grid > .detail-card,
.production-command-side > .detail-card {
  margin-bottom: 0;
}
.production-command-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.production-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
  /* Each column packs from its own top. Without this a short column's items
     stretch or centre against the taller one's height. */
  align-items: start;
  align-content: start;
}
/* A column is one stack, so adding a card to it never makes a third GRID item
   that wraps to the next row and leaves a column-height hole beside it. */
.production-split-grid__column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  min-width: 0;
}
.production-split-grid__column > * {
  min-width: 0;
}
.production-reference-card {
  padding: 16px;
}
.production-admin-details {
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: 0;
}
.production-admin-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  min-height: 24px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.production-admin-details > summary.production-card-head {
  font-size: 11px;
  font-weight: 400;
}
.production-admin-details > summary span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.production-admin-details > summary i {
  color: var(--brass-lo);
}
.production-admin-details__body {
  padding: 0 14px 14px;
}
.production-admin-details--flush > .production-admin-details__body {
  padding: 0;
}
/* [#16] The collapsible group IS the card. Anything directly inside it — a
   .production-group wrapper or a raw .detail-card — drops its own box and reads
   as a sub-section divided by a hairline. */
.production-admin-details__body > .production-group {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.production-admin-details__body > .production-group > .production-group__head {
  padding: 0 0 4px;
}
.production-admin-details__body > .detail-card,
.production-admin-details__body > turbo-frame > .detail-card {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 12px 0;
}
.production-admin-details__body > * + *,
.production-admin-details__body > turbo-frame + turbo-frame {
  border-top: 1px solid var(--border-lo);
}
.production-admin-details__body > :first-child > .detail-card,
.production-admin-details__body > .detail-card:first-child {
  padding-top: 0;
}
.production-admin-details__body > :last-child > .detail-card,
.production-admin-details__body > .detail-card:last-child {
  padding-bottom: 0;
}
.job-card-empty {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 16px;
  text-align: center;
}
.job-card-empty--compact {
  min-height: 132px;
  padding-block: 18px;
}
.job-card-empty__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--brass-soft);
  color: var(--brass);
}
.job-card-empty > strong {
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 15px;
}
.job-card-empty > p {
  max-width: 420px;
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}
.job-card-empty__action {
  margin-top: 5px;
}
.change-orders-workspace__actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.change-orders-list {
  display: grid;
  gap: 8px;
}
.change-orders-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.change-orders-list__amount {
  margin-left: auto;
}
.production-stage-correction {
  margin-top: 12px;
  border-top: 1px solid var(--border-lo);
}
.production-stage-correction > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}
.production-stage-correction > summary span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.production-stage-correction > summary i {
  color: var(--brass-lo);
}
.production-stage-correction__body {
  padding: 8px 0 2px;
}
.production-stage-correction__body > p {
  max-width: 720px;
  margin: 0 0 12px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.5;
}
.production-stage-correction__form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.7fr) auto;
  align-items: end;
  gap: 10px;
}
.production-stage-correction__form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.production-stage-correction__form label > span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.production-stage-correction__form .btn-ghost-sm {
  min-height: 36px;
  white-space: nowrap;
}
.job-manage-drawer {
  margin-top: 14px;
  border-top: 1px solid var(--border-lo);
  padding-top: 12px;
}
/* On a rail the drawer is its own surface, not a division of a card. */
.side-stack > .job-manage-drawer {
  margin-top: 0;
  padding: var(--card-padding-compact);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--surface);
}

/* Scheduling warnings — outstanding items, never a refusal. */
.scheduling-warnings {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-left: 3px solid var(--s-preprod, #d97706);
  border-radius: var(--r-sm);
  background: rgba(217, 119, 6, 0.07);
}
.scheduling-warnings--compact {
  margin-bottom: 12px;
  padding: 9px 11px;
}
.scheduling-warnings__head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}
.scheduling-warnings--compact .scheduling-warnings__head,
.scheduling-warnings--compact .scheduling-warnings__list li {
  font-size: 11.5px;
}
.scheduling-warnings__head i {
  color: var(--s-preprod, #d97706);
  font-size: 12px;
}
.scheduling-warnings__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.scheduling-warnings__list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.scheduling-warnings__list i {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--s-preprod, #d97706);
  font-size: 9px;
}
.scheduling-warnings__footer {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-3);
}
.job-manage-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.job-manage-drawer > summary::-webkit-details-marker {
  display: none;
}
.job-manage-drawer > summary::after {
  content: "v";
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  color: var(--text-3);
  transition: transform 0.12s ease;
}
.job-manage-drawer[open] > summary::after {
  transform: rotate(180deg);
}
.job-manage-drawer__body {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.job-manage-drawer__body--plain {
  margin: 0;
  padding: 8px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.install-segment-form {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.install-segment-form__title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.install-segment-form__grid {
  display: grid;
  grid-template-columns:
    minmax(130px, 1.15fr) minmax(96px, 0.85fr) minmax(96px, 0.85fr)
    minmax(130px, 1.15fr);
  gap: 9px;
}
.install-segment-form__field {
  min-width: 0;
}
.install-segment-form__field--span {
  grid-column: 1 / -1;
}
.install-segment-form__field label {
  display: block;
  margin-bottom: 5px;
  font-size: 10.5px;
  color: var(--text-3);
}
.install-segment-form__control {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
  padding: 7px 9px;
}
select.install-segment-form__control {
  padding-right: 30px;
}
.install-segment-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-lo);
}
.install-segment-form__actions--end {
  justify-content: flex-end;
}
.install-segment-form__hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-3);
}

/* On the Install tab's rail the form has one narrow column to work with:
   fields stack full width and nothing may push past the column. */
.install-readiness-rail .install-segment-form__grid {
  grid-template-columns: minmax(0, 1fr);
}
.install-readiness-rail .install-segment-form__control,
.install-readiness-rail .form-control,
.install-readiness-rail .select-inline {
  max-width: 100%;
}
.install-plan-queue__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}
.install-holds__clear {
  margin: 0 0 10px;
}
.install-plan-queue--holds {
  margin-bottom: 10px;
}
.install-segment-form__submit {
  flex-shrink: 0;
  font-size: 12px;
  padding: 7px 16px;
}

/* [#1266] Install planning: readiness matrix, office holds, and the crew
   handoff row. Flex columns rather than a fixed grid so every row reflows on a
   phone without a width media query fighting it. */
.install-plan-section {
  margin: 0 0 12px;
}
.install-plan-section__title,
.install-plan-section__header {
  align-items: center;
  color: var(--text-1);
  display: flex;
  font-size: 11.5px;
  font-weight: 600;
  gap: 7px;
  margin-bottom: 7px;
}
.install-plan-section__header {
  min-height: 44px;
  margin-bottom: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-lo);
}
.install-plan-section__header > .detail-card-title {
  margin: 0;
}
.install-readiness-row {
  align-items: baseline;
  border-bottom: 1px solid var(--border-lo);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 7px 0;
}
.install-readiness-row:last-child {
  border-bottom: 0;
}
.install-readiness-row__label {
  color: var(--text-1);
  flex: 0 0 130px;
  font-size: 12px;
  font-weight: 600;
}
.install-readiness-row__detail {
  color: var(--text-2);
  flex: 1 1 200px;
  font-size: 11.5px;
  min-width: 0;
}
/* [#24] The matrix folds to one line; only a blocker on a placed date stays up. */
.install-readiness-disclosure > summary {
  align-items: center;
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  font-size: 11.5px;
  font-weight: 600;
  gap: 7px;
  padding: 8px 0;
}
.install-readiness-disclosure > summary i {
  color: var(--brass);
  font-size: 12px;
}
.install-readiness-disclosure__body {
  margin-top: 4px;
}

.install-readiness-rail .install-segment-form--hold {
  margin-top: 8px;
  border-color: var(--border);
  background: var(--surface-hi);
}
.install-readiness-alert {
  align-items: baseline;
  background: rgba(231, 76, 60, 0.07);
  border: 1px solid rgba(231, 76, 60, 0.28);
  border-left: 3px solid var(--danger, #e74c3c);
  border-radius: var(--r-sm);
  color: var(--text-1);
  display: flex;
  font-size: 11.5px;
  gap: 7px;
  margin-bottom: 8px;
  padding: 8px 10px;
}
.install-readiness-alert i {
  color: var(--danger, #e74c3c);
}
.install-readiness-state {
  border-radius: 999px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  text-transform: uppercase;
}
.install-readiness-state--satisfied {
  background: rgba(39, 174, 96, 0.12);
  color: #1e8449;
}
.install-readiness-state--outstanding {
  background: rgba(217, 119, 6, 0.12);
  color: #b06000;
}
.install-readiness-state--at_risk,
.install-readiness-state--held {
  background: rgba(231, 76, 60, 0.12);
  color: #b93b2c;
}
.install-readiness-state--not_applicable {
  background: var(--surface-hi);
  color: var(--text-3);
}
.install-plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.install-plan-chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: 999px;
  color: var(--text-2);
  display: inline-flex;
  font-size: 10.5px;
  gap: 4px;
  padding: 2px 8px;
}
.install-plan-chip--warn {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b06000;
}
.install-plan-chip--alert {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.3);
  color: #b93b2c;
}
.install-plan-chip--ok {
  background: rgba(39, 174, 96, 0.08);
  border-color: rgba(39, 174, 96, 0.28);
  color: #1e8449;
}
.install-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.install-handoff-actions form {
  display: inline-flex;
}
.install-handoff-actions .btn-ghost-sm,
.install-handoff-actions .btn-primary {
  font-size: 11px;
  min-height: 34px;
  padding: 5px 11px;
}
.install-blocked-note {
  background: rgba(231, 76, 60, 0.07);
  border: 1px solid rgba(231, 76, 60, 0.26);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 11.5px;
  margin-top: 8px;
  padding: 7px 9px;
}
.install-consequence-panel {
  background: rgba(217, 119, 6, 0.07);
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-left: 3px solid var(--s-preprod, #d97706);
  border-radius: var(--r-sm);
  margin: 0 0 12px;
  padding: 10px 12px;
}
.install-consequence-panel ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
}
.install-consequence-panel li {
  color: var(--text-2);
  font-size: 11.5px;
}
.install-plan-queue {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.install-plan-queue__item {
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
@media (pointer: coarse) {
  .install-handoff-actions .btn-ghost-sm,
  .install-handoff-actions .btn-primary {
    min-height: 44px;
  }
}
@media (max-width: 620px) {
  .install-readiness-row__label {
    flex: 1 1 100%;
  }
  .install-readiness-row__detail {
    flex: 1 1 100%;
  }
}

@keyframes jobPaneFade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .job-rail {
    position: static;
    padding: 4px;
  }
  .job-rail__btn {
    flex: 0 0 auto;
    padding: 8px 12px;
  }
  .job-workspace-toolbar {
    align-items: flex-start;
  }
  .job-workspace-toolbar__actions {
    justify-content: flex-start;
  }
  .production-command-grid,
  .production-split-grid {
    grid-template-columns: 1fr;
  }
  .production-command-grid > *,
  .production-split-grid > * {
    min-width: 0;
  }
  .production-command-side {
    gap: 12px;
  }
  .install-segment-form__grid {
    grid-template-columns: 1fr 1fr;
  }
  .install-segment-form__actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .job-workspace-toolbar__actions {
    flex: 1 1 100%;
  }
  .production-stage-correction__form {
    grid-template-columns: 1fr;
  }
  .production-stage-correction__form .btn-ghost-sm {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .job-section-picker__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .job-workspace-toolbar {
    min-height: 48px;
    gap: 6px 8px;
    margin-bottom: 10px;
    padding: 6px 8px;
  }
  .job-workspace-toolbar__message {
    flex: 1 1 140px;
    gap: 8px;
  }
  .job-workspace-toolbar__icon {
    width: 24px;
    height: 24px;
  }
  .job-workspace-toolbar__actions {
    flex: 0 1 auto;
    gap: 5px;
  }
  .job-workspace-badge {
    padding: 4px 6px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .job-workspace-toolbar__icon {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   JOB SHOW · NEXT ACTION CALLOUT
═══════════════════════════════════════════ */
.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brass);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.12s ease;
}
.next-action:hover {
  border-color: var(--text-3);
  border-left-color: var(--brass);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}
.next-action--danger {
  border-left-color: var(--danger);
  background: rgba(220, 38, 38, 0.03);
}
.next-action--warn {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.03);
}
.next-action__body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.next-action__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-hi);
  color: var(--brass-lo);
  font-size: 13px;
}
.next-action--danger .next-action__icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}
.next-action--warn .next-action__icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-text);
}
.next-action__headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}
.next-action__detail {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.next-action__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brass-lo);
  white-space: nowrap;
}
.next-action__cta i {
  font-size: 10px;
}

/* ═══════════════════════════════════════════
   INLINE PAYMENT / NOTE ITEMS
═══════════════════════════════════════════ */
.payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 11px;
  background: var(--surface-hi);
  border-radius: 6px;
  border: 1px solid var(--border-lo);
}
.payment-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}
.payment-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.payment-amount {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

/* ═══════════════════════════════════════════
   EMPTY STATES
   One shape everywhere: centred in its own surface, one modest muted glyph,
   one line in the house voice. Compact surfaces (rails, dashboard queues) only
   change the padding — never the centring, the icon size, or the voice.
═══════════════════════════════════════════ */
.empty,
.empty-state,
.ledger__empty,
.inbox-empty,
.dash-empty,
.customer-followup-empty,
.customer-thread-empty,
.job-todo-list__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}
.empty p,
.empty-state p,
.ledger__empty p,
.inbox-empty p,
.dash-empty p,
.customer-followup-empty p,
.customer-thread-empty p,
.job-todo-list__empty p {
  margin: 0;
  font-size: 13px;
}
.empty i,
.empty svg,
.empty-state i,
.ledger__empty i,
.inbox-empty i,
.dash-empty i,
.customer-followup-empty i,
.customer-thread-empty i {
  width: auto;
  height: auto;
  font-size: 28px;
  opacity: 0.35;
  color: var(--text-3);
}
/* Compact surfaces: the same empty state, less air. */
.dash-empty,
.job-todo-list__empty,
.customer-followup-empty,
.customer-thread-empty {
  padding: 24px 16px;
}

.empty-state {
  gap: 10px;
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
}
.empty-state-text {
  font-size: 13px;
  color: var(--text-3);
}
.empty-state-text a {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   DETAIL LAYOUT GRIDS
═══════════════════════════════════════════ */
.job-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.job-detail-grid > * {
  min-width: 0;
}
/* [#27] No side rail, so nothing should hold the 300px gutter open. */
.job-detail-grid--single {
  grid-template-columns: minmax(0, 1fr);
}
.job-appointments-layout {
  display: block;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 308px;
  gap: 20px;
  align-items: start;
}
.dash-grid--single {
  grid-template-columns: minmax(0, 1fr);
}
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.job-main-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side-stack > .detail-card,
.side-stack > .panel,
.job-main-stack > .detail-card,
.job-main-stack > .panel {
  margin-bottom: 0;
}
.cd-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
  flex-shrink: 0;
}
.cd-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
}
.cd-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}
.cd-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.cd-grid > * {
  min-width: 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.prop-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 22px;
  align-items: start;
}

.sidebar-layout > * {
  min-width: 0;
}

/* ═══════════════════════════════════════════
   OLD CARD COMPAT
═══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-lo);
}
.card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.card-body {
  padding: 18px 20px;
}
.card.card-body {
  padding: 18px 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.detail-item {
}
.detail-label {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}
.detail-value {
  font-size: 13.5px;
  color: var(--text-1);
  font-weight: 500;
}
.detail-value a {
  color: var(--brass-lo);
}
.detail-value a:hover {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════ */
.mono {
  font-family: var(--font-mono);
}
.divider {
  height: 1px;
  background: var(--border-lo);
  margin: 16px 0;
}
.text-3 {
  color: var(--text-3);
}
.text-2 {
  color: var(--text-2);
}

@media (max-width: 1024px) {
  .dash-grid,
  .cd-grid,
  .prop-detail-grid,
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .sched-page-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .detail-field-grid {
    grid-template-columns: 1fr;
  }
  /* Prevent iOS Safari auto-zoom on input focus — requires 16px minimum */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  textarea,
  select,
  .form-control,
  .search-input-inline,
  .select-filter,
  .select-inline {
    font-size: 16px !important;
  }
  .panel {
    padding: 14px;
    border-radius: var(--r-md);
  }
  .panel-title {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .detail-card {
    padding: 14px;
    margin-bottom: 10px;
  }
  .sec-hd {
    margin-bottom: 10px;
  }
  .sec-title {
    font-size: 15px;
  }
  .tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }
  .tab-btn {
    padding: 12px 10px;
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  .empty {
    padding: 32px 16px;
  }
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

@media (max-width: 768px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .page-header > *,
  .page-header .actions {
    min-width: 0;
    max-width: 100%;
  }
  .page-header .actions {
    flex-wrap: wrap;
  }
}

/* ═══════════════════════════════════════════
   PHOTO & DOC GRID
═══════════════════════════════════════════ */
.bulk-upload-form {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-lo);
}
.bulk-upload-picker {
  display: grid;
  grid-template-columns: minmax(0, 560px) auto;
  gap: 10px;
  align-items: end;
}
.bulk-upload-picker-field {
  margin-bottom: 0;
  min-width: 0;
}
.bulk-upload-input {
  min-height: 42px;
  padding: 5px;
  background: var(--surface-lo);
}
.bulk-upload-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bulk-upload-input:hover::file-selector-button {
  border-color: var(--brass);
  color: var(--brass-lo);
}
.bulk-upload-submit {
  min-height: 42px;
  justify-content: center;
  justify-self: start;
  align-self: end;
}
.bulk-upload-submit i {
  font-size: 11px;
  color: var(--brass-lo);
}
.bulk-upload-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 0;
}
.bulk-upload-row {
  display: grid;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-lo);
}
.bulk-upload-row--photo {
  grid-template-columns:
    minmax(130px, 1fr) minmax(100px, 128px) minmax(160px, 1fr)
    30px;
}
.bulk-upload-row--document {
  grid-template-columns:
    minmax(130px, 1fr) minmax(160px, 1fr) minmax(100px, 128px)
    30px;
}
.bulk-upload-file {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.bulk-upload-file-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
}
.bulk-upload-file-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bulk-upload-row .form-control {
  margin-bottom: 0;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12.5px;
  min-width: 0;
  background-color: var(--surface);
}
.bulk-upload-remove {
  width: 30px;
  height: 30px;
  min-width: 0;
  padding: 0;
  justify-content: center;
  line-height: 1;
  font-size: 12px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.photo-thumb {
  border-radius: var(--r-sm);
  aspect-ratio: 1;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.12s;
  overflow: hidden;
}
.photo-thumb:hover {
  border-color: var(--brass);
}
.photo-thumb__preview {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.photo-thumb__preview:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: -3px;
}
.photo-thumb__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.photo-thumb__expand {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: white;
  background: rgba(17, 17, 17, 0.64);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}
.photo-thumb__expand i {
  font-size: 10px;
}
.photo-thumb svg {
  width: 22px;
  height: 22px;
  color: var(--text-3);
}
.photo-label {
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
/* [#26] The phase reads off the photo now that the phase filter is gone. */
.photo-thumb__phase {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.photo-lightbox-open {
  overflow: hidden;
}
.photo-lightbox[hidden] {
  display: none;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(14px, 3vw, 32px);
  background: rgba(14, 14, 13, 0.9);
}
.photo-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}
.photo-lightbox__caption {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-lightbox__actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.photo-lightbox__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.photo-lightbox__action:hover,
.photo-lightbox__action:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
}
.photo-lightbox__figure {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  margin: 0;
}
.photo-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  object-fit: contain;
  border-radius: var(--r-sm);
  background: white;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}
@media (max-width: 760px) {
  .bulk-upload-picker {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .bulk-upload-submit {
    justify-self: start;
  }
  .bulk-upload-row,
  .bulk-upload-row--photo,
  .bulk-upload-row--document {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .bulk-upload-remove {
    justify-self: end;
  }
  .photo-lightbox {
    padding: 10px;
  }
  .photo-lightbox__caption {
    font-size: 12px;
  }
  .photo-lightbox__image {
    max-height: calc(100vh - 96px);
  }
}
.side-stack .bulk-upload-picker,
.side-stack .bulk-upload-row,
.side-stack .bulk-upload-row--photo,
.side-stack .bulk-upload-row--document {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.side-stack .bulk-upload-submit {
  justify-self: start;
}
.side-stack .bulk-upload-remove {
  justify-self: end;
}
.job-documents-panel__upload {
  margin-bottom: 14px;
}
.job-documents-panel__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.doc-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface-hi);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-lo);
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.doc-row:hover {
  border-color: var(--brass);
}
.doc-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--border-lo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg {
  width: 14px;
  height: 14px;
  color: var(--text-2);
}
.doc-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-1);
}
.doc-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Visit suggestion slots (used on job forms, map modal, and sales tab) */
.sales-appointments-card__sms-button {
  min-height: 30px;
  font-size: 12px;
  padding: 6px 12px;
}
.sales-appointments-card__sms-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: var(--surface-hi);
  color: var(--text-3);
}
.appointments-workflow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.appointments-workflow__section {
  min-width: 0;
}
.appointments-workflow__section--status {
  padding: 12px 0 14px;
  border-top: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
}
.appointments-workflow__section--booking {
  padding-top: 2px;
}
.appointments-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.appointments-section__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.appointments-section__title {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.25;
}
.appointments-current-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* [#1414] Booking modes: one segmented row, one pane below it. */
.appointments-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface-hi);
}
.appointments-modes__tab {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: calc(var(--r-md) - 3px);
  padding: 9px 11px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.appointments-modes__tab > i {
  width: 20px;
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}
.appointments-modes__tab > span,
.appointments-modes__tab strong,
.appointments-modes__tab small {
  display: block;
  min-width: 0;
}
.appointments-modes__tab strong {
  color: inherit;
  font-size: 12px;
  line-height: 1.25;
}
.appointments-modes__tab small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}
.appointments-modes__tab:hover {
  border-color: var(--border-lo);
  color: var(--text-1);
}
.appointments-modes__tab.is-active {
  background: var(--surface);
  border-color: rgba(170, 118, 44, 0.28);
  color: var(--text-1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}
.appointments-modes__tab.is-active > i {
  color: var(--brass);
}
.appointments-mode-pane[hidden] {
  display: none;
}
.appointments-mode-pane {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
}
.appointments-mode-pane__copy {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.appointments-mode-pane__copy--lead {
  color: var(--text-1);
  font-weight: 600;
}
.appointments-mode-pane__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}
.appointments-mode-pane__note > i {
  margin-top: 2px;
  color: var(--brass);
}
.appointments-mode-pane__form-row {
  max-width: 320px;
}
.appointments-mode-pane__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.appointments-mode-pane__actions form {
  margin: 0;
}
.appointments-mode-pane__reason {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-3);
}
.sales-appointment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sales-appointment-form--with-suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sales-appointment-form__suggestions:empty {
  display: none;
}
.sales-appointment-form--with-suggestions .sales-appointment-form__suggestions {
  min-width: 0;
}
.sales-appointment-row {
  padding: 12px 14px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.sales-appointment-row__layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 2.2fr);
  align-items: start;
  gap: 16px;
}
.sales-appointment-row__summary {
  min-width: 0;
}
.sales-appointment-row__actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.sales-appointment-row__assign-form,
.sales-appointment-row__convert-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}
.sales-appointment-row__conflict {
  width: min(240px, 100%);
  min-width: 180px;
  flex: 1 1 180px;
}
.sales-appointment-row__integrity {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-lo);
}
.sales-appointment-row__integrity-copy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
}
.sales-appointment-row__integrity-copy > i {
  margin-top: 2px;
  color: var(--warning);
}
.sales-appointment-row__integrity-copy strong {
  display: block;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sales-appointment-row__integrity-actions,
.sales-appointment-row__integrity-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sales-appointment-row__integrity-form .form-control {
  width: min(190px, 100%);
  padding: 4px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.sales-appointment-row__integrity-status {
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* [#1414] The booking rail: what is picked, the manual fallback, the collapsed
   override, and the one button that books it. */
.appointments-rail {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(0, 2.25fr) auto;
  align-items: end;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface-hi);
}
.appointments-rail__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.appointments-rail__summary {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
}
.appointments-rail__summary.is-filled {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.appointments-rail__override > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.appointments-booking-form__selection {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  padding-right: 12px;
  border-right: 1px solid var(--border-lo);
}
.appointments-booking-form__fields {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}
.appointments-booking-form__notes {
  grid-column: 1 / -1;
}
.appointments-booking-form > .appointments-rail__override {
  grid-column: 2 / -1;
}
.appointments-booking-form > .sales-appointment-form__actions {
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
  margin: 0;
  padding: 0 0 0 12px;
  border-top: 0;
  border-left: 1px solid var(--border-lo);
}
.appointments-rail__override[open] > summary {
  margin-bottom: 8px;
}
.appointments-rail__override-label {
  display: block;
  margin-bottom: 5px;
}
.appointments-rail__override-note {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}
.sales-appointment-form__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sales-appointment-form__field {
  margin: 0;
}
.sales-appointment-form__field label {
  margin-bottom: 5px;
}
.sales-appointment-form__input {
  font-size: 13px;
  padding: 9px 11px;
  min-height: 38px;
}
.sales-appointment-form__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid var(--border-lo);
}
.appointments-rail .sales-appointment-form__actions {
  padding-top: 0;
}

@media (max-width: 940px) {
  .sales-appointment-row__layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-appointment-row__actions,
  .sales-appointment-row__assign-form,
  .sales-appointment-row__convert-form {
    justify-content: flex-start;
  }
  .appointments-rail {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .appointments-booking-form__selection {
    grid-column: 1;
    grid-row: auto;
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border-lo);
  }
  .appointments-booking-form > .appointments-rail__override {
    grid-column: 1;
  }
  .appointments-booking-form__fields,
  .appointments-booking-form > .sales-appointment-form__actions {
    grid-column: 1;
    grid-row: auto;
  }
  .appointments-booking-form > .sales-appointment-form__actions {
    justify-content: flex-start;
    padding: 10px 0 0;
    border-top: 1px solid var(--border-lo);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .appointments-booking-form__fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .appointments-booking-form__notes {
    grid-column: 1;
  }
}
.sales-appointment-form__submit {
  font-size: 12px;
  padding: 7px 18px;
}
.sales-appointment-remote__form {
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  gap: 12px;
  align-items: end;
}
.sales-appointment-remote__form .appointments-mode-pane__actions {
  margin-top: 0;
}
.sales-appointment-remote__submit {
  min-height: 38px;
  font-size: 12px;
  padding: 7px 14px;
}
.visit-suggestions-card {
  margin: 10px 0 8px;
  padding: 12px 0 10px;
  border-top: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
}
.visit-suggestions-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.visit-suggestions-card__title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 150px;
  color: var(--brass-lo);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.visit-suggestions-card__title i {
  flex-shrink: 0;
  font-size: 10px;
}
.visit-suggestions-card__title small {
  margin-left: 2px;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}
.visit-suggestions-card__slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* [#1414] Suggested slots are per-day chip groups: the day is stated once, the
   rep is stated once when the whole day is one rep's, and each time is a chip
   the width of the time it offers. */
.visit-suggestions-day {
  padding: 7px 0 8px;
}
.visit-suggestions-day + .visit-suggestions-day {
  border-top: 1px solid var(--border-lo);
}
.visit-suggestions-day:first-child {
  padding-top: 2px;
}
.visit-suggestions-day__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.visit-suggestions-day__date {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.visit-suggestions-day__rep {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
}
.visit-suggestions-day__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.visit-suggestions-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
}
.visit-suggestions-divider::before,
.visit-suggestions-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-lo);
}
.visit-suggestions-divider span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 8px;
  border: 1px solid var(--border-lo);
  border-left: 3px solid var(--chip-rep, var(--border-lo));
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.suggestion-chip:hover {
  border-color: var(--brass);
}
.suggestion-chip.is-selected {
  border-color: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass);
  background: rgba(184, 146, 74, 0.08);
}
.suggestion-chip__time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.suggestion-chip__hint {
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.suggestion-chip__hint--green {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.suggestion-chip__hint--amber {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}
.suggestion-chip__hint--gray {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-3);
}
.suggestion-chip__rep {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.side-stack .visit-suggestions-card__head {
  display: grid;
  grid-template-columns: 1fr;
}
.ai-voice-panel {
  margin-top: 0;
  width: 100%;
}
.ai-voice-panel--embedded {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
}
.ai-voice-panel__summary,
.ai-voice-log__summary,
.ai-voice-slot,
.ai-voice-panel__request-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-voice-panel__summary,
.ai-voice-log__summary,
.ai-voice-slot {
  justify-content: space-between;
}
/* [#1414] The AI band is one line: what state it is in, why, and the one
   action that moves it. */
.appointments-ai-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.appointments-ai-line__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.appointments-ai-line__status {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}
.appointments-ai-line__note {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-3);
}
.appointments-ai-line__action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}
.appointments-ai-line__action form {
  margin: 0;
}
.appointments-ai-line__link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brass-lo);
}
.ai-voice-log__subhead {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.ai-voice-panel__copy,
.ai-voice-log__body,
.ai-voice-log__failure {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}
.ai-voice-panel__copy {
  max-width: 760px;
}
.ai-voice-readiness {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}
.ai-voice-panel__summary {
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-lo);
}
.ai-voice-panel__request-form {
  flex-wrap: wrap;
}
.ai-voice-panel__primary-action {
  min-height: 34px;
  padding: 7px 16px;
  font-size: 12px;
}
.ai-voice-panel__provider {
  width: 220px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}
.ai-voice-operating-picture {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px 24px;
  margin-top: 16px;
}
.ai-voice-info-block {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border-lo);
}
.ai-voice-facts {
  display: grid;
  gap: 9px 22px;
  margin: 8px 0 0;
}
.ai-voice-facts--context {
  grid-template-columns: 1fr;
}
.ai-voice-facts__row {
  display: grid;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 12px;
  line-height: 1.35;
}
.ai-voice-facts__row dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ai-voice-facts__row dd {
  min-width: 0;
  margin: 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.ai-voice-facts__row dd.is-missing {
  color: #8f5e19;
}
.ai-voice-facts--review {
  display: flex;
  flex-direction: column;
  padding: 10px 0 0;
}
.ai-voice-log__inline-link {
  color: var(--brass-lo);
  font-weight: 700;
  text-decoration: none;
}
.ai-voice-log__inline-link:hover {
  text-decoration: underline;
}
.ai-voice-log__recording {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}
.ai-voice-log__audio {
  width: 100%;
  min-height: 36px;
}
.ai-voice-log__transcript {
  margin-top: 10px;
}
.ai-voice-log {
  margin-top: 12px;
  padding: 12px;
  border-top: 1px dashed var(--border);
}
.ai-voice-panel__latest .ai-voice-log {
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.ai-voice-live {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.ai-voice-live__head,
.ai-voice-live__badges,
.ai-voice-live__button-row,
.ai-voice-live__inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-voice-live__head {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ai-voice-live__badges,
.ai-voice-live__button-row {
  flex-wrap: wrap;
}
.ai-voice-facts--live {
  grid-template-columns: 1fr;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lo);
}
.ai-voice-live__controls {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lo);
}
.ai-voice-live__forms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ai-voice-live__form {
  display: grid;
  gap: 5px;
}
.ai-voice-live__form label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ai-voice-live__inline-form {
  align-items: stretch;
}
.ai-voice-live__inline-form .form-control {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  font-size: 12px;
}
.ai-voice-live__inline-form .btn-primary {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 12px;
}
.ai-voice-log__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}
.ai-voice-log__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.ai-voice-log__failure {
  color: #991b1b;
}
.ai-voice-log__details {
  margin-top: 10px;
}
.ai-voice-log__details--nested {
  margin-top: 0;
}
.ai-voice-log__details > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.ai-voice-log__details-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.ai-voice-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-voice-slots--preview {
  display: grid;
  grid-template-columns: 1fr;
}
.ai-voice-slot {
  min-width: 0;
  flex-wrap: wrap;
  padding: 9px 10px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.ai-voice-slot--offer {
  min-height: 56px;
  border-color: rgba(22, 163, 74, 0.22);
  border-left: 3px solid rgba(22, 163, 74, 0.72);
  background: rgba(22, 163, 74, 0.045);
}
.ai-voice-slot--compact {
  padding: 8px 0;
  border: 0;
  border-top: 1px dashed var(--border-lo);
  border-radius: 0;
  background: transparent;
}
.ai-voice-slot--compact:first-child {
  border-top: 0;
}
.ai-voice-slot strong,
.ai-voice-slot span {
  min-width: 0;
  overflow-wrap: anywhere;
  display: block;
  font-size: 12px;
}
.ai-voice-slot span {
  margin-top: 2px;
  color: var(--text-3);
}
.ai-voice-log__pre {
  white-space: pre-wrap;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.45;
}
.ai-voice-log__pre--transcript {
  max-height: 220px;
  overflow: auto;
  margin-top: 6px;
  font-size: 11px;
}
.ai-voice-log__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-voice-log__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-voice-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lo);
}
.ai-voice-history > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.ai-voice-history__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.ai-voice-history__entry {
  display: grid;
  gap: 6px;
}
.ai-voice-history__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.ai-voice-history__row strong {
  color: var(--text-2);
}
.ai-voice-history__summary {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}
@media (max-width: 640px) {
  .ai-voice-history__row {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 4px;
  }
}
.appointments-ai-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lo);
}
.appointments-ai-details > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.appointments-ai-details[open] > summary {
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .sales-appointment-form--with-suggestions,
  .sales-appointment-form__split,
  .ai-voice-operating-picture,
  .ai-voice-facts,
  .ai-voice-slots--preview,
  .ai-voice-log__form-grid,
  .ai-voice-facts__row {
    grid-template-columns: 1fr;
  }
  .appointments-modes {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-appointment-remote__form {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-appointments-card__sms-button {
    width: 100%;
    justify-content: center;
  }
  .sales-appointment-remote__submit {
    width: 100%;
    justify-content: center;
  }
  .ai-voice-live__inline-form {
    align-items: flex-start;
  }
  .ai-voice-live__inline-form {
    flex-direction: column;
  }
}
@media (min-width: 1180px) {
  .ai-voice-slots--preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.visit-suggestions-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 2px;
  font-size: 11px;
  color: var(--text-3);
}
.visit-suggestions-notice {
  margin: 0 0 2px;
  padding: 10px 12px;
  border: 1px dashed var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.visit-suggestions-notice__copy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.45;
}
.visit-suggestions-notice__copy i {
  margin-top: 2px;
  flex-shrink: 0;
}
.suggestion-slot:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  border-color: var(--brass) !important;
}

/* Custom subsection hover actions */
.custom-subsection-row:hover .custom-subsection-actions {
  opacity: 1 !important;
}
.custom-subsection-actions a:hover {
  color: var(--brass-lo) !important;
}

/* ═══════════════════════════════════════════
   CONTACT SHOW — Header + Hero + Jobs + Comms
═══════════════════════════════════════════ */
.contact-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.contact-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .contact-header__actions {
    flex-basis: 100%;
  }
}

.contact-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.contact-action-row > span:first-child {
  flex: 1;
  min-width: 0;
}
.btn-ghost-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 32px;
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  color: var(--text-3);
  text-decoration: none;
  font-size: 11px;
  transition:
    background 0.1s ease,
    color 0.1s ease;
  flex-shrink: 0;
}
.btn-ghost-xs:hover {
  background: var(--brass-lo);
  color: #fff;
}
@media (pointer: coarse) {
  .btn-ghost-xs {
    min-width: 44px;
    min-height: 44px;
  }
}

.contact-jobs__group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 14px 0 8px;
}

.contact-job-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: 6px;
  transition:
    border-color 0.1s ease,
    box-shadow 0.15s ease;
}
.contact-job-card:hover {
  border-color: var(--brass);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.contact-job-card__body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
}
.contact-job-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.contact-job-card__head .job-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-1);
}
.contact-job-card__address {
  font-size: 13px;
  color: var(--text-2);
}
.contact-job-card__meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 12px 14px;
  border-left: 1px solid var(--border-lo);
  background: var(--surface-hi);
  min-width: 120px;
}
.contact-job-card__value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.contact-job-card__detail {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 640px) {
  .contact-job-card {
    flex-direction: column;
  }
  .contact-job-card__meta {
    border-left: 0;
    border-top: 1px solid var(--border-lo);
    align-items: flex-start;
    flex-direction: row;
    gap: 10px;
    padding: 8px 14px;
  }
  .contact-job-card__detail {
    margin-top: 0;
  }
}

/* Coarse-pointer target floors live at the end of the component sheet so
   component-specific declarations above cannot silently shrink them. */
@media (pointer: coarse) {
  .ftab,
  .select-filter,
  .form-control,
  .job-header-actions-menu__item,
  .job-header-select__select,
  .job-ledger__customer-link,
  .job-ledger__address-link,
  .job-ledger__fact,
  .job-ledger__fact--select > summary,
  .detail-card details > summary,
  .panel details > summary,
  .production-admin-details > summary,
  .job-manage-drawer > summary,
  .detail-value a,
  .job-rail__btn,
  .job-section-picker__select,
  .search-input-inline,
  .important-date-row {
    min-height: 44px;
    align-items: center;
  }
  .detail-card details > summary,
  .panel details > summary,
  .detail-value a {
    display: flex;
  }
  .btn,
  .btn-primary,
  .btn-ghost,
  .btn-sm,
  .btn-ghost-sm,
  .btn-danger,
  .job-reassignment-link {
    min-width: 44px;
  }
  .job-reassignment-link {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .job-reassignment-row__layout {
    flex-direction: column;
  }
  .job-reassignment-row__layout > *,
  .job-reassignment-row__actions {
    flex-basis: auto !important;
    min-width: 0;
    width: 100%;
  }
  .job-reassignment-row__layout .flex-center {
    flex-wrap: wrap;
  }
  .permit-detail-header {
    flex-direction: column;
    gap: 12px;
  }
  .permit-detail-header > *,
  .permit-detail-header .flex-center {
    min-width: 0;
    flex-wrap: wrap;
  }
}

/* Communications timeline */
.comm-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comm-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.comm-row__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: var(--surface-hi);
  color: var(--text-3);
  flex-shrink: 0;
}
.comm-row__bubble {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.comm-row__body {
  font-size: 13px;
  color: var(--text-1);
  white-space: pre-wrap;
  line-height: 1.45;
}
.comm-row__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comm-row--in .comm-row__icon {
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
}
.comm-row--in .comm-row__bubble {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.25);
}
.comm-row--out .comm-row__icon {
  background: var(--brass-pill);
  color: var(--brass-lo);
}
.comm-row--out .comm-row__bubble {
  background: var(--surface);
  border-color: var(--border);
}
.comm-row--system .comm-row__icon {
  opacity: 0.7;
}
.comm-row--system .comm-row__bubble {
  background: var(--surface-hi);
  border-style: dashed;
}
.comm-row__subject {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════
   CONTACT INBOX — helpdesk-style layout
═══════════════════════════════════════════ */
.contact-inbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 1100px) {
  .contact-inbox {
    grid-template-columns: 1fr;
  }
}

.customer-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}
.customer-workspace__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.customer-record-card,
.customer-followup-card,
.customer-thread-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.customer-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}
.customer-record-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.customer-record-card__identity > div:last-child {
  flex: 1 1 auto;
  min-width: 0;
}
.customer-record-card__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--brass-pill);
  color: var(--brass-lo);
  flex-shrink: 0;
}
.customer-record-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}
.customer-record-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.customer-record-card__fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 12.5px;
  min-width: 0;
}
.customer-record-card__fact i {
  color: var(--brass-lo);
  font-size: 11px;
  flex-shrink: 0;
}
.customer-record-card__fact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-record-card__fact:hover {
  color: var(--brass-lo);
}
.customer-record-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.customer-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 5px;
}
.customer-followup-card {
  /* [#14] A standard surface — no tinted left edge singling this card out. */
  padding: 18px 20px 20px;
  container-type: inline-size;
  container-name: followup;
}
/* The log history is the primary column; the commitment state and the form
   that edits it ride the rail beside it. */
.customer-followup-card__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.customer-followup-card__rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.customer-followup-card__rail .customer-followup-next {
  min-width: 0;
}
.customer-followup-card__rail .customer-followup-card__form {
  margin-top: 0;
}
.customer-followup-card__rail .customer-followup-form__grid {
  grid-template-columns: minmax(0, 1fr);
}
.customer-followup-card__rail .customer-followup-form__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.customer-followup-card__rail .customer-followup-form__actions span {
  flex: 1 1 100%;
}
@container followup (max-width: 720px) {
  .customer-followup-card__split {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Narrow: the form comes first, the log history reads below it. */
  .customer-followup-card__rail {
    order: -1;
  }
}
.customer-thread-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.customer-thread-card h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-1);
}
.customer-thread-card h2 i {
  color: var(--brass-lo);
  font-size: 14px;
}
.customer-thread-card__header p {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.4;
}
.customer-followup-next {
  min-width: 190px;
  padding: 10px 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  position: relative;
}
.customer-followup-next span {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.customer-followup-next strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-1);
}
.customer-followup-next strong.is-overdue {
  color: #b91c1c;
}
.customer-followup-next strong.is-today {
  color: #b45309;
}
.customer-followup-next strong.is-muted {
  color: var(--text-3);
  font-style: italic;
}
.customer-followup-next small {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
}
.customer-followup-next__edit {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-3);
  text-decoration: none;
}
.customer-followup-next__edit:hover {
  background: var(--surface);
  color: var(--brass-lo);
}
.customer-followup-next--editing {
  min-width: min(100%, 420px);
}
.customer-followup-next__form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.customer-followup-next__form .form-control {
  min-width: 0;
}
.customer-followup-card__form {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface-hi);
}
.customer-followup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.customer-followup-form__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.customer-followup-form__label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.customer-followup-form__notes {
  resize: vertical;
}
.customer-followup-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.customer-followup-form__actions span {
  color: var(--text-3);
  font-size: 11px;
}
.customer-followup-card__history {
  min-width: 0;
}
.customer-followup-card--workspace .customer-followup-card__split {
  align-items: stretch;
}
.customer-followup-card--compact .customer-followup-card__split {
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
}
.customer-followup-card--compact .customer-followup-card__rail {
  order: -1;
}
.customer-followup-card--workspace .customer-followup-card__history {
  display: flex;
  flex-direction: column;
}
.customer-followup-card--workspace .customer-followup-empty {
  flex: 1;
  width: 100%;
  min-height: 320px;
}
.customer-followup-card__subhead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.customer-followup-list {
  display: grid;
  gap: 9px;
}
.customer-followup-log {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
}
.customer-followup-log__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--followup-color);
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
}
.customer-followup-log__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.customer-followup-log__top strong {
  color: var(--text-1);
  font-size: 12.5px;
}
.customer-followup-log__top span,
.customer-followup-log__top time {
  color: var(--text-3);
  font-size: 11px;
}
.customer-followup-log__top time {
  margin-left: auto;
  font-family: var(--font-mono);
}
.customer-followup-log p {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.customer-followup-log__meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-3);
  font-size: 10.5px;
}
.customer-followup-log__meta a {
  color: var(--text-3);
  opacity: 0.55;
}
.customer-followup-empty,
.customer-thread-empty {
  min-height: 120px;
}
.customer-thread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.customer-thread-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.customer-thread-card__header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-lo);
}
.customer-thread-card__count {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--text-2);
  background: var(--surface-hi);
  font-size: 11px;
  white-space: nowrap;
}
.customer-thread-card__body {
  flex: 1;
  padding: 16px;
  background: var(--surface-lo);
  max-height: 560px;
  overflow: auto;
}
.customer-sms-thread,
.customer-email-thread-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.customer-sms-row {
  display: flex;
}
.customer-sms-row--in {
  justify-content: flex-start;
}
.customer-sms-row--out {
  justify-content: flex-end;
}
.customer-sms-bubble {
  max-width: 82%;
  padding: 10px 13px 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.customer-sms-row--in .customer-sms-bubble {
  border-bottom-left-radius: 5px;
}
.customer-sms-row--out .customer-sms-bubble {
  background: var(--brass);
  border-color: var(--brass-lo);
  border-bottom-right-radius: 5px;
  box-shadow: 0 1px 2px rgba(138, 110, 58, 0.18);
}
.customer-sms-bubble__body {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.customer-sms-row--out .customer-sms-bubble__body {
  color: #fff;
}
.customer-sms-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.customer-sms-row--out .customer-sms-bubble__meta {
  color: rgba(255, 255, 255, 0.74);
}
.customer-sms-bubble__media,
.customer-email-message__attachments {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.customer-sms-bubble__image,
.customer-email-message__image {
  max-width: 160px;
  max-height: 160px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.customer-email-thread {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.customer-email-thread__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-lo);
  background: var(--surface-hi);
}
.customer-email-thread__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.25;
  color: var(--text-1);
}
.customer-email-thread__header p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 11px;
}
.customer-email-thread__badge {
  align-self: flex-start;
  white-space: nowrap;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
}
.customer-email-thread__badge.is-inbound {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}
.customer-email-thread__messages {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px;
}
.customer-email-message {
  border: 1px solid var(--border-lo);
  border-bottom: 0;
  padding: 11px 12px;
  background: var(--surface-hi);
}
.customer-email-message:first-child {
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}
.customer-email-message:last-child {
  border-bottom: 1px solid var(--border-lo);
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}
.customer-email-message--out {
  background: var(--surface);
}
.customer-email-message--latest {
  border-color: rgba(184, 146, 74, 0.55);
  box-shadow: 0 0 0 2px rgba(184, 146, 74, 0.1);
}
.customer-email-message__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.customer-email-message__direction {
  font-weight: 700;
  color: var(--text-2);
}
.customer-email-message__meta time {
  margin-left: auto;
}
.customer-email-message__body {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.customer-email-message__body p {
  margin: 0 0 8px;
}
.customer-email-message__body p:last-child {
  margin-bottom: 0;
}
.customer-email-message__quote {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 11px;
}
.customer-email-message__quote-label {
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.customer-email-message__quote pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-2);
  margin: 4px 0 0;
  padding: 8px 10px;
  background: var(--surface-lo);
  border-radius: var(--r-sm);
}
.customer-compose {
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
  background: var(--surface-hi);
}
.customer-compose__form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.customer-compose__subject {
  font-size: 13px;
}
.customer-compose__field {
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.customer-compose__editor {
  min-height: 94px;
  background: var(--surface);
}
.customer-compose__editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}
.customer-compose__toolbar {
  display: flex;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
}
.customer-compose__toolbar button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.customer-compose__toolbar button:hover {
  background: var(--surface);
  color: var(--brass-lo);
}
@media (pointer: coarse) {
  .customer-compose__toolbar button {
    width: 44px;
    height: 44px;
  }
}
.customer-compose__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.customer-compose__hint {
  color: var(--text-3);
  font-size: 11px;
}
.customer-compose__warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-size: 12px;
  line-height: 1.35;
}
.customer-compose__warning i {
  color: var(--warning-text);
  margin-top: 2px;
}
.customer-compose__confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
}
.customer-compose--disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
}
.customer-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.customer-rail .customer-thread-card {
  min-height: 0;
}
.customer-rail .customer-thread-card__header {
  padding: 14px 16px;
}
.customer-rail .customer-thread-card__body {
  max-height: 360px;
  min-height: 150px;
}
.customer-rail .customer-compose {
  padding: 12px 14px 14px;
}
@media (max-width: 1180px) {
  .customer-thread-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1100px) {
  .customer-workspace {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .customer-record-card,
  .customer-thread-card__header,
  .customer-followup-form__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .customer-record-card__actions {
    width: 100%;
    justify-content: flex-start;
  }
  .customer-followup-form__grid {
    grid-template-columns: 1fr;
  }
  .customer-followup-next,
  .customer-sms-bubble {
    max-width: 100%;
  }
  .customer-compose__row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Inbox main column ── */
.inbox-main {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.inbox-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-lo);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.015) 100%),
    var(--surface);
}
.inbox-hd__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
  min-width: 0;
}
.inbox-hd__pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}
.inbox-hd__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Follow-up strip inside the inbox header */
.inbox-follow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-lo);
  flex-wrap: wrap;
}
.inbox-follow i {
  font-size: 14px;
}
.inbox-follow__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.inbox-follow__date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
}
.inbox-follow__abs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.inbox-follow__action {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--brass-lo);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  transition: background 0.12s;
}
.inbox-follow__action:hover {
  background: var(--surface);
}
.inbox-follow--overdue {
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
  border-bottom-color: #fecaca;
}
.inbox-follow--overdue i,
.inbox-follow--overdue .inbox-follow__date {
  color: #dc2626;
}
.inbox-follow--today {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-bottom-color: #fde68a;
}
.inbox-follow--today i,
.inbox-follow--today .inbox-follow__date {
  color: #b45309;
}
.inbox-follow--soon {
  background: linear-gradient(
    180deg,
    var(--brass-soft) 0%,
    var(--surface) 100%
  );
}
.inbox-follow--soon i {
  color: var(--brass-lo);
}
.inbox-follow--none {
  background: var(--surface-hi);
  color: var(--text-3);
}
.inbox-follow--none i {
  color: var(--text-3);
}

/* Rail: emphasize follow-up card */
.rail-followup .panel {
  border-left: 3px solid var(--brass);
  padding-left: 14px;
}

/* Filter pills */
.inbox-filter {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-lo);
  background: var(--surface-hi);
}
.inbox-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.inbox-filter__btn:hover {
  background: var(--surface);
}
.inbox-filter__btn.is-active {
  background: var(--brass-pill);
  border-color: var(--brass);
  color: var(--brass-lo);
}
.inbox-filter__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-left: 2px;
}
.inbox-filter__btn.is-active .inbox-filter__count {
  color: var(--brass-lo);
}

/* Feed */
.inbox-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  flex: 1;
}
.inbox-empty {
  /* shape comes from the shared empty-state block */
}

/* Note 7a — texts render as a directional chat thread (bubbles, color
   by direction, generous spacing). Inbound = neutral surface, left + left
   tail; outbound = brass brand fill, right + right tail. */
.inbox-bubble-row {
  display: flex;
}
.inbox-bubble-row--in {
  justify-content: flex-start;
}
.inbox-bubble-row--out {
  justify-content: flex-end;
}
.inbox-bubble {
  max-width: 76%;
  padding: 9px 14px 7px;
  border-radius: 16px;
}
.inbox-bubble-row--in .inbox-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.inbox-bubble-row--out .inbox-bubble {
  background: var(--brass);
  border: 1px solid var(--brass-lo);
  border-bottom-right-radius: 5px;
  box-shadow: 0 1px 2px rgba(138, 110, 58, 0.18);
}
.inbox-bubble__body {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inbox-bubble-row--out .inbox-bubble__body {
  color: #fff;
}
.inbox-bubble__meta {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.inbox-bubble-row--out .inbox-bubble__meta {
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
}
.inbox-bubble__from {
  text-transform: none;
  letter-spacing: 0;
}

/* Shared pill — still used by the email-thread header */
.inbox-row__pill {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--border);
}
.inbox-row__pill--email {
  background: var(--brass-pill);
  color: var(--brass-lo);
  border-color: rgba(0, 0, 0, 0);
}

/* Email thread: <details>/<summary> expands the full conversation */
/* Email thread card — always-visible messages, no collapse */
.inbox-thread {
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  padding: 14px 16px 16px;
  background: var(--surface-lo);
}
.inbox-thread__hd {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.inbox-thread__title {
  min-width: 0;
}
.inbox-thread__subject {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 2px;
}
.inbox-thread__sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inbox-thread__messages {
  padding-left: 48px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inbox-msg {
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.inbox-msg--out {
  background: var(--surface);
  border-color: var(--border);
}
.inbox-msg__hd {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.inbox-msg__dir {
  font-weight: 600;
  color: var(--text-2);
}
.inbox-msg__meta {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
}
.inbox-msg__time {
  margin-left: auto;
}
.inbox-msg__body {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Compose dock */
.inbox-compose {
  border-top: 1px solid var(--border);
  padding: 14px 20px 18px;
  background: var(--surface-hi);
}
.inbox-compose__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.inbox-compose__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.inbox-compose__btn:hover {
  background: var(--surface);
}
.inbox-compose__btn.is-active {
  background: var(--surface);
  border-color: var(--brass);
  color: var(--brass-lo);
  box-shadow: 0 0 0 2px var(--brass-soft);
}
.inbox-compose__addr {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
}
.inbox-compose__form[hidden] {
  display: none;
}
.inbox-compose__subject {
  margin-bottom: 8px;
  font-size: 13px;
}
.inbox-compose__field {
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.inbox-compose__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.inbox-compose__hint {
  color: var(--text-3);
  font-size: 11px;
}

/* ── Right rail ── */
.inbox-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  /* z:0 keeps Safari's sticky compositing below header action menus (z:20) */
  z-index: 0;
  top: 72px;
}
@media (max-width: 1100px) {
  .inbox-rail {
    position: static;
  }
}
.rail-id {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px 18px 16px;
  text-align: center;
}
.rail-id .cd-avatar {
  margin: 0 auto 10px;
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.rail-id__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}
.rail-id__sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.rail-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 16px 18px;
}
.rail-card__title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.rail-action {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-lo);
  font-size: 13px;
  color: var(--text-1);
  text-decoration: none;
  line-height: 1.3;
}
.rail-action:last-child {
  border-bottom: none;
}
.rail-action i {
  color: var(--brass-lo);
  width: 14px;
  flex-shrink: 0;
  padding-top: 3px;
}
.rail-action span {
  flex: 1;
  min-width: 0;
}
.rail-action:hover {
  color: var(--brass-lo);
}
.rail-action[style*="cursor:default"]:hover {
  color: var(--text-1);
}

.rail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-lo);
  padding: 0;
  overflow: hidden;
}
.rail-stat {
  background: var(--surface);
  padding: 12px 14px;
}
.rail-stat__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.rail-stat__value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.15;
}
.rail-stat__sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.rail-stat--warn .rail-stat__value {
  color: #b45309;
}

.rail-job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-lo);
  font-size: 12.5px;
  color: var(--text-1);
  text-decoration: none;
}
.rail-job:last-child {
  border-bottom: none;
}
.rail-job:hover {
  color: var(--brass-lo);
}
.rail-job__num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.confirm-dialog {
  width: min(440px, 100%);
  border: 1px solid var(--border, #d6d3cc);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.confirm-dialog-title {
  margin: 0 0 8px;
  color: var(--text-1, #1f2933);
  font-size: 18px;
  font-weight: 700;
}

.confirm-dialog-message {
  margin: 0;
  color: var(--text-2, #4b5563);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════
   CREW ISSUE-INTAKE CHAT (#536) — FAB + popover panel
   Body-append popover pattern via bar_popover_controller.js.
═══════════════════════════════════════════ */
.issue-intake-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
}

.issue-intake-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
  transition: transform 0.12s ease;
}
.issue-intake-fab-btn:hover {
  transform: scale(1.05);
}

.issue-intake-fab-popover {
  display: none;
  position: fixed;
  z-index: 9999;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 100px));
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6d3cc);
  border-radius: var(--r-md, 10px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.22);
}
.issue-intake-fab-popover.visible {
  display: block;
}

.issue-intake-panel-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-2, #4b5563);
}
.issue-intake-panel-loading a {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.issue-intake-panel {
  display: flex;
  flex-direction: column;
  max-height: min(520px, calc(100vh - 100px));
}

.issue-intake-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-lo, #e5e2d9);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1, #1f2933);
}

.issue-intake-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-intake-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.issue-intake-bubble-assistant {
  align-self: flex-start;
  background: var(--surface-2, #f3f1ea);
  color: var(--text-1, #1f2933);
}
.issue-intake-bubble-user {
  align-self: flex-end;
  background: var(--accent, #2563eb);
  color: #fff;
}

.issue-intake-filed {
  margin: 14px 16px;
  padding: 12px 14px;
  border-radius: var(--r-md, 10px);
  background: var(--success-bg, #ecfdf5);
  border: 1px solid var(--success, #10b981);
  color: var(--text-1, #1f2933);
  font-size: 13px;
}
.issue-intake-filed a {
  color: var(--accent, #2563eb);
  font-weight: 600;
}

.issue-intake-error {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: var(--r-md, 10px);
  background: var(--danger-bg, #fef2f2);
  border: 1px solid var(--danger, #ef4444);
  color: var(--text-1, #1f2933);
  font-size: 13px;
}

.issue-intake-form {
  border-top: 1px solid var(--border-lo, #e5e2d9);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issue-intake-form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.issue-intake-form-row textarea {
  flex: 1;
  resize: none;
  min-height: 38px;
  max-height: 100px;
}

.issue-intake-photo-row {
  font-size: 11px;
  color: var(--text-2, #4b5563);
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 640px) {
  .issue-intake-fab {
    right: 14px;
    bottom: 78px; /* clear the mobile hamburger/bottom chrome */
  }
  .issue-intake-fab-popover {
    width: calc(100vw - 24px);
  }
}

@media (pointer: coarse) {
  .tab-btn,
  .context-nav__back {
    min-height: 44px;
  }
}

.pricing-workspace {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 24px;
}

/* Staff Estimate workspace: customer document on the left, consequential action
   and readiness on the right. This mirrors the Designer's design/Estimate split
   without turning the legal document into an admin form. */
.estimate-staff-workspace {
  width: 100%;
}

/* Public Estimate actions stay attached to the document they describe. Once an
   agreement is signed, the preserved signed artifact becomes the sole action. */
.public-estimate-document-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-lo);
}
.public-estimate-document-actions p {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.public-estimate-document-actions .btn-ghost {
  flex: 0 0 auto;
}
.card.card-body.public-estimate-status-card {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
}
.public-estimate-status-card p {
  max-width: 62ch;
  color: var(--text-2);
  line-height: 1.5;
}
.public-estimate-status-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .public-estimate-document-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .public-estimate-document-actions .btn-ghost,
  .public-estimate-status-card__actions .btn-primary {
    justify-content: center;
    width: 100%;
    min-height: 42px;
  }
}

/* [#19] The one context-navigation component. Sub-pages state one exact
   parent (chosen from business purpose, never browser history) plus optional
   record identity and current-document segments. Rendered in the topbar's
   left slot, so it carries no page margins of its own. */
.context-nav {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  color: var(--text-3);
}
.context-nav__back {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  flex: 0 1 auto;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: var(--brass-lo);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 650;
}
.context-nav__back:hover {
  color: var(--brass-lo);
  background: var(--surface-hi);
}
.context-nav__divider {
  width: 1px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0 10px;
  background: var(--border-hi);
}
.context-nav__record {
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-nav__separator {
  flex: 0 0 auto;
  margin: 0 8px;
  color: var(--border-hi);
  font-size: 8px;
}
.context-nav__current {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.estimate-staff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.estimate-staff-header__status {
  display: flex;
  align-items: center;
  gap: 12px;
}
.estimate-staff-header__status > strong {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: -0.03em;
}
.estimate-lifecycle {
  display: grid;
  grid-template-columns: repeat(var(--estimate-step-count, 5), minmax(0, 1fr));
  margin: 0 0 22px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  list-style: none;
}
.estimate-lifecycle__step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
}
.estimate-lifecycle__step + .estimate-lifecycle__step {
  border-left: 1px solid var(--border-lo);
}
.estimate-lifecycle__step.is-complete {
  color: var(--text-2);
  background: var(--surface-hi);
}
.estimate-lifecycle__step.is-current {
  color: var(--text-1);
  background: rgba(170, 118, 44, 0.1);
  box-shadow: inset 0 -2px 0 var(--brass);
}
.estimate-lifecycle__marker {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--border-hi);
  border-radius: 50%;
  font-size: 8px;
}
.estimate-lifecycle__marker > span {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.estimate-lifecycle__step.is-complete .estimate-lifecycle__marker,
.estimate-lifecycle__step.is-current .estimate-lifecycle__marker {
  background: var(--brass);
}
.estimate-staff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  gap: 22px;
  align-items: start;
}
.estimate-staff-document,
.estimate-staff-command {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.estimate-staff-command {
  position: sticky;
  top: 18px;
}
.estimate-scope-card {
  overflow: hidden;
}
.estimate-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-lo);
}

.estimate-section-heading__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.estimate-section-heading h2,
.estimate-command-card h2,
.estimate-terms-card h2 {
  margin: 3px 0 0;
  color: var(--text-1);
  font-size: 17px;
  line-height: 1.25;
}
.estimate-section-heading__eyebrow {
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.estimate-scope-list {
  padding: 0 20px;
}
.estimate-project-summary {
  padding: 16px 20px;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border-lo);
}
.estimate-project-summary > p:last-child {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.estimate-scope-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-lo);
}
.estimate-scope-item > .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}
.estimate-scope-item > .row:first-child {
  padding: 0 0 12px;
  color: var(--text-1);
  font-size: 14px;
}
/* The money half of a scope heading. Matched as the SECOND strong, not the
   last one, because a staff-authored section is a heading row with no amount
   beside it — and a lone heading must not be right-aligned and set in mono. */
.estimate-scope-item > .row:first-child strong + strong {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.estimate-scope-item .scope-prose {
  margin: 8px 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.estimate-scope-item .scope-label {
  color: var(--text-1);
  font-weight: 700;
}
.estimate-scope-item .product-tag {
  display: inline-flex;
  margin: 2px 5px 5px 0;
  padding: 3px 8px;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}
.estimate-scope-item .estimate-price-line {
  color: var(--text-2);
  font-size: 12px;
}

/* Per-line customer wording. The edit affordance stays quiet until the line is
   hovered or focused so the staff page still reads as the customer's document.
   The PDF and the public page render these rows without a frame. */
.estimate-scope-line {
  display: block;
  position: relative;
}
.estimate-scope-line__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 8px;
}
.estimate-scope-line__flag {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.estimate-scope-line__edit {
  color: var(--text-2);
  font-size: 12px;
  text-decoration: underline;
  opacity: 0.55;
}
.estimate-scope-line:hover .estimate-scope-line__edit,
.estimate-scope-line__edit:focus-visible {
  opacity: 1;
}
/* Stands in for the edit affordances on an item whose customer presentation
   is outdated — they would 422 (Estimates::UpdateCustomerScope#validate_presentation),
   so this quiet line offers the one trip that fixes it instead. */
.estimate-scope-line__note {
  color: var(--text-2);
  font-size: 12px;
}
.estimate-scope-line__note .estimate-scope-line__edit {
  opacity: 1;
}
.estimate-scope-line__form {
  margin: 8px 0 14px;
  padding: 14px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: 8px;
}
.estimate-scope-line__generated {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.estimate-scope-line__generated > span {
  display: block;
}
.estimate-scope-line__form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.estimate-scope-list__actions {
  margin: 0;
  padding: 0 20px 16px;
  text-align: right;
}

/* Project goal and milestones — shared by the staff page and the public
   Estimate. The PDF carries its own copy of these rules inline (Grover renders
   without the asset pipeline), so a change here needs a matching edit in
   app/views/estimates/pdf.html.erb. */
.estimate-project-goal {
  padding: 16px 20px;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border-lo);
}
.estimate-project-goal__title {
  margin: 0 0 6px;
  font-size: 15px;
}
.estimate-project-goal__statement {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.estimate-project-goal__statement p {
  margin: 0 0 8px;
}
.estimate-project-goal__statement p:last-child {
  margin-bottom: 0;
}
.estimate-project-goal__milestones-title {
  margin: 12px 0 4px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.estimate-project-goal__milestones {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

/* Visual references — shared by the staff preview and the public Estimate.
   The PDF carries its own copy of these rules inline (Grover renders without
   the asset pipeline), so a change here needs a matching edit in
   app/views/estimates/pdf.html.erb. */
.estimate-visual-references {
  margin: 20px;
}
.estimate-visual-references h2 {
  margin: 0 0 2px;
  font-size: 15px;
}
.estimate-visual-references__intro {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 12px;
}
.estimate-visual-references__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.estimate-visual-reference {
  margin: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
}
.estimate-visual-reference__image {
  display: block;
  width: 100%;
  max-height: 260px;
  background: var(--surface-hi);
  border-radius: var(--r-sm, 6px);
  object-fit: contain;
}
.estimate-visual-reference__caption {
  margin-top: 9px;
}
.estimate-visual-reference__role {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 3px 8px;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}
.estimate-visual-reference__caption strong {
  display: block;
  color: var(--text-1);
  font-size: 13px;
}
.estimate-visual-reference__disclaimer {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}

/* The staff picker reuses the wording editor's disclosure chrome; only the
   list and form bodies below are specific to images. */
.estimate-visual-reference-editor {
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
}
.estimate-visual-reference-editor h3 {
  margin: 18px 0 8px;
  font-size: 13px;
}
.estimate-visual-reference-editor h3:first-child {
  margin-top: 0;
}
.estimate-visual-reference-editor h3 small {
  margin-left: 6px;
  color: var(--text-2);
  font-weight: 500;
}
.estimate-visual-reference-editor__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.estimate-visual-reference-editor__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-lo);
}
.estimate-visual-reference-editor__row:first-child {
  border-top: 0;
}
.estimate-visual-reference-editor__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm, 6px);
  object-fit: cover;
}
.estimate-visual-reference-editor__row-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.estimate-visual-reference-editor__row-copy strong {
  display: block;
  color: var(--text-1);
  font-size: 13px;
}
.estimate-visual-reference-editor__row-copy small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 11px;
}
.estimate-visual-reference-editor__form {
  padding: 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
}
.estimate-visual-reference-editor__form + .estimate-visual-reference-editor__form {
  margin-top: 10px;
}
.estimate-visual-reference-editor__empty {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

@media (max-width: 640px) {
  .estimate-visual-reference-editor {
    margin: 12px;
  }
  .estimate-visual-reference-editor__row {
    flex-wrap: wrap;
  }
  .estimate-visual-reference-editor__row-copy {
    flex-basis: calc(100% - 84px);
  }
  .estimate-visual-reference-editor__row form {
    flex-basis: 100%;
  }
  .estimate-visual-reference-editor__row form button {
    width: 100%;
  }
}


.estimate-customer-wording-editor__summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 14px;
  gap: 12px;
  min-height: 68px;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.estimate-customer-wording-editor__summary::-webkit-details-marker {
  display: none;
}

.estimate-customer-wording-editor__summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brass) 38%, transparent);
  outline-offset: -3px;
}

.estimate-customer-wording-editor__summary:hover {
  background: var(--surface-hi);
}

.estimate-customer-wording-editor__icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--brass-lo);
  background: color-mix(in srgb, var(--brass) 12%, var(--surface));
  border-radius: 50%;
  font-size: 14px;
}

.estimate-customer-wording-editor__summary-copy,
.estimate-customer-wording-editor__summary-copy > strong,
.estimate-customer-wording-editor__summary-copy > span {
  display: block;
  min-width: 0;
}

.estimate-customer-wording-editor__summary-copy > strong {
  color: var(--text-1);
  font-size: 13px;
}

.estimate-customer-wording-editor__summary-copy > strong small {
  margin-left: 5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-customer-wording-editor__summary-copy > span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-customer-wording-editor__status {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.estimate-customer-wording-editor__chevron {
  color: var(--text-3);
  font-size: 10px;
  transition: transform 120ms ease;
}

.estimate-project-goal-editor[open] .estimate-customer-wording-editor__chevron {
  transform: rotate(180deg);
}

/* The goal editor reuses the wording editor's disclosure chrome and fields; it
   is a separate section with its own root class so each editor stays
   individually addressable. */
.estimate-project-goal-editor {
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
}

.estimate-customer-wording-editor__body {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface-hi);
  border-top: 1px solid var(--border-lo);
}

.estimate-customer-wording-editor__item {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}




.estimate-customer-wording-editor__fields {
  display: grid;
  gap: 13px;
}

.estimate-customer-wording-editor__fields .form-group {
  margin: 0;
}

.estimate-customer-wording-editor__fields .form-group > small {
  display: block;
  margin-top: 5px;
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.4;
}

.estimate-customer-wording-editor__fields textarea.form-control {
  min-height: 88px;
  resize: vertical;
}




.estimate-customer-wording-editor__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.estimate-customer-wording-editor__actions > small {
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.4;
}

.estimate-customer-wording-editor__actions .btn-primary {
  flex: 0 0 auto;
  min-height: 40px;
}

.estimate-customer-wording-editor__errors {
  margin: 12px 20px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 12px;
}

.estimate-customer-wording-editor__errors ul {
  margin: 4px 0 0 18px;
  list-style: disc;
}

.estimate-customer-wording-editor__body > .estimate-customer-wording-editor__errors {
  margin: 0;
}

@media (max-width: 640px) {
  .estimate-project-goal-editor {
    margin: 16px 12px;
  }

  .estimate-customer-wording-editor__summary {
    grid-template-columns: 38px minmax(0, 1fr) 14px;
    padding: 11px 12px;
  }

  .estimate-customer-wording-editor__summary-copy > span {
    white-space: normal;
  }

  .estimate-customer-wording-editor__status {
    grid-column: 2;
    justify-self: start;
  }

  .estimate-customer-wording-editor__chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .estimate-customer-wording-editor__body,
  .estimate-customer-wording-editor__item {
    padding: 12px;
  }

  .estimate-customer-wording-editor__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-customer-wording-editor__actions .btn-primary {
    width: 100%;
    min-height: 44px;
  }
}

.customer-scope-wording {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #d8ad56;
  border-left-width: 4px;
  border-radius: var(--r-sm);
  background: #fff9e9;
  color: #604a1d;
}

.customer-scope-wording__heading {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  color: #76530d;
  font-size: 12px;
}

.customer-scope-wording dl,
.customer-scope-wording dl > div {
  display: grid;
  gap: 3px;
}

.customer-scope-wording dl {
  margin: 0;
  gap: 8px;
}

.customer-scope-wording dt {
  color: #8a6d1f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-scope-wording dd,
.customer-scope-wording p {
  margin: 0;
  font-size: 11px;
}

.customer-scope-wording p {
  margin-top: 9px;
  color: #76530d;
  font-weight: 600;
}
.estimate-staff-totals {
  width: min(100%, 360px);
  margin-left: auto;
  padding: 18px 20px 20px;
}
.estimate-staff-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 5px 0;
  color: var(--text-2);
  font-size: 13px;
}
.estimate-staff-totals strong {
  color: var(--text-1);
  font-family: var(--font-mono);
}
.estimate-staff-totals .is-discount strong {
  color: var(--success);
}
.estimate-discount-description {
  margin: 0 0 5px;
  color: var(--text-3);
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}
.estimate-staff-totals .is-total {
  margin-top: 7px;
  padding-top: 12px;
  color: var(--text-1);
  border-top: 2px solid var(--text-1);
  font-size: 18px;
  font-weight: 750;
}
.estimate-command-card,
.estimate-blockers-card,
.estimate-terms-card,
.estimate-price-details,
.estimate-audit-card {
  padding: 18px;
}
.estimate-command-card > p:not(.estimate-section-heading__eyebrow) {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
}
.estimate-command-card__actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.estimate-command-card__actions form,
.estimate-command-card__actions .btn-primary,
.estimate-command-card__actions .btn-ghost-sm {
  width: 100%;
}
.estimate-command-card__actions .btn-primary,
.estimate-command-card__actions .btn-ghost-sm {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
}
.estimate-command-card__actions .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.estimate-send-again {
  overflow: hidden;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.estimate-send-again > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.estimate-send-again > summary::-webkit-details-marker {
  display: none;
}
.estimate-send-again > summary::after {
  content: "›";
  color: var(--text-3);
  font-size: 18px;
  transform: rotate(90deg);
  transition: transform 120ms ease;
}
.estimate-send-again[open] > summary::after {
  transform: rotate(-90deg);
}
.estimate-send-again__body {
  padding: 0 10px 10px;
  border-top: 1px solid var(--border-lo);
}
.estimate-send-again__body > p {
  margin: 9px 2px;
  color: var(--text-3);
  font-size: 11px;
}
.estimate-send-again__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.estimate-send-again__choices form,
.estimate-send-again__choices .btn-ghost-sm {
  width: 100%;
}
.estimate-signing-help {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--border-lo);
}
.estimate-signing-help small {
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.4;
}
.estimate-blockers-card {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fffbeb;
}
.estimate-blockers-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #92400e;
}
.estimate-blockers-card__title > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  border-radius: 50%;
}
.estimate-blockers-card__title strong,
.estimate-blockers-card__title small {
  display: block;
}
.estimate-blockers-card__title small {
  margin-top: 2px;
  color: #b45309;
  font-size: 10px;
}
.estimate-blockers-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.estimate-blockers-list > div {
  padding-top: 10px;
  border-top: 1px solid rgba(217, 119, 6, 0.18);
}
.estimate-blockers-list strong {
  color: #78350f;
  font-size: 12px;
}
.estimate-blockers-list p {
  margin: 3px 0 0;
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.45;
}
.estimate-terms-card .estimate-section-heading {
  padding: 0 0 13px;
}
.estimate-terms-card__hint {
  margin: 12px 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.45;
}
.estimate-money-fields {
  display: grid;
  gap: 12px;
}
.estimate-money-input {
  position: relative;
}
.estimate-money-input > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  transform: translateY(-50%);
}
.estimate-money-input .form-control {
  padding-left: 25px;
  font-family: var(--font-mono);
}
.estimate-terms-card form > .btn-ghost-sm {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
}
.estimate-optional-details {
  margin-top: 13px;
  border-top: 1px solid var(--border-lo);
}
.estimate-optional-details > summary,
.estimate-financing-program > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.estimate-optional-details > summary::-webkit-details-marker,
.estimate-financing-program > summary::-webkit-details-marker {
  display: none;
}
.estimate-optional-details > summary::after,
.estimate-financing-program > summary::after {
  color: var(--text-3);
  content: "+";
  font-size: 16px;
  font-weight: 500;
}
.estimate-optional-details[open] > summary::after,
.estimate-financing-program[open] > summary::after {
  content: "−";
}
.estimate-optional-details > summary > span,
.estimate-financing-program > summary > span {
  min-width: 0;
}
.estimate-optional-details > summary > small,
.estimate-financing-program > summary > small {
  margin-left: auto;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}
.estimate-optional-details__body {
  display: grid;
  gap: 13px;
  padding: 2px 0 4px;
}
.estimate-optional-details__body .form-group {
  margin: 0;
}
.estimate-optional-details__body .form-group > small {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.35;
}
.estimate-financing-picker {
  min-width: 0;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}
.estimate-financing-picker > legend {
  color: var(--text-1);
  font-size: 12px;
  font-weight: 700;
}
.estimate-financing-picker > p {
  margin: 4px 0 8px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.4;
}
.estimate-financing-program {
  border-top: 1px solid var(--border-lo);
}
.estimate-financing-program > summary {
  padding: 9px 0;
}
.estimate-financing-program > p {
  margin: 0 0 7px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.4;
}
.estimate-financing-terms {
  display: grid;
  gap: 5px;
  padding-bottom: 9px;
}
.estimate-financing-term {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.estimate-financing-term > input {
  margin-top: 2px;
}
.estimate-financing-term > span,
.estimate-financing-term strong,
.estimate-financing-term small {
  display: block;
  min-width: 0;
}
.estimate-financing-term strong {
  color: var(--text-1);
  font-size: 11px;
}
.estimate-financing-term small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.35;
}
.estimate-financing-term.is-unavailable {
  opacity: 0.55;
  cursor: not-allowed;
}
.estimate-financing-summary {
  margin: 0 20px 20px;
  padding: 15px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.estimate-financing-summary h2 {
  margin: 0;
  color: var(--text-1);
  font-size: 14px;
}
.estimate-financing-summary__intro,
.estimate-financing-summary__note {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.45;
}
.estimate-financing-summary__options {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}
.estimate-financing-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 7px;
  border-top: 1px solid var(--border-lo);
}
.estimate-financing-option > div > strong,
.estimate-financing-option > div > span {
  display: block;
}
.estimate-financing-option > div > strong {
  color: var(--text-1);
  font-size: 11.5px;
}
.estimate-financing-option > div > span {
  margin-top: 1px;
  color: var(--text-3);
  font-size: 10px;
}
.estimate-financing-option > strong {
  flex: 0 0 auto;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12px;
}
.estimate-financing-option > strong > small {
  margin-left: 2px;
  color: var(--text-3);
  font-family: var(--font-sans);
  font-size: 9px;
}
.estimate-evidence-list {
  display: grid;
  gap: 10px;
}
.estimate-evidence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}
.estimate-evidence-row__icon {
  color: var(--success);
}
.estimate-evidence-row strong,
.estimate-evidence-row small {
  display: block;
}
.estimate-evidence-row small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
}
.estimate-rescind-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}
.estimate-audit-card summary {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.estimate-audit-card__body {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.estimate-audit-card__evidence {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.estimate-audit-card__evidence-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.estimate-audit-card__evidence-heading small,
.estimate-audit-card__evidence-heading h3 {
  display: block;
  margin: 0;
}
.estimate-audit-card__evidence-heading small {
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.estimate-audit-card__evidence-heading h3 {
  margin-top: 2px;
  color: var(--text-1);
  font-size: 13px;
}
.estimate-price-details > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.estimate-price-details > summary small {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
}
.estimate-price-details__body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.estimate-price-details__group {
  display: grid;
  gap: 7px;
}
.estimate-price-details__group > header,
.estimate-price-details__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.estimate-price-details__group > header {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
  color: var(--text-1);
  font-size: 11.5px;
}
.estimate-price-details__group > header > span,
.estimate-price-details__row > span:last-child {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.estimate-price-details__row {
  color: var(--text-2);
  font-size: 11px;
}
.estimate-price-details__row strong,
.estimate-price-details__row small {
  display: block;
}
.estimate-price-details__row strong {
  font-weight: 550;
}
.estimate-price-details__row small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 9.5px;
}
.estimate-price-details__body > p {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.45;
}
.estimate-audit-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}
.estimate-audit-card dl > div {
  display: grid;
  gap: 2px;
}
.estimate-audit-card dt {
  color: var(--text-3);
  font-size: 10px;
  text-transform: uppercase;
}
.estimate-audit-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
  font-size: 11.5px;
}

@media (max-width: 900px) {
  .pricing-workspace {
    padding: 16px;
  }

  .estimate-staff-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .estimate-staff-command {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .pricing-workspace {
    padding: 12px;
  }

  .context-nav__record,
  .context-nav__separator {
    display: none;
  }

  .context-nav__divider {
    margin-right: 8px;
    margin-left: 8px;
  }

  .estimate-staff-header {
    align-items: flex-start;
  }

  .estimate-staff-header__status {
    align-items: flex-end;
    flex-direction: column;
  }

  .estimate-staff-header__status > strong {
    font-size: 18px;
  }

  .estimate-lifecycle {
    display: grid;
    overflow-x: hidden;
  }

  .estimate-lifecycle__step {
    min-width: 0;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 10px;
  }

  .estimate-section-heading,
  .estimate-project-summary,
  .estimate-scope-list,
  .estimate-staff-totals {
    padding-right: 14px;
    padding-left: 14px;
  }

  .estimate-financing-summary {
    margin-right: 14px;
    margin-left: 14px;
  }

  .estimate-scope-item > .row:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .estimate-scope-item > .row:first-child strong + strong {
    text-align: left;
  }

  .estimate-rescind-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .estimate-lifecycle__marker {
    display: none;
  }
}

/* Job sales workspace: make the mutable Designer and immutable Estimate history
   read as one deliberate sequence instead of two unrelated record lists. */
.sales-workspace-card,
.estimate-history-workspace {
  overflow: hidden;
  padding: 0;
}

.sales-workspace-card__header,
.estimate-history-workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
}
/* Actions live right. With the narration gone the header can hold nothing but
   its action, and a lone button still belongs on the right edge. */
.sales-workspace-card__header > :last-child {
  margin-left: auto;
}

.sales-workspace-card__header h2,
.estimate-history-workspace__header h2 {
  margin: 5px 0 6px;
  color: var(--text-1);
  font-size: 20px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.sales-workspace-card__header p:last-child,
.estimate-history-workspace__header p:last-child {
  max-width: 740px;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.sales-workspace-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sales-workspace-card__action {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  justify-items: end;
}

.sales-workspace-card__action small {
  color: var(--text-3);
  font-size: 10px;
}

.sales-workspace-launch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
}

.sales-workspace-launch__icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--brass);
  background: rgba(170, 118, 44, 0.08);
  border: 1px solid rgba(170, 118, 44, 0.2);
  border-radius: 50%;
  font-size: 13px;
}

.sales-workspace-launch__body {
  min-width: 0;
}

.sales-workspace-launch__body > span,
.sales-workspace-launch__body > strong,
.sales-workspace-launch__body > small {
  display: block;
}

.sales-workspace-launch__body > span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sales-workspace-launch__body > strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-1);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-workspace-launch__body > small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10.5px;
}

.sales-workspace-launch__action {
  white-space: nowrap;
}

.designer-ime-tools {
  margin: 0 20px 20px;
  border-top: 1px solid var(--border-lo);
}

.designer-ime-tools > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.designer-ime-tools > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.designer-ime-tools > summary i {
  color: var(--brass);
}

.designer-ime-tools > summary small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
}

.designer-ime-tools__body {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
}

.sales-workspace-card__notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 24px;
  padding: 11px 13px;
  color: var(--text-2);
  background: rgba(170, 118, 44, 0.08);
  border: 1px solid rgba(170, 118, 44, 0.2);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.45;
}

.sales-workspace-card__notice > i {
  color: var(--brass);
}

.sales-workspace-card__notice strong {
  color: var(--text-1);
}

.sales-workspace-card__notice--stale {
  justify-content: space-between;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.sales-workspace-card__notice--stale > i {
  color: var(--danger);
}

.sales-workspace-card__notice-action {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

.sales-work-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
  padding: 18px 24px 24px;
}

.sales-work-area-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}

.sales-work-area-card__index {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--brass);
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.sales-work-area-card > div {
  min-width: 0;
}

.sales-work-area-card strong,
.sales-work-area-card > div > span {
  display: block;
}

.sales-work-area-card strong {
  overflow: hidden;
  color: var(--text-1);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-work-area-card > div > span {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10.5px;
}

.sales-workspace-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 24px 24px;
  padding: 16px;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-sm);
}

.sales-workspace-empty > span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--brass);
  background: var(--surface);
  border-radius: 50%;
}

.sales-workspace-empty strong {
  display: block;
  color: var(--text-1);
  font-size: 13px;
}

.sales-workspace-empty p {
  margin: 3px 0 0;
  font-size: 11.5px;
}

.estimate-history-workspace {
  margin-top: 12px;
}

.estimate-history-workspace__header {
  padding-bottom: 16px;
}

.estimate-history-list {
  display: grid;
  gap: 8px;
  padding: 0 24px 22px;
}

.estimate-history-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
  color: inherit;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.estimate-history-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.estimate-history-card--current {
  background: linear-gradient(100deg, rgba(170, 118, 44, 0.08), var(--surface) 38%);
  border-color: rgba(170, 118, 44, 0.32);
}

.estimate-history-card__icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}

.estimate-history-card--current .estimate-history-card__icon {
  color: var(--brass);
}

.estimate-history-card__body,
.estimate-history-card__amount {
  min-width: 0;
}

.estimate-history-card__identity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.estimate-history-card__identity > strong {
  overflow: hidden;
  color: var(--text-1);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-history-card__identity .badge {
  flex: 0 0 auto;
}

.estimate-history-card__body > small,
.estimate-history-card__amount > small {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 10.5px;
}

.estimate-history-card__body > .estimate-history-card__scope {
  overflow: hidden;
  color: var(--text-2);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-history-card__amount {
  text-align: right;
}

.estimate-history-card__amount > strong {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 14px;
}

.estimate-history-card--current .estimate-history-card__amount > small {
  color: var(--brass);
  font-weight: 700;
}

.estimate-history-workspace__empty {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 24px 20px;
  padding: 13px 14px;
  color: var(--text-3);
  background: var(--surface-hi);
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-sm);
  font-size: 11.5px;
}

.estimate-history-workspace__empty strong {
  color: var(--text-1);
}

.estimate-history-archive {
  margin: 0 24px 22px;
  border-top: 1px solid var(--border-lo);
}

.estimate-history-archive > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 0;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.estimate-history-archive > summary::-webkit-details-marker {
  display: none;
}

.estimate-history-archive > summary::before {
  content: "";
  width: 5px;
  height: 5px;
  border: solid var(--text-3);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.estimate-history-archive[open] > summary::before {
  transform: rotate(45deg);
}

.estimate-history-archive > summary > span {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--surface-hi);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
}

.estimate-history-archive .estimate-history-list {
  padding: 0;
}

@media (max-width: 640px) {
  .sales-workspace-card__header,
  .estimate-history-workspace__header {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  .sales-workspace-card__action {
    justify-items: stretch;
  }

  .sales-workspace-card__action .btn-primary {
    justify-content: center;
    text-align: center;
  }

  .sales-workspace-card__action small {
    text-align: center;
  }

  .sales-workspace-launch {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 16px;
  }

  .sales-workspace-launch__action {
    grid-column: 1 / -1;
    justify-content: center;
    text-align: center;
  }

  .designer-ime-tools {
    margin-right: 16px;
    margin-left: 16px;
  }

  .sales-workspace-card__notice,
  .sales-workspace-empty {
    margin-right: 18px;
    margin-left: 18px;
  }

  .sales-workspace-card__notice--stale {
    flex-wrap: wrap;
  }

  .sales-work-area-grid,
  .estimate-history-list {
    padding-right: 18px;
    padding-left: 18px;
  }

  .estimate-history-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .estimate-history-card__amount {
    grid-column: 2;
    text-align: left;
  }

  .estimate-history-card__identity {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .estimate-history-archive {
    margin-right: 18px;
    margin-left: 18px;
  }

  .estimate-history-archive .estimate-history-list {
    padding-right: 0;
    padding-left: 0;
  }
}

.framing-defaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 14px;
  padding: 16px;
}

.report-toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.report-toolbar > .flex-center {
  min-width: 0;
  flex-wrap: wrap;
}

.completion-signature__pdf-link {
  align-items: center;
  color: #c29748;
  display: inline-flex;
  font-weight: 600;
  min-height: 44px;
}

/* HOA filing status — one canonical current revision with secondary history. */
.hoa-workspace {
  container-type: inline-size;
}

.hoa-filing {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-lo);
}

.hoa-filing__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hoa-filing__eyebrow,
.hoa-history__heading {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hoa-filing__title {
  margin: 3px 0 0;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.35;
}

.hoa-filing__generate {
  min-height: 36px;
  white-space: nowrap;
}

.hoa-filing__identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 11px;
}

.hoa-filing__state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.hoa-filing__state--approved {
  color: var(--s-complete);
  background: color-mix(in srgb, var(--s-complete) 8%, var(--surface));
}

.hoa-filing__state--submitted {
  color: var(--brass-lo);
  background: var(--brass-soft);
}

.hoa-filing__state--pending {
  color: var(--text-2);
  background: var(--surface-hi);
}

.hoa-filing__guidance {
  max-width: 680px;
  margin: 12px 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.hoa-filing__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}

.hoa-filing__field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.hoa-filing__field {
  min-width: 0;
}

.hoa-filing__field .form-control {
  width: 100%;
}

.hoa-filing__field .form-control,
.hoa-filing__save {
  min-height: 42px;
}

.hoa-filing__save {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 160px;
  margin: 0;
  white-space: nowrap;
}

.hoa-filing__finalize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--s-complete) 25%, var(--border-lo));
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--s-complete) 5%, var(--surface));
}

.hoa-filing__finalize div {
  display: grid;
  gap: 3px;
}

.hoa-filing__finalize strong {
  color: var(--text-1);
  font-size: 12px;
}

.hoa-filing__finalize span {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
}

.hoa-filing__lock {
  flex: 0 0 auto;
  min-height: 38px;
  white-space: nowrap;
}

.hoa-filing__empty {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  color: var(--text-2);
  font-size: 12px;
}

.hoa-filing__empty strong {
  color: var(--text-1);
  font-size: 13px;
}

.hoa-history {
  margin-top: 16px;
}

.hoa-history__heading {
  margin-bottom: 7px;
}

.hoa-history__table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}

.hoa-history__table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 11px;
}

.hoa-history__table th,
.hoa-history__table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-lo);
}

.hoa-history__table th {
  color: var(--text-3);
  background: var(--surface-hi);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hoa-history__table tbody tr:last-child td {
  border-bottom: 0;
}

.hoa-history__revision,
.hoa-history__error {
  font-family: var(--font-mono);
}

.hoa-history__error-cell {
  padding-top: 0 !important;
}

.hoa-history__error {
  padding: 6px 8px;
  color: var(--s-lost);
  background: color-mix(in srgb, var(--s-lost) 6%, var(--surface));
  border-radius: var(--r-sm);
  font-size: 10px;
}

@media (pointer: coarse) {
  .hoa-filing__generate,
  .hoa-filing__field .form-control,
  .hoa-filing__save,
  .hoa-filing__lock,
  .hoa-history__table a,
  .hoa-history__table button {
    min-height: 44px;
  }
}

@media (max-width: 680px) {
  .hoa-filing__header {
    align-items: stretch;
    flex-direction: column;
  }

  .hoa-filing__header form,
  .hoa-filing__generate,
  .hoa-filing__save {
    width: 100%;
  }

  .hoa-filing__finalize {
    align-items: stretch;
    flex-direction: column;
  }

  .hoa-filing__finalize form,
  .hoa-filing__lock {
    width: 100%;
  }

  .hoa-filing__form {
    grid-template-columns: 1fr;
  }

  .hoa-filing__save {
    width: 100%;
  }
}

@container (max-width: 390px) {
  .hoa-filing__form {
    grid-template-columns: 1fr;
  }

  .hoa-filing__save {
    justify-self: stretch;
    width: 100%;
  }
}

/* Required customer documents — jurisdiction authority, staff review, and
   the tokenized public upload share one status vocabulary. */
.required-document-rule-section,
.required-document-page {
  max-width: 1120px;
  margin: 0 auto 24px;
}

.required-document-rule-section {
  padding: 18px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface);
}

.required-document-section-head,
.required-document-page__head,
.required-document-panel__head,
.required-document-rule-row,
.required-document-file-row,
.required-document-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.required-document-section-head h3,
.required-document-page h1,
.required-document-panel h2 {
  margin: 0;
  color: var(--text-1);
}

.required-document-section-head h3,
.required-document-panel h2 { font-size: 15px; }
.required-document-section-head p,
.required-document-panel p,
.required-document-page__head p { margin: 4px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.55; }

.required-document-rule-list { margin-top: 14px; border-top: 1px solid var(--border-lo); }
.required-document-rule-row { padding: 14px 0; border-bottom: 1px solid var(--border-lo); }
.required-document-rule-row__body { min-width: 0; }
.required-document-rule-row__title { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text-1); }
.required-document-rule-row__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; font-size: 11px; color: var(--text-3); }
.required-document-rule-row__body > p { margin: 7px 0 0; color: var(--text-2); font-size: 12px; }
.required-document-retired-rules { margin-top: 12px; color: var(--text-3); font-size: 12px; }
.required-document-retired-rules div { padding: 5px 0 0 16px; }

.required-document-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.required-document-check-grid label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 12px; }
.required-document-definition-list { margin: 12px 0; }
.required-document-definition-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-lo); }
.required-document-definition-list dt { color: var(--text-3); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.required-document-definition-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.required-document-page { padding: 24px; }
.required-document-page__head { margin-bottom: 18px; }
.required-document-page__eyebrow { margin: 0 0 4px !important; font-family: var(--font-mono); font-size: 10px !important; letter-spacing: .08em; text-transform: uppercase; }
.required-document-page h1 { font-size: 24px; }
.required-document-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.required-document-side { display: grid; gap: 14px; }
.required-document-panel { padding: 18px; border: 1px solid var(--border-lo); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.required-document-current { margin-top: 14px; }
.required-document-file-row { align-items: center; padding: 12px; border: 1px solid var(--border-lo); border-radius: var(--r-sm); background: var(--surface-hi); }
.required-document-file-row > div { min-width: 0; flex: 1; }
.required-document-file-row strong { display: block; overflow-wrap: anywhere; }
.required-document-file-row p { margin: 3px 0 0; }
.required-document-file-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--brass); background: color-mix(in srgb, var(--brass) 10%, var(--surface)); }

.required-document-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid var(--border-lo); border-radius: 999px; background: var(--surface-hi); color: var(--text-2); font-size: 10px; font-weight: 700; white-space: nowrap; }
.required-document-status--accepted { color: var(--s-active); border-color: color-mix(in srgb, var(--s-active) 30%, var(--border-lo)); background: color-mix(in srgb, var(--s-active) 8%, var(--surface)); }
.required-document-status--rejected,
.required-document-status--needs-replacement { color: var(--s-lost); border-color: color-mix(in srgb, var(--s-lost) 30%, var(--border-lo)); background: color-mix(in srgb, var(--s-lost) 7%, var(--surface)); }
.required-document-status--pending-review,
.required-document-status--missing { color: #92400e; border-color: #f3d59b; background: #fff8e8; }

.required-document-rejection,
.required-document-acceptance,
.required-document-pending,
.required-document-alert { margin-top: 12px; padding: 11px 12px; border-radius: var(--r-sm); font-size: 12px; line-height: 1.5; }
.required-document-rejection { color: #7f1d1d; border: 1px solid #fecaca; background: #fff5f5; }
.required-document-acceptance { color: #14532d; border: 1px solid #bbf7d0; background: #f0fdf4; }
.required-document-pending,
.required-document-alert { color: #78350f; border: 1px solid #fde68a; background: #fffbeb; }
.required-document-rejection p,
.required-document-acceptance p { margin: 3px 0 0; }

.required-document-review-actions { display: grid; gap: 12px; margin-top: 14px; }
.required-document-reject-form { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border-lo); }
.required-document-revoke { margin-top: 14px; font-size: 12px; }
.required-document-revoke form { display: grid; gap: 8px; margin-top: 8px; }
.required-document-upload-form { display: grid; gap: 9px; margin-top: 12px; }
.required-document-upload-form .btn-primary { justify-self: start; }
.app-form-help { color: var(--text-3); font-size: 11px; line-height: 1.45; }

.required-document-history { margin-top: 18px; }
.required-document-history-row { align-items: center; padding: 12px 0; border-top: 1px solid var(--border-lo); }
.required-document-history-row > div { min-width: 0; }
.required-document-history-row strong,
.required-document-history-row p { overflow-wrap: anywhere; }
.required-document-history-row p { margin: 3px 0 0; color: var(--text-3); font-size: 11px; }
.required-document-empty { padding: 18px; text-align: center; color: var(--text-2); background: var(--surface-hi); border: 1px dashed var(--border-lo); border-radius: var(--r-sm); }
.required-document-empty p { margin: 5px 0 0; color: var(--text-3); font-size: 12px; }

.required-document-compact-list { display: grid; }
.required-document-compact-row,
.required-document-job-row { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.required-document-compact-row { justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border-lo); }
.required-document-compact-row:first-child { border-top: 0; }
.required-document-compact-row span { display: grid; min-width: 0; }
.required-document-compact-row small { color: var(--text-3); }
.required-document-inline-note { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }

.required-documents-job-panel { margin-bottom: 16px; }
.required-documents-job-panel__body { padding: 0; overflow: hidden; }
.required-document-job-row { padding: 12px 14px; border-bottom: 1px solid var(--border-lo); }
.required-document-job-row:last-child { border-bottom: 0; }
.required-document-job-row__icon { color: var(--brass); }
.required-document-job-row__body { display: grid; min-width: 0; flex: 1; }
.required-document-job-row__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }

.required-document-message-preview { margin: 16px 0; padding: 16px; border: 1px solid var(--border-lo); border-radius: var(--r-sm); background: var(--surface-hi); line-height: 1.6; }

.public-required-document-card { max-width: 620px; margin: 0 auto; padding: 32px 28px; border-radius: 8px; background: #fff; box-shadow: 0 4px 16px rgba(28,26,23,.06); }
.public-required-document-card h1 { margin: 0 0 10px; font-family: var(--font-display); font-size: 26px; }
.public-required-document-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; margin-bottom: 16px; border-radius: 50%; color: #7b4f20; background: #f6eadb; }
.public-required-document-lead,
.public-required-document-instructions,
.public-required-document-footnote { color: var(--text-muted); line-height: 1.6; }
.public-required-document-instructions { margin: 18px 0; padding: 12px 14px; border-left: 3px solid #b98750; background: #fbf7f2; }
.public-required-document-form { display: grid; gap: 10px; margin-top: 20px; }
.public-required-document-form label { font-weight: 650; }
.public-required-document-form input[type="file"] { width: 100%; min-height: 46px; padding: 10px; border: 1px solid #d7d2ca; border-radius: 6px; background: #fff; }
.public-required-document-form .btn-primary { min-height: 44px; }
.public-required-document-form > p,
.public-required-document-footnote { margin: 0; font-size: 12px; }
.public-required-document-rejection { padding: 12px; border: 1px solid #fecaca; border-radius: 6px; color: #7f1d1d; background: #fff5f5; }
.public-required-document-rejection p { margin: 4px 0 0; }
.public-required-document-card--success { text-align: center; }

@media (pointer: coarse) {
  .required-document-page .btn-primary,
  .required-document-page .btn-ghost-sm,
  .required-document-page .btn-danger,
  .required-document-job-row,
  .required-document-compact-row,
  .public-required-document-form .btn,
  .required-document-check-grid label,
  .required-document-confirmation,
  .required-document-rule-modal .app-form-input,
  .required-document-page .app-form-input { min-height: 44px; }
}

@media (max-width: 820px) {
  .required-document-layout { grid-template-columns: 1fr; }
  .required-document-page { padding: 18px; }
  .required-document-section-head,
  .required-document-page__head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 520px) {
  .required-document-page { padding: 14px; }
  .required-document-page h1 { font-size: 21px; }
  .required-document-rule-section { padding: 14px; }
  .required-document-rule-row,
  .required-document-file-row,
  .required-document-history-row { align-items: stretch; flex-direction: column; }
  .required-document-check-grid { grid-template-columns: 1fr; }
  .required-document-definition-list > div { grid-template-columns: 1fr; gap: 3px; }
  .required-document-page .btn-primary,
  .required-document-page .btn-ghost-sm,
  .required-document-page .btn-danger,
  .required-document-upload-form .btn-primary { width: 100%; min-height: 44px; justify-content: center; }
  .required-document-upload-form input[type="file"] { min-height: 44px; }
  .required-document-job-row { align-items: flex-start; flex-wrap: wrap; }
  .required-document-job-row .required-document-status { margin-left: 34px; }
  .required-document-job-row__body small { white-space: normal; }
  .public-required-document-card { padding: 26px 20px; }
}

/* ── Sold celebration (#1955) ─────────────────────────────────────────────
   A fixed, nonmodal acknowledgement for the assigned salesperson. It lives
   outside the workspace flow so selling a job never rearranges the page. */
.sold-celebration {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}

.sold-celebration__toast {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: min(430px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--s-sold) 34%, var(--border));
  border-left: 4px solid var(--s-sold);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text-1);
  pointer-events: auto;
  animation: sold-celebration-enter 220ms ease-out both;
}

.sold-celebration__mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--s-sold) 13%, var(--surface));
  color: var(--s-sold);
  font-size: 18px;
}

.sold-celebration__copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.sold-celebration__copy strong {
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
}

.sold-celebration__copy > span:last-child {
  color: var(--text-2);
  font-size: 12px;
}

.sold-celebration__eyebrow {
  color: var(--s-complete);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sold-celebration__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sold-celebration__link,
.sold-celebration__dismiss {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

.sold-celebration__link {
  padding: 0 11px;
  color: var(--brass-lo);
  font-size: 12px;
  font-weight: 700;
}

.sold-celebration__link:hover { background: var(--brass-soft); }

.sold-celebration__dismiss {
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.sold-celebration__dismiss:hover { background: var(--surface-hi); color: var(--text-1); }

.sold-celebration__confetti span {
  position: absolute;
  top: -20px;
  left: 8%;
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: var(--brass);
  opacity: 0;
  transform: rotate(18deg);
  animation: sold-confetti-fall 900ms 38ms ease-in both;
}

.sold-celebration__confetti span:nth-child(3n) { background: var(--s-sold); }
.sold-celebration__confetti span:nth-child(3n + 2) { background: var(--nav-mid); }
.sold-celebration__confetti span:nth-child(2) { left: 16%; animation-delay: 76ms; }
.sold-celebration__confetti span:nth-child(3) { left: 24%; animation-delay: 114ms; }
.sold-celebration__confetti span:nth-child(4) { left: 32%; animation-delay: 152ms; }
.sold-celebration__confetti span:nth-child(5) { left: 40%; animation-delay: 190ms; }
.sold-celebration__confetti span:nth-child(6) { left: 48%; animation-delay: 228ms; }
.sold-celebration__confetti span:nth-child(7) { left: 56%; animation-delay: 266ms; }
.sold-celebration__confetti span:nth-child(8) { left: 64%; animation-delay: 304ms; }
.sold-celebration__confetti span:nth-child(9) { left: 72%; animation-delay: 342ms; }
.sold-celebration__confetti span:nth-child(10) { left: 80%; animation-delay: 380ms; }
.sold-celebration__confetti span:nth-child(11) { left: 88%; animation-delay: 418ms; }
.sold-celebration__confetti span:nth-child(12) { left: 96%; animation-delay: 456ms; }

@keyframes sold-confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -16px, 0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(34px, 72vh, 0) rotate(330deg); }
}

@keyframes sold-celebration-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .sold-celebration__toast {
    right: 16px;
    bottom: 16px;
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .sold-celebration__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .sold-celebration__toast { animation: none; }
  .sold-celebration__confetti { display: none; }
}
