/* ============================================================
   Provider Portal — job page (quote, availability, messages)
   ============================================================ */
.job-topnav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--ha-space-4) 2px var(--ha-space-1);
  color: var(--ha-blue-text);
  font-size: var(--ha-fs-small);
  text-decoration: none;
}
.job-topnav svg { width: 18px; height: 18px; }
.job-title {
  font-size: var(--ha-fs-h2);
  line-height: var(--ha-lh-h2);
  font-weight: var(--ha-weight-bold);
  letter-spacing: -0.01em;
  margin: var(--ha-space-1) 0 0;
}

/* Job hero: the opportunity framing above the quote. The teal "paid job" chip
   pairs color with a label (color-signifies rule) and tells the provider this is
   real, vetted, and paid -- relief from Angi/LSA noise. */
.job-hero { margin: var(--ha-space-2) 0 var(--ha-space-5); }
.job-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ha-fs-caption);
  font-weight: var(--ha-weight-bold);
  color: var(--ha-success);
  background: var(--ha-portal-won-tint);
  padding: 4px 11px;
  border-radius: var(--ha-radius-pill);
}
.job-eyebrow svg { width: 14px; height: 14px; }
.job-hero .job-title { margin: var(--ha-space-3) 0 0; }
.job-meta {
  font-size: var(--ha-fs-small);
  color: var(--ha-ink-muted);
  margin: var(--ha-space-2) 0 0;
}
.job-meta .where { color: var(--ha-blue-primary); font-weight: var(--ha-weight-medium); }
.job-meta strong { color: var(--ha-blue-primary); font-weight: var(--ha-weight-bold); }
.job-meta .dot { margin: 0 5px; color: var(--ha-border); }
.job-scope {
  font-size: var(--ha-fs-body);
  line-height: var(--ha-lh-body);
  color: var(--ha-blue-primary);
  margin: var(--ha-space-3) 0 0;
}

/* Quote — price-first field */
.price-field {
  display: flex;
  align-items: center;
  gap: var(--ha-space-2);
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius-md);
  padding: 8px 14px;
}
.price-field:focus-within {
  border-color: var(--ha-blue-accent);
  box-shadow: var(--ha-portal-focus);
}
.price-field .cur {
  font-size: var(--ha-fs-h3);
  font-weight: var(--ha-weight-bold);
  color: var(--ha-ink-muted);
}
.price-field input {
  border: 0;
  outline: none;
  font: inherit;
  font-size: var(--ha-fs-h2);
  font-weight: var(--ha-weight-bold);
  color: var(--ha-blue-primary);
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.price-field input:disabled { color: var(--ha-ink-muted); background: transparent; }
.price-field-sm { padding: 6px 12px; }
.price-field-sm input { font-size: var(--ha-fs-h3); }

/* Quote mode segmented control (fixed / range / free estimate). The checked
   segment lifts to the white surface; color is always paired with the label. */
.quote-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--ha-surface-subtle);
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius-md);
  padding: 4px;
  margin-bottom: var(--ha-space-4);
}
.quote-mode { position: relative; }
.quote-mode input { position: absolute; opacity: 0; width: 0; height: 0; }
.quote-mode span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 6px;
  border-radius: var(--ha-radius-sm);
  font-size: var(--ha-fs-small);
  font-weight: var(--ha-weight-medium);
  color: var(--ha-ink-muted);
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.quote-mode:has(input:checked) span {
  background: var(--ha-surface);
  color: var(--ha-blue-primary);
  font-weight: var(--ha-weight-bold);
  box-shadow: 0 1px 2px rgba(20, 60, 85, 0.12); /* navy base at 12% */
}
.quote-mode:has(input:focus-visible) span { box-shadow: var(--ha-portal-focus); }

.quote-panel[hidden] { display: none; }

/* Discount (fixed price only) */
.discount-field { margin-top: var(--ha-space-4); }
.discount-field > label {
  display: block;
  font-size: var(--ha-fs-small);
  font-weight: var(--ha-weight-medium);
  color: var(--ha-blue-primary);
  margin-bottom: var(--ha-space-2);
}
.discount-field .price-field-sm { max-width: 160px; }
.field-hint {
  font-size: var(--ha-fs-caption);
  color: var(--ha-ink-muted);
  margin: var(--ha-space-2) 0 0;
}

/* Price range: two fields with a dash between */
.range-row { display: flex; align-items: flex-end; gap: var(--ha-space-3); margin-top: var(--ha-space-3); }
.range-field { flex: 1; }
.range-cap {
  display: block;
  font-size: var(--ha-fs-caption);
  font-weight: var(--ha-weight-bold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ha-ink-muted);
  margin-bottom: var(--ha-space-2);
}
.range-dash { color: var(--ha-ink-muted); padding-bottom: 12px; }

