:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-sunken: #ebe7dd;
  --ink: #20261d;
  --muted: #6e7568;
  --line: rgba(32, 38, 29, 0.12);
  --accent: #29623f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(41, 98, 63, 0.10);
  --amber: #a15d1f;
  --amber-soft: rgba(161, 93, 31, 0.12);
  --red: #a13529;
  --red-soft: rgba(161, 53, 41, 0.10);
  --radius: 18px;
  --radius-sm: 12px;

  /* --- #387: shadows tinted toward --ink (warm dark green-black), not a
     generic gray - keeps elevation feeling like it belongs to this
     palette instead of a stock UI-kit shadow. --shadow-color is redefined
     per theme below (dark surfaces need a true black-based shadow - an
     ink-tinted one would render as a pale glow instead of depth). */
  --shadow-color: 32, 38, 29;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-color), 0.07), 0 1px 1px rgba(var(--shadow-color), 0.05);
  --shadow-md: 0 10px 24px -10px rgba(var(--shadow-color), 0.28), 0 2px 8px rgba(var(--shadow-color), 0.08);

  /* --- Type system (#387): Fraunces for headings/display, Inter for
     everything else, a real ratio-derived scale (~1.2, from a 16px body
     base) instead of the ad hoc pixel values this file used to scatter
     across two dozen rules. --text-sm/--text-xs previously overlapped
     confusingly (12.5px vs 13.5px vs 14px with no logic tying them
     together) - collapsed onto this fixed set everywhere below. */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text-2xs: 11px;
  --text-xs: 13px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 19px;
  --text-xl: 23px;
  --text-2xl: 28px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14170f;
    --surface: #1d2117;
    --surface-sunken: #0f120c;
    --ink: #eee9de;
    --muted: #9a9d8d;
    --line: rgba(238, 233, 222, 0.10);
    --accent: #6fbf82;
    --accent-ink: #0f1a10;
    --accent-soft: rgba(111, 191, 130, 0.16);
    --amber: #d99a54;
    --amber-soft: rgba(217, 154, 84, 0.14);
    --red: #e08277;
    --red-soft: rgba(224, 130, 119, 0.14);

    --shadow-color: 0, 0, 0;
    --shadow-sm: 0 1px 2px rgba(var(--shadow-color), 0.35), 0 1px 1px rgba(var(--shadow-color), 0.25);
    --shadow-md: 0 12px 28px -10px rgba(var(--shadow-color), 0.55), 0 2px 8px rgba(var(--shadow-color), 0.3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header: a slim identity row, not a filled color block --- */
header.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 16px;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

header.top .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

header.top .brand-name {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-lg);
  line-height: 1.2;
}

header.top .brand-sub {
  font-size: var(--text-xs);
  color: var(--muted);
}

main, .content { padding: 24px 0 40px; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
  margin: 0 0 6px;
}

h1 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  font-optical-sizing: auto;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p.lede {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: var(--text-sm);
}

.step-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--muted);
  margin: 0 0 10px;
}

.section { margin-bottom: 30px; }

/* --- Inputs: filled, borderless, pill/rounded, sunken (recessed) so
   elevated cards elsewhere read as raised by contrast, not sunken
   themselves --- */
input[type="text"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 16px; /* deliberately not a scale token - 16px is the iOS
    Safari threshold below which a focused input triggers an unwanted
    page zoom; every text input on this mobile-first app keeps this
    exact value regardless of the type scale above. */
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder { color: var(--muted); }
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

button {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  padding: 13px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
  transition: filter 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
@media (hover: hover) {
  button:hover:not(:disabled) { filter: brightness(1.08); box-shadow: var(--shadow-md); }
  button.ghost:hover:not(:disabled),
  button.plain:hover:not(:disabled) { filter: none; background: var(--accent-soft); box-shadow: none; }
}
button:active:not(:disabled) { opacity: 0.85; transform: translateY(1px); }
button:disabled { background: var(--surface-sunken); color: var(--muted); cursor: not-allowed; box-shadow: none; }
button:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

button.block { width: 100%; }

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
button.ghost:focus-visible { outline-color: var(--accent); }

button.plain {
  background: none;
  color: var(--accent);
  padding: 6px 4px;
  font-size: var(--text-sm);
  box-shadow: none;
  border-radius: var(--radius-sm);
}
button.plain:focus-visible { outline-color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }

/* --- Address chip (collapsed step 1 after submit) --- */
.chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
}
.chip-row .chip-icon { flex-shrink: 0; opacity: 0.7; }
.chip-row .chip-text { flex: 1; }
.chip-row button.plain { flex-shrink: 0; }

/* --- Photo picker --- */
.dropzone {
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
  background: var(--surface-sunken);
  border: 1.5px dashed var(--line);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dropzone.drag { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; }
.thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: var(--text-2xs);
  padding: 1px 5px;
  border-radius: 4px;
}

/* --- Sticky bottom action bar --- */
.bottom-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  margin: 0 -20px;
}
.bottom-bar .row { max-width: 440px; margin: 0 auto; }

/* --- Persistent app shell nav (Phase 1 PR 3, approved redesign plan) ---
   A SECOND, separate bar from .bottom-bar above - that one is a
   contextual per-screen CTA ("Analyze property" -> "Build scope" etc,
   text changes per screen), this one is the permanent Home | Projects |
   Customers | More tab bar. `position: fixed` (not sticky, like
   .bottom-bar) because this lives OUTSIDE .wrap's own scroll context, as
   a direct child of body - fixed anchors it to the viewport itself,
   which is what "persists across every screen" actually requires here.

   Found in review: a sticky element's `bottom: 0` resolves against the
   scrollport (viewport) edge, not against an ancestor's padding-bottom -
   `body.shell-active`'s own padding-bottom (below) does NOT by itself
   stop .bottom-bar above this fixed bar; without an explicit offset the
   two would overlap at the literal screen bottom on phone widths. The
   rule right after .tab-nav-icon below gives .bottom-bar that offset
   directly instead. */
.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 4px 0 env(safe-area-inset-bottom);
}
.tab-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  color: var(--muted);
  padding: 8px 4px 6px;
  cursor: pointer;
}
.tab-nav-item.active { color: var(--accent); font-weight: var(--fw-semibold); }
.tab-nav-icon { font-size: 20px; line-height: 1; }

/* Reserve space so the fixed bar never covers page content - approximate
   real height (icon + label + padding + safe area) rather than an exact
   pixel match, matching this file's existing "close enough, verify on a
   real device" tolerance for safe-area-dependent layout elsewhere.
   `.shell-active` is toggled on `<body>` in JS at the same moment
   `#tab-nav` itself is shown/hidden (showApp/showSignin) - not `:has()`,
   to avoid depending on a CSS feature this app's own iOS Safari target
   versions aren't guaranteed to have. */
body.shell-active { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
/* Same reserved height as the body padding above, applied to the sticky
   bar's own offset so it stops above the fixed tab-nav rather than
   behind it. */
body.shell-active .bottom-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }

/* Tablet: a compact left rail instead of a bottom bar - the design
   principles' own "tablet-enhanced" requirement. 768px matches this
   file's own existing device-testing target (iPad Safari, per the
   redesign plan's own verification section) rather than a generic
   breakpoint guess. */
@media (min-width: 768px) {
  .tab-nav {
    top: 0;
    bottom: 0;
    right: auto;
    width: 84px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 24px 0 0;
    border-top: none;
    border-right: 1px solid var(--line);
  }
  .tab-nav-item { padding: 12px 4px; }
  body.shell-active { padding-bottom: 0; padding-left: 84px; }
  /* Rail lives on the left at this width, not the bottom - .bottom-bar
     goes back to sitting flush with the real viewport bottom. */
  body.shell-active .bottom-bar { bottom: 0; }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-banner {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-sm);
  margin-bottom: 22px;
}
.status-banner.error { background: var(--red-soft); color: var(--red); }
.status-banner summary { cursor: pointer; font-size: var(--text-xs); margin-top: 6px; }
.status-banner pre {
  white-space: pre-wrap;
  font-size: var(--text-2xs);
  margin: 6px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.85;
}

.results-summary { color: var(--muted); font-size: var(--text-xs); margin-bottom: 18px; }

/* --- #386: coverage-gaps banner - quiet/non-alarming (plain
   .status-banner, no .error), shown only on the wizard's first step. --- */
.coverage-gaps-row { display: flex; align-items: flex-start; gap: 10px; }
.coverage-gaps-row > div:first-child { flex: 1; }
.coverage-gaps-list { margin: 6px 0 0; padding-left: 18px; }
.coverage-gaps-list li { margin-bottom: 2px; }
.coverage-gaps-dismiss { flex-shrink: 0; line-height: 1; }
.muted { color: var(--muted); }

/* --- Review wizard (#376: one category group per step, Back/Next,
   a final Review & Finalize summary step) --- */
#wizard-progress { margin-bottom: 14px; }

.wizard-nav { margin-top: 18px; }
.wizard-nav button.ghost { flex: 0 0 auto; }
.wizard-nav button.block { flex: 1; }