/* Free estimate explainer */
.free-note {
  display: flex;
  gap: var(--ha-space-3);
  background: var(--ha-portal-won-tint);
  border-radius: var(--ha-radius-md);
  padding: var(--ha-space-4);
}
.free-note svg { width: 22px; height: 22px; color: var(--ha-success); flex: none; margin-top: 2px; }
.free-note strong { display: block; color: var(--ha-blue-primary); font-size: var(--ha-fs-body); }
.free-note p {
  margin: var(--ha-space-2) 0 0;
  font-size: var(--ha-fs-small);
  color: var(--ha-blue-primary);
  line-height: var(--ha-lh-body);
}

/* Break-it-down disclosure */
.quote-disclose {
  margin-top: var(--ha-space-3);
  font-size: var(--ha-fs-small);
  color: var(--ha-blue-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 6px 0;
  font-family: inherit;
}
.quote-disclose svg { width: 14px; height: 14px; transition: transform 120ms ease; }
.quote-breakdown[hidden] { display: none; }
.quote-disclose[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Add-line chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ha-space-2);
  margin: var(--ha-space-3) 0 var(--ha-space-1);
}
.chip-add {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ha-radius-pill);
  border: 1px dashed var(--ha-border);
  background: var(--ha-surface);
  color: var(--ha-blue-primary);
  font: inherit;
  font-size: var(--ha-fs-small);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-add:hover { border-color: var(--ha-blue-accent); background: var(--ha-portal-hover); }
.chip-add:focus-visible { outline: none; box-shadow: var(--ha-portal-focus); }
.chip-add svg { width: 14px; height: 14px; color: var(--ha-blue-text); }

/* Quote line rows */
.quote-line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--ha-space-3);
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--ha-border-strong);
}
.quote-line:last-of-type { border-bottom: 0; }
.quote-line .line-desc {
  font: inherit;
  font-size: var(--ha-fs-small);
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius-sm);
  padding: 6px 10px;
  background: var(--ha-surface);
  min-width: 0;
}
.quote-line .line-desc:focus-visible { outline: none; box-shadow: var(--ha-portal-focus); }
.quote-line .price-field-sm { width: 110px; }
.quote-line .line-amt {
  font-size: var(--ha-fs-small);
  font-weight: var(--ha-weight-bold);
  font-variant-numeric: tabular-nums;
}
.quote-line .line-remove {
  background: none;
  border: 0;
  color: var(--ha-ink-muted);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
}
.quote-line .line-remove:hover { color: var(--ha-danger); }
.quote-line .line-remove svg { width: 15px; height: 15px; }

/* Shown-to-homeowner toggle */
.shown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ha-fs-caption);
  color: var(--ha-ink-muted);
  cursor: pointer;
  user-select: none;
}
.shown-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.shown-toggle .sw {
  width: 30px;
  height: 18px;
  border-radius: var(--ha-radius-pill);
  background: var(--ha-border);
  position: relative;
  transition: background-color 120ms ease;
  flex: none;
}
.shown-toggle .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ha-on-primary);
  transition: transform 120ms ease;
}
.shown-toggle input:checked + .sw { background: var(--ha-blue-text); }
.shown-toggle input:checked + .sw::after { transform: translateX(12px); }
.shown-toggle input:focus-visible + .sw { box-shadow: var(--ha-portal-focus); }
.shown-toggle .label-on { display: none; }
.shown-toggle .label-off { display: inline; }
.shown-toggle:has(input:checked) .label-on { display: inline; }
.shown-toggle:has(input:checked) .label-off { display: none; }

/* Homeowner-sees total */
.quote-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: var(--ha-space-3);
  padding-top: var(--ha-space-3);
  border-top: 2px solid var(--ha-border-strong);
}
.quote-total .lab { font-size: var(--ha-fs-small); color: var(--ha-ink-muted); }
.quote-total .num {
  font-size: var(--ha-fs-h2);
  font-weight: var(--ha-weight-bold);
  font-variant-numeric: tabular-nums;
}
.quote-submit { margin-top: var(--ha-space-4); }