.finalize-counts { display: flex; gap: 8px; margin: 4px 0 14px; flex-wrap: wrap; }
.finalize-count {
  flex: 1 1 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
}
.finalize-count-value {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.finalize-count-value.accepted { color: var(--accent); }
.finalize-count-value.edited { color: var(--amber); }
.finalize-count-value.rejected { color: var(--red); }

.category-group { margin-bottom: 24px; }
.category-heading {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--muted);
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 1px 7px;
  border-radius: 999px;
  font-family: var(--font-body);
}

.finding {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.category-group .finding:last-child { border-bottom: none; }
.finding .top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.finding .item-name { font-weight: var(--fw-semibold); font-size: var(--text-base); }
.finding .desc { font-size: var(--text-sm); margin: 4px 0; color: var(--ink); opacity: 0.85; }
.finding .meta { font-size: var(--text-xs); color: var(--muted); }

.confidence {
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.confidence.high { background: var(--accent-soft); color: var(--accent); }
.confidence.medium { background: var(--amber-soft); color: var(--amber); }
.confidence.low { background: var(--red-soft); color: var(--red); }

.price-note {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--muted);
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: var(--text-sm); }

/* --- Human review (#161: accept/edit/reject one grouped finding at a time) --- */
.review-status {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--muted);
}
.review-status.accepted { color: var(--accent); }
.review-status.edited { color: var(--amber); }
.review-status.rejected { color: var(--red); }

.review-actions { display: flex; gap: 8px; margin-top: 10px; }
.review-btn {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: none;
  color: var(--ink);
  box-shadow: none;
}
@media (hover: hover) {
  .review-btn:hover:not(:disabled) { background: var(--surface); }
}
.review-btn.accept { border-color: var(--accent); color: var(--accent); }
.review-btn.edit { border-color: var(--amber); color: var(--amber); }
.review-btn.reject { border-color: var(--red); color: var(--red); }

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
}
.edit-form input {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.edit-form input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.edit-form .save-edit { align-self: flex-start; border-color: var(--accent); color: var(--accent); }

/* --- Simple list rows (admin tenant list, no card boxes) --- */
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: var(--fw-semibold); }

.link-out {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.hidden { display: none !important; }

/* --- Property History screen (#378: search/archive/delete) --- */
.top-nav-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.property-result {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.property-result:last-child { border-bottom: none; }
.property-result .property-address-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
}
.property-result .property-address { font-weight: var(--fw-semibold); font-size: var(--text-base); }
.property-result .property-meta { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }
.property-result .archived-badge {
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.property-actions { display: flex; gap: 8px; margin-top: 10px; }
.property-actions button {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: none;
  color: var(--ink);
  box-shadow: none;
}
@media (hover: hover) {
  .property-actions button:hover { background: var(--surface); }
}
.property-actions .btn-review { border-color: var(--accent); color: var(--accent); }
.property-actions .btn-archive { border-color: var(--amber); color: var(--amber); }
.property-actions .btn-delete { border-color: var(--red); color: var(--red); }

.property-proposal-history {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}
.property-proposal-history .proposal-history-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.property-proposal-history .proposal-history-row:last-child { border-bottom: none; }
/* #377: each row is a real <button> now (links to the proposal view),
   not inert text - reset it back to looking like the plain row above. */
.property-proposal-history button.proposal-history-row {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 0;
}
@media (hover: hover) {
  .property-proposal-history button.proposal-history-row:hover { color: var(--accent); }
}

/* --- Proposal view (#377: real staff-facing view of a built proposal,
   Options -> Lines, read-only discount/tax/terms, Send) --- */
.proposal-option-card {
  padding: 18px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.proposal-option-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.proposal-option-name {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-lg);
}
.proposal-option-total { color: var(--accent); font-weight: var(--fw-bold); font-size: var(--text-lg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.proposal-lines { display: flex; flex-direction: column; }
.proposal-line-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.proposal-line-row:last-child { border-bottom: none; }
.proposal-line-item { font-weight: var(--fw-semibold); font-size: var(--text-sm); }
.proposal-line-desc { font-size: var(--text-xs); color: var(--ink); opacity: 0.8; margin: 3px 0; }
.proposal-line-meta { font-size: var(--text-2xs); color: var(--muted); }
.proposal-line-price { font-size: var(--text-sm); font-weight: var(--fw-semibold); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.optional-badge {
  margin-left: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  vertical-align: middle;
}

.proposal-version-meta { padding-top: 6px; margin-top: 4px; }
.proposal-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--muted);
}
.proposal-meta-row:last-child { border-bottom: none; }
.proposal-meta-row span:first-child { color: var(--ink); font-weight: var(--fw-semibold); flex-shrink: 0; }
.proposal-meta-row.terms span:last-child { text-align: right; }

/* --- Phase 2 PR 5 (approved mobile/auth/catalog redesign plan): Scope
   Builder (Step 4) + Price screen (Step 5). Line rows deliberately reuse
   .proposal-line-item/.proposal-line-desc/.proposal-line-price/
   .optional-badge from the proposal-view block above (same visual
   vocabulary for "one scoped item," just with controls this read-only
   view doesn't have) rather than duplicating those rules. --- */
.scope-line-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.scope-line-row:last-child { border-bottom: none; }
.scope-line-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.scope-line-qty-input {
  width: 72px !important;
  padding: 8px 10px !important;
  font-size: var(--text-sm) !important;
}
.scope-line-match { margin-top: 8px; }
.scope-match-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--text-xs);
}
.scope-match-suggestion.muted { color: var(--muted); }

.scope-addon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.scope-addon-card:last-child { border-bottom: none; }
.scope-addon-main { flex: 1; }
.scope-addon-card button.block { flex: 0 0 auto; width: auto; padding: 10px 18px; }

.price-total-box { text-align: center; padding: 36px 0 24px; }
.price-total-value {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 44px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.price-total-label { color: var(--muted); font-size: var(--text-sm); margin-top: 4px; }

/* --- #397: Property Intelligence review screen (provider read-only
   context + promotable attributes, real observations with a per-row
   "keep verified" checkbox) --- */
select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 16px; /* same iOS-zoom-threshold reasoning as text inputs, above */
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--ink);
}
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.provider-card {
  padding: 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.provider-attr-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: var(--text-sm);
}
.provider-attr-row span:first-child { color: var(--muted); }
.provider-attr-row span:last-child { text-align: right; font-weight: var(--fw-medium); }
.provider-warnings {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.promotable-list { margin-top: 10px; }
.promotable-row { padding: 10px 0; border-top: 1px solid var(--line); }
.promotable-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
}
.promotable-row input.promote-description,
.promotable-row input.promote-quantity {
  margin-top: 6px;
  font-size: var(--text-xs);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-sunken);
  color: var(--ink);
}

.observation-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.observation-row:last-child { border-bottom: none; }
.observation-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.observation-item { font-weight: var(--fw-semibold); font-size: var(--text-sm); }
.observation-desc { font-size: var(--text-xs); color: var(--ink); opacity: 0.85; margin: 2px 0; }
.observation-meta { font-size: var(--text-2xs); color: var(--muted); }
.verified-badge {
  margin-left: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

/* Phase 1 PR 5 (approved redesign plan): the Property Review summary's
   "not yet confirmed" marker - deliberately its OWN class, not a reuse
   of .verified-badge with different text, since that class's accent
   color reads as a positive/affirmative signal and this is the
   opposite state. Muted, not red/.error - matching this file's own
   established "unconfirmed is useful information to double-check,
   never alarming" idiom (see #385/#386's own status-banner usage). */
.needs-confirmation-badge {
  margin-left: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  vertical-align: middle;
}

/* --- #432: guided video capture (Capability 6). The assistant row
   deliberately reuses header.top's own brand-mark shape rather than
   introducing a second visual identity - see index.html's own note on
   why this surface has a role and not a name. --- */
.assistant-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.assistant-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.assistant-mark.small { width: 24px; height: 24px; font-size: var(--text-xs); }

.assistant-name {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  line-height: 1.2;
}

.assistant-sub { font-size: var(--text-xs); color: var(--muted); }

.capture-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-sunken);
  box-shadow: var(--shadow-sm);
}

.capture-stage video {
  display: block;
  width: 100%;
  /* A walkthrough is held in portrait; letterboxing beats cropping the
     thing the Estimator is pointing at. */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #000;
}

.capture-timer {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.capture-ducking {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
}

.capture-ducking-note {
  font-size: var(--text-2xs);
  color: var(--muted);
  margin: 8px 0 0;
}

#guided-capture-transcript {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
}

.capture-turn { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.capture-turn + .capture-turn { border-top: 1px solid var(--line); }
.capture-turn-text { font-size: var(--text-sm); }
.capture-turn-system .capture-turn-text { color: var(--muted); font-size: var(--text-xs); }

.capture-counters {
  margin-top: 8px;
  font-size: var(--text-2xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.capture-summary { margin-top: 12px; }

.capture-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.capture-summary-row:last-child { border-bottom: none; }
.capture-summary-row span:last-child { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

.capture-relay-warning { font-size: var(--text-xs); color: var(--amber); margin-top: 10px; }

/* --- #387: honor reduced-motion for every transition/animation this
   file defines (spinner, button/input/dropzone transitions). --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