/* Availability (embedded in the quote form) */
.availability {
  margin-top: var(--ha-space-5);
  padding-top: var(--ha-space-5);
  border-top: 1px solid var(--ha-border-strong);
}
.avail-heading {
  font-size: var(--ha-fs-body-lg);
  font-weight: var(--ha-weight-bold);
  margin: 0 0 var(--ha-space-3);
}
.avail-note {
  font-size: var(--ha-fs-small);
  color: var(--ha-ink-muted);
  margin: 0 0 var(--ha-space-3);
}
.slot-row { display: flex; flex-wrap: wrap; gap: var(--ha-space-2); }
.avail-slot {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--ha-radius-md);
  border: 1px solid var(--ha-border);
  background: var(--ha-slot-preferred);
  color: var(--ha-blue-primary);
  font: inherit;
  font-size: var(--ha-fs-small);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.avail-slot input { position: absolute; opacity: 0; width: 0; height: 0; }
.avail-slot .check { width: 14px; height: 14px; opacity: 0; }
.avail-slot:has(input:checked) {
  background: var(--ha-slot-selected);
  border-color: var(--ha-slot-selected);
  color: var(--ha-on-primary);
}
.avail-slot:has(input:checked) .check { opacity: 1; }
.avail-slot:has(input:focus-visible) { box-shadow: var(--ha-portal-focus); }
.avail-propose {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--ha-radius-md);
  border: 1px dashed var(--ha-border);
  background: var(--ha-surface);
  color: var(--ha-blue-text);
  font: inherit;
  font-size: var(--ha-fs-small);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.avail-propose svg { width: 14px; height: 14px; }
.avail-match {
  margin-top: var(--ha-space-3);
  font-size: var(--ha-fs-small);
  color: var(--ha-slot-match);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: var(--ha-weight-medium);
}
.avail-match svg { width: 15px; height: 15px; }
.avail-none {
  margin-top: var(--ha-space-3);
  font-size: var(--ha-fs-small);
  color: var(--ha-ink-muted);
}

/* Month calendar. The provider taps every day they can do; preferred days are
   tinted, the chosen days fill navy. Selection is pure CSS (:has on a hidden
   checkbox), so it survives without JS -- months simply stack. */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--ha-space-2) 0 var(--ha-space-3);
}
.cal-label { font-size: var(--ha-fs-body); font-weight: var(--ha-weight-bold); color: var(--ha-blue-primary); }
.cal-arrow {
  width: 40px;
  height: 40px;
  border-radius: var(--ha-radius-md);
  border: 1px solid var(--ha-border);
  background: var(--ha-surface);
  color: var(--ha-blue-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-arrow svg { width: 18px; height: 18px; }
.cal-arrow:hover { background: var(--ha-portal-hover); }
.cal-arrow:disabled { opacity: 0.35; cursor: default; }
.cal-arrow:focus-visible { outline: none; box-shadow: var(--ha-portal-focus); }
.cal-month[hidden] { display: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-month + .cal-month { margin-top: var(--ha-space-4); }
.cal-wd {
  text-align: center;
  font-size: var(--ha-fs-caption);
  font-weight: var(--ha-weight-bold);
  color: var(--ha-ink-muted);
  padding-bottom: var(--ha-space-1);
}
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ha-fs-small);
  border-radius: var(--ha-radius-sm);
  color: var(--ha-blue-primary);
  font-variant-numeric: tabular-nums;
}
.cal-day.is-outside { visibility: hidden; }
.cal-day.is-past { color: var(--ha-border-strong); }
label.cal-day { cursor: pointer; border: 1px solid transparent; }
label.cal-day:hover { background: var(--ha-portal-hover); }
.cal-day input { position: absolute; opacity: 0; width: 0; height: 0; }
.cal-day.is-preferred {
  background: var(--ha-slot-preferred);
  border-color: var(--ha-slot-preferred);
  font-weight: var(--ha-weight-bold);
}
label.cal-day:has(input:checked) {
  background: var(--ha-slot-selected);
  border-color: var(--ha-slot-selected);
  color: var(--ha-on-primary);
  font-weight: var(--ha-weight-bold);
}
label.cal-day:has(input:focus-visible) { box-shadow: var(--ha-portal-focus); }
.cal-count {
  margin: var(--ha-space-3) 0 0;
  font-size: var(--ha-fs-small);
  color: var(--ha-ink-muted);
  min-height: 20px;
}

/* Messages */
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: var(--ha-space-4);
  margin: var(--ha-space-4) 0 var(--ha-space-5);
}
.msg-row { display: flex; flex-direction: column; gap: var(--ha-space-1); }
.msg-row.from-me { align-items: flex-end; }
/* Group a sender's run: consecutive same-sender rows sit tight; the gap
   between senders stays the .msg-thread gap. The meta line only reads under
   the last bubble of a run (hidden when the next row is the same sender). */
.msg-row.from-me + .msg-row.from-me,
.msg-row.from-them + .msg-row.from-them { margin-top: calc(-1 * var(--ha-space-3)); }
.msg-row.from-me:has(+ .msg-row.from-me) .msg-meta,
.msg-row.from-them:has(+ .msg-row.from-them) .msg-meta { display: none; }
.bubble {
  max-width: 78%;
  padding: var(--ha-space-3) var(--ha-space-4);
  border-radius: 16px;
  font-size: var(--ha-fs-body);
  line-height: var(--ha-lh-body);
}
.bubble.them {
  background: var(--ha-surface-subtle);
  border: 1px solid var(--ha-border);
  border-bottom-left-radius: var(--ha-radius-sm);
  color: var(--ha-blue-primary);
}
.bubble.me {
  background: var(--ha-blue-primary);
  color: var(--ha-on-primary);
  border-bottom-right-radius: var(--ha-radius-sm);
}
.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 2px var(--ha-space-1) 0;
  font-size: var(--ha-fs-caption);
  color: var(--ha-ink-muted);
}
.msg-who { font-weight: var(--ha-weight-medium); }

/* Empty state: centered, warm, with real presence. */
.msg-empty {
  margin: var(--ha-space-5) 0;
  padding: var(--ha-space-6) var(--ha-space-4);
  text-align: center;
  color: var(--ha-blue-primary);
}
.msg-empty svg {
  width: 36px;
  height: 36px;
  color: var(--ha-ink-muted);
  margin-bottom: var(--ha-space-3);
}
.msg-empty-lead {
  margin: 0;
  font-size: var(--ha-fs-body-lg);
  font-weight: var(--ha-weight-bold);
}
.msg-empty-sub {
  max-width: 34ch;
  margin: var(--ha-space-2) auto 0;
  font-size: var(--ha-fs-small);
  line-height: var(--ha-lh-small);
  color: var(--ha-ink-muted);
}

/* Composer: first-class touch input; the Send button sits BELOW it. */
.msg-composer { display: flex; flex-direction: column; gap: var(--ha-space-3); }
.msg-composer input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius-md);
  padding: var(--ha-space-3) var(--ha-space-4);
  font: inherit;
  font-size: var(--ha-fs-body);
  outline: none;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.msg-composer input::placeholder { color: var(--ha-ink-muted); }
.msg-composer input:focus {
  border-color: var(--ha-blue-accent);
  box-shadow: var(--ha-portal-focus);
}
.msg-composer .portal-btn { width: 100%; }
.scoped-note {
  font-size: var(--ha-fs-caption);
  line-height: var(--ha-lh-caption);
  color: var(--ha-ink-muted);
  margin-top: var(--ha-space-4);
  display: flex;
  gap: var(--ha-space-2);
  align-items: center;
}
.scoped-note svg { width: 14px; height: 14px; flex: none; }

/* "The request" — the homeowner's ask, a defined read-only section. */
.section-head { margin-bottom: var(--ha-space-4); }
.section-head h2 { margin: 0; }
.section-sub {
  display: block;
  font-size: var(--ha-fs-small);
  color: var(--ha-ink-muted);
  margin-top: 2px;
}
.request-scope p {
  font-size: var(--ha-fs-body);
  line-height: var(--ha-lh-body);
  color: var(--ha-blue-primary);
  margin: 0;
}
.request-scope .muted { color: var(--ha-ink-muted); }
.request-availability {
  margin-top: var(--ha-space-4);
  padding-top: var(--ha-space-4);
  border-top: 1px solid var(--ha-border-strong);
}
.request-label {
  display: block;
  font-size: var(--ha-fs-caption);
  font-weight: var(--ha-weight-bold);
  color: var(--ha-ink-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: var(--ha-space-2);
}
.request-dates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--ha-space-2); }
.request-dates li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ha-fs-small);
  color: var(--ha-blue-primary);
  font-weight: var(--ha-weight-medium);
}
.request-dates svg { width: 15px; height: 15px; color: var(--ha-ink-muted); flex: none; }
.request-dates .anytime { color: var(--ha-ink-muted); font-weight: var(--ha-weight-book); }
.request-pattern { font-size: var(--ha-fs-small); color: var(--ha-blue-primary); margin: 0; }

/* The proposed-time / Agree card. */
.date-proposal p {
  font-size: var(--ha-fs-body);
  line-height: var(--ha-lh-body);
  color: var(--ha-blue-primary);
  margin: 0;
}
.date-proposal .portal-btn { margin-top: var(--ha-space-4); }
