:root {
  --primary: #37474f;
  --accent: #e8762d;
  --bg: #f6f7f8;
  --card: #ffffff;
  --ink: #1c2529;
  --muted: #68757c;
  --line: #dde3e6;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
}
header {
  background: var(--primary); color: #fff;
  position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 1px 6px rgba(16,24,40,.25);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px;
}
/* brand = the shop's logo mark only, and it's the home link */
.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.brand-mark {
  background: var(--accent); color: #fff; border-radius: 10px;
  width: 40px; height: 40px; flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: .5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}
/* account at the top: the avatar circle (shown by showOwnerChrome only) */
.header-account { display: inline-flex; text-decoration: none; border-radius: 999px; }
.header-account[hidden] { display: none; }
.header-account.is-active .header-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.header-avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem; line-height: 1;
}
/* flat icon set — inline SVGs referencing the sprite in index.html.
   Single color via currentColor; stroke style matches the tab-bar icons.
   Paths carry no fill/stroke of their own, so they inherit these. */
.ic {
  width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
.ic-solid { fill: currentColor; }
h2 .ic, .slot-title .ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.review-sent .ic, .review-label .ic { vertical-align: -0.2em; }
.chip .ic { margin-right: 2px; }
.dash-row-amt .ic { margin-right: 3px; }

/* bottom tab bar — ServiceTitan-style flat icon tabs (logged-in views only,
   unhidden by showOwnerChrome once a sign-in is confirmed) */
#tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(16,24,40,.08);
  padding-bottom: env(safe-area-inset-bottom);
}
#tab-bar[hidden] { display: none; }
.tab-inner { max-width: 520px; margin: 0 auto; display: flex; }
.tab {
  position: relative;
  flex: 1 1 0; min-width: 0; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 7px 2px 6px;
  color: var(--muted); text-decoration: none;
  font-size: 10.5px; font-weight: 600; line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
}
/* needs-action count on the Board tab (sample count from the dashboard mock) */
.tab-badge {
  position: absolute; top: 5px; left: calc(50% + 3px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.tab-badge[hidden] { display: none; }
.tab svg {
  width: 23px; height: 23px; flex: 0 0 auto; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab.is-active { color: var(--accent); }
/* keep page content clear of the fixed bar */
body.has-tabbar footer { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.avatar-lg {
  width: 64px; height: 64px; flex: 0 0 64px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.7rem;
}
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
.view[hidden] { display: none; }
.hero h1 { margin: 8px 0 4px; font-size: 1.8rem; }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; }
.call-line a { color: var(--primary); font-weight: 700; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-top: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.card.narrow { max-width: 420px; margin: 32px auto 0; }
form label { display: block; font-weight: 600; margin: 12px 0 4px; }
form label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 10px 11px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400;
}
textarea { resize: vertical; }
.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 8px; cursor: pointer;
  padding: 10px 16px; background: #e8edef; color: var(--ink);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-block { width: 100%; margin-top: 18px; padding: 13px; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); padding: 6px 12px; }
.btn-small { padding: 7px 12px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: wait; }
.error { color: var(--danger); font-weight: 600; }
.thanks { text-align: center; }

/* board */
#board-columns {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-top: 18px; align-items: start;
}
.board-col h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 10px; }
.board-col .col-count { color: var(--primary); }
.lead-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 999px; padding: 3px 8px; color: #fff; background: var(--muted); white-space: nowrap;
}
.badge.st-new { background: #1565c0; }
.badge.st-quoted { background: #6a4bc4; }
.badge.st-scheduled { background: #b07d10; }
.badge.st-done { background: #2e7d32; }
.badge.st-lost { background: #757575; }
.lead-service { font-weight: 700; color: var(--primary); margin-top: 3px; }
.lead-details { margin: 7px 0; white-space: pre-wrap; }
.lead-meta { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.lead-meta a { color: var(--primary); font-weight: 700; text-decoration: none; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lead-actions .btn { padding: 6px 10px; font-size: .85rem; }
.review-panel {
  margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px;
}
.review-label { font-weight: 700; margin: 0 0 6px; }
.sim-tag { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.review-preview {
  background: var(--bg); border-radius: 8px; padding: 9px 11px; margin: 0 0 9px;
  font-size: .92rem; white-space: pre-wrap;
}
.review-sent { color: #2e7d32; font-weight: 700; margin: 10px 0 0; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 16px 30px; }

/* settings / connect wizard */
.help { font-size: .88rem; color: var(--muted); font-weight: 400; line-height: 1.5; }
.step { border-top: 1px dashed var(--line); padding: 14px 0 6px; margin-top: 14px; }
.step:first-of-type { border-top: 0; margin-top: 6px; }
.step h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 9px; }
.step p { margin: 6px 0; line-height: 1.55; }
.step-num {
  background: var(--primary); color: #fff; border-radius: 999px; flex: 0 0 auto;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 800;
}
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* account page */
.acct-identity { display: flex; align-items: center; gap: 16px; }
.acct-identity-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.acct-biz-name {
  font-size: 1.25rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.info-list { margin: 6px 0 0; }
.info-row { display: flex; gap: 14px; padding: 10px 0; border-top: 1px dashed var(--line); }
.info-row:first-child { border-top: 0; padding-top: 2px; }
.info-row dt { flex: 0 0 128px; color: var(--muted); font-weight: 600; }
.info-row dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.signout-card { margin-top: 34px; }
.btn-danger { background: #fbe9e7; color: var(--danger); }
.card a.btn { text-decoration: none; display: inline-block; }

/* dashboard (mock — phase-2 spec 3.10) */
.sample-line { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sample-tag {
  background: var(--accent); color: #fff; border-radius: 999px; flex: 0 0 auto;
  padding: 4px 11px; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
.dash-grid { display: grid; grid-template-columns: 1fr; column-gap: 16px; align-items: start; }
@media (min-width: 760px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-wide { grid-column: 1 / -1; }
}
.dash-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.big-number { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.dash-sub { color: var(--muted); margin: 3px 0 10px; }
.dash-delta { color: #2e7d32; font-weight: 700; margin: 4px 0 0; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 112px; margin-top: 16px; }
.bar-col {
  flex: 1; height: 100%; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
}
.bar-val { font-size: .68rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.bar { width: 70%; max-width: 40px; background: #b9c6cb; border-radius: 5px 5px 0 0; }
.bar-now { background: var(--accent); }
.bar-month { font-size: .7rem; font-weight: 600; color: var(--muted); }
.chart-title { font-size: .8rem; margin: 8px 0 0; }
.dash-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-top: 1px dashed var(--line); line-height: 1.45;
}
.dash-row-amt { color: var(--primary); font-weight: 700; white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-top: 6px; }
.stat { background: var(--bg); border-radius: 10px; padding: 11px 13px; }
.stat-val { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .78rem; font-weight: 600; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.feed { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); line-height: 1.45; }
.feed-when { flex: 0 0 104px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px;
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .88rem;
}
.chip-status { color: var(--muted); font-weight: 600; }
.chip-status.on { color: #2e7d32; font-weight: 700; }

/* account tabs + APIs connections hub (spec 6.0) */
.seg-tabs {
  display: flex; gap: 4px; margin-top: 16px; padding: 4px;
  background: #e8edef; border-radius: 10px;
}
.seg-tab {
  flex: 1 1 0; font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 7px; padding: 9px 12px;
  background: transparent; color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.seg-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.14); }
.apis-intro { margin-top: 16px; line-height: 1.55; }
.slot-title { margin: 26px 0 6px; font-size: 1.12rem; }
.mock-tag {
  display: inline-block; background: #e8edef; color: var(--muted);
  border-radius: 999px; padding: 4px 11px;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.mock-note {
  background: var(--bg); border: 1px dashed var(--line); border-radius: 8px;
  padding: 10px 12px; font-weight: 600; line-height: 1.5;
}

/* ===== Phase-2 visual layer (2026-11-10): approvals, enrichments, crew,
   portal, customer record — all mock/sample surfaces ===== */

/* approvals strip on the board */
.approvals-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.approvals-head h2 { margin: 0; font-size: 1.15rem; }
.approvals-sub { margin: 4px 0 0; }
.appr-card { border-left: 4px solid var(--accent); }
.appr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appr-head .ic { width: 1.2em; height: 1.2em; color: var(--primary); }
.held-chip {
  margin-left: auto; background: #fdf3e3; color: #8a5a00; border: 1px solid #ecd9ae;
  border-radius: 999px; padding: 3px 9px; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.appr-body { line-height: 1.55; margin: 9px 0 2px; }

/* AI enrichment on sample lead cards */
.lead-enrich { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.triage-chip {
  display: inline-block; border-radius: 999px; padding: 3px 9px;
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.triage-standard { background: #e8edef; color: var(--muted); }
.triage-urgent { background: #fbe9e7; color: var(--danger); }
.ai-summary { font-style: italic; color: var(--muted); margin: 7px 0 0; line-height: 1.45; font-size: .9rem; }
.photo-row { display: flex; gap: 8px; margin-top: 10px; }
.photo-thumb {
  flex: 1 1 0; min-width: 0; aspect-ratio: 4 / 3; border-radius: 8px;
  border: 1px dashed #b9c6cb; color: var(--muted);
  background: linear-gradient(150deg, #eef3f5, #dbe4e8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: .68rem; font-weight: 700; text-align: center; padding: 6px; line-height: 1.3;
}
.photo-thumb .ic { width: 22px; height: 22px; }
.photo-preview { display: flex; gap: 8px; margin-top: 8px; }
.photo-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid #d8dde3; display: block; background: #eef3f5; }
.quote-chip, .checklist-line { font-size: .88rem; font-weight: 600; margin: 9px 0 0; line-height: 1.45; }
.quote-chip { color: #6a4bc4; }
.checklist-line { color: var(--primary); }
.customer-links { margin: 9px 0 0; font-weight: 700; font-size: .9rem; }
.customer-links a { color: var(--accent); text-decoration: none; }

/* dashboard: office crew + needs action + plans */
.crew-list { margin-top: 12px; }
.crew-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-top: 1px dashed var(--line); line-height: 1.4;
}
.crew-name { font-weight: 800; flex: 0 0 auto; }
.crew-name .ic { color: var(--primary); }
.crew-summary { color: var(--muted); font-size: .88rem; font-weight: 600; flex: 1 1 auto; min-width: 140px; }
.status-chip {
  border-radius: 999px; padding: 3px 9px; flex: 0 0 auto;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.chip-run { background: #e6f4ea; color: #2e7d32; }
.chip-idle { background: #e8edef; color: var(--muted); }
.chip-held { background: #fdf3e3; color: #8a5a00; }
.needs-card { border-left: 4px solid var(--accent); }
.needs-card a.btn { text-decoration: none; display: inline-block; }

/* mock sponsor placements (owner side only — never customer facing) */
.sponsor-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}
.sponsor-label .ic { color: var(--accent); }
.sponsor-card { background: #fbfcfd; }
.sponsor-brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.sponsor-badge {
  background: #263238; color: #fff; border-radius: 6px; padding: 4px 10px;
  font-weight: 800; letter-spacing: .1em; font-size: .85rem;
}
.sponsor-headline { font-size: 1.05rem; margin: 6px 0 4px; line-height: 1.35; }
.sponsor-copy { line-height: 1.55; margin: 4px 0 10px; }
.sponsor-fine { font-size: .75rem; color: var(--muted); line-height: 1.45; margin: 10px 0 0; }
.sponsor-prefs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px;
  font-size: .85rem; font-weight: 600; color: var(--muted); line-height: 1.4;
}
.sponsor-prefs .ic { color: var(--primary); }
.sponsor-prefs a { margin-left: auto; color: var(--accent); font-weight: 700; text-decoration: none; }
.sponsor-note {
  margin-top: 10px; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--bg); padding: 10px 12px;
}
.sponsor-note p { margin: 6px 0; line-height: 1.5; font-size: .9rem; }

/* customer portal */
.tracker { display: flex; gap: 0; margin: 14px 0 6px; }
.track-step {
  flex: 1 1 0; min-width: 0; text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 4px;
}
.track-step::before {
  content: ""; position: absolute; top: 17px; left: -50%; width: 100%;
  border-top: 3px solid var(--line); z-index: 0;
}
.track-step:first-child::before { display: none; }
.track-step.is-done::before, .track-step.is-current::before { border-top-color: #2e7d32; }
.track-dot {
  width: 34px; height: 34px; border-radius: 999px; z-index: 1;
  background: #e8edef; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.track-dot .ic { width: 18px; height: 18px; }
.track-step.is-done .track-dot { background: #2e7d32; color: #fff; }
.track-step.is-current .track-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(232,118,45,.22); }
.track-label { font-weight: 800; font-size: .86rem; line-height: 1.25; }
.track-when { color: var(--muted); font-size: .76rem; font-weight: 600; }
.opt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.opt-card {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  border: 2px solid var(--line); border-radius: 10px; padding: 13px 14px; margin: 0;
  font-weight: 400;
}
.opt-card input { width: auto; margin-top: 3px; flex: 0 0 auto; accent-color: var(--accent); }
.opt-card.is-selected { border-color: var(--accent); background: #fdf6f0; }
.opt-body { flex: 1 1 auto; min-width: 0; }
.opt-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.opt-price { margin-left: auto; font-weight: 800; color: var(--primary); font-size: 1.05rem; white-space: nowrap; }
.opt-badge {
  background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.opt-desc { display: block; color: var(--muted); margin-top: 3px; line-height: 1.45; font-size: .92rem; }
.sig-box {
  border: 1px dashed #b9c6cb; border-radius: 8px; background: var(--bg);
  min-height: 56px; display: flex; align-items: center; padding: 8px 14px; margin-top: 8px;
}
.sig-preview { color: var(--muted); font-style: italic; }
.sig-preview.is-signed {
  font-family: "Segoe Script", "Brush Script MT", cursive; font-style: normal;
  font-size: 1.45rem; color: var(--ink);
}
.inv-total { border-top: 2px solid var(--line); font-size: 1.05rem; }
.stars { color: var(--accent); white-space: nowrap; }
.stars .ic { width: .95em; height: .95em; vertical-align: -0.12em; }

/* customer record */
.cust-icon { width: 44px; height: 44px; color: var(--accent); flex: 0 0 auto; }
.recognition-line { font-size: 1.18rem; font-weight: 800; color: var(--primary); line-height: 1.4; margin: 4px 0; }

/* ===== Layout rework (2026-11-10): Phone = the inbox, Customers = the book ===== */

/* connection strip on /phone (real tenantSettings state) */
.conn-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: 10px; padding: 11px 14px; margin-top: 14px;
  font-weight: 600; line-height: 1.45;
}
.conn-strip a { font-weight: 800; text-decoration: none; white-space: nowrap; }
.conn-off { background: #fdf3e3; border: 1px solid #ecd9ae; color: #7a5200; }
.conn-off a { color: #8a5a00; }
.conn-on { background: #e6f4ea; border: 1px solid #bfe3c8; color: #1e5c26; }
.conn-on a { color: #2e7d32; }

/* Contacts filter: ONE button + a bottom sheet of radio options
   (2026-11-12 — the pill-chip row wrapped into blobs on a phone;
   the sheet mirrors the phone's own Filter-calls dialog). */
.filter-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 16px; padding: 12px 14px;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  -webkit-tap-highlight-color: transparent;
}
.filter-btn .ic { color: var(--primary); }
.filter-btn .filter-chev { margin-left: auto; color: var(--muted); }
.filter-scrim { z-index: 45; }
body.has-tabbar .filter-scrim { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.45); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
body.has-tabbar .filter-scrim.open { opacity: 1; pointer-events: auto; }
@media (min-width: 760px) {
  body .filter-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(16,24,40,.45); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
  body .filter-scrim.open { opacity: 1; pointer-events: auto; }
}
.filter-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  background: var(--card); border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--line);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .26s ease;
  max-width: 640px; margin: 0 auto;
}
.filter-sheet.open { transform: translateY(0); }
.filter-sheet h3 { margin: 0 0 6px; font-size: 1.05rem; }
.filter-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 4px; background: none; border: none; border-top: 1px dashed var(--line);
  font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.filter-opt .radio {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card);
}
.filter-opt.is-active .radio { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--card); }
.thread-row {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; margin-top: 10px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.thread-ic {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 999px;
  background: var(--bg); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.thread-ic .ic { width: 19px; height: 19px; }
.thread-main { flex: 1 1 auto; min-width: 0; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-name { font-weight: 800; }
.thread-time { margin-left: auto; color: var(--muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.thread-snip {
  display: block; color: var(--muted); font-size: .9rem; line-height: 1.4; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-tags { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.mini-tag {
  border-radius: 999px; padding: 2px 8px; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.tag-office { background: #e8edef; color: var(--muted); }
.tag-handed { background: var(--danger); color: #fff; }
.tag-urgent { background: #fbe9e7; color: var(--danger); }
.unread-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); flex: 0 0 10px; margin-top: 4px; }

/* thread view: bubbles + call summary */
.bubble-row { display: flex; margin-top: 10px; }
.bubble {
  max-width: 82%; border-radius: 14px; padding: 10px 13px; line-height: 1.5; font-size: .95rem;
}
.bubble-cust { background: #e8edef; color: var(--ink); border-bottom-left-radius: 4px; margin-right: auto; }
.bubble-office { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; }
.bubble-who { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .75; margin-bottom: 3px; }
.call-card { border-left: 4px solid var(--accent); }
.call-card h3 { margin: 0 0 6px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.call-card p { margin: 6px 0; line-height: 1.55; }
.reply-card label { margin-top: 0; }

/* customers: the book */
.cust-search { margin-top: 16px; }
.cust-search input { margin-top: 0; }
.cust-row {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; margin-top: 10px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.cust-row .cust-icon { width: 34px; height: 34px; }
.cust-row-main { flex: 1 1 auto; min-width: 0; }
.cust-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cust-row-name { font-weight: 800; }
.cust-row-area { color: var(--muted); font-size: .84rem; font-weight: 600; }
.plan-chip {
  background: #e6f4ea; color: #2e7d32; border-radius: 999px; padding: 2px 8px;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.cust-row-summary { display: block; margin-top: 3px; line-height: 1.45; }
.cust-row-touch { display: block; color: var(--muted); font-size: .84rem; margin-top: 3px; }
.cust-row-arrow { color: var(--muted); align-self: center; }

/* referral program (mock — spec 3.6): portal card, account settings,
   board attribution line */
.ref-label {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 16px 0 5px;
}
.ref-code-box {
  border: 1px dashed #b9c6cb; border-radius: 8px; background: var(--bg);
  padding: 11px 14px; font-weight: 800; letter-spacing: .14em;
  font-size: 1.1rem; color: var(--primary);
}
.ref-link-box {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 9px 12px; font-size: .9rem; color: var(--muted); overflow-wrap: break-word;
}
.ref-earned { color: #2e7d32; font-weight: 700; margin: 12px 0 0; }
.ref-line { font-size: .88rem; font-weight: 600; margin: 9px 0 0; line-height: 1.45; color: #2e7d32; }
.ref-toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; line-height: 1.45; }
.ref-toggle input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }

/* ===== Chat: talk to your agent + crew (2026-11-11) =====
   Slack-style: every message left-aligned with an avatar chip and a name
   line; the agent's rows carry an accent edge so it stands out in a room.
   The conversation list reuses .thread-row from the inbox. */
.chat-people { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-weight: 600; }
.chat-hint { font-size: .88rem; margin-top: 4px; }
.chat-msg { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.chat-ava {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 999px;
  background: #e8edef; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .92rem;
}
.chat-ava-agent { background: var(--accent); color: #fff; }
.chat-body { flex: 1 1 auto; min-width: 0; }
.chat-who { font-weight: 800; font-size: .88rem; }
.chat-time { color: var(--muted); font-weight: 600; font-size: .76rem; margin-left: 5px; }
.chat-text { display: block; margin-top: 2px; line-height: 1.5; }
.chat-msg-agent .chat-body {
  background: #fdf6ec; border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 8px 11px;
}

/* ===== Mobile floating hamburger (2026-11-12, Jacob's direction) =====
   Under 760px, owner views (body.has-tabbar) lose the green header bar;
   a floating hamburger button takes its place, and its panel carries
   what the bar carried: shop identity, Dashboard, Account. Desktop and
   public views (booking, login, portal) keep the bar as before. */
.menu-btn, .menu-panel, .menu-scrim { display: none; }
@media (max-width: 759px) {
  body.has-tabbar #site-header { display: none; }
  body.has-tabbar main { padding-top: 70px; }
  body.has-tabbar .menu-btn {
    display: inline-flex; position: fixed;
    top: calc(10px + env(safe-area-inset-top)); left: 12px; z-index: 30;
    width: 44px; height: 44px; border-radius: 999px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16,24,40,.18);
    align-items: center; justify-content: center; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-btn .ic { width: 22px; height: 22px; }
  /* the drawer: slides in from the left edge over a dimmed scrim */
  body.has-tabbar .menu-scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(16,24,40,.45);
    opacity: 0; pointer-events: none; transition: opacity .26s ease;
  }
  body.has-tabbar .menu-scrim.open { opacity: 1; pointer-events: auto; }
  body.has-tabbar .menu-panel {
    display: block; position: fixed; top: 0; left: 0; z-index: 40;
    width: 292px; max-width: 84vw; height: 100dvh; overflow-y: auto;
    background: var(--card); border-right: 1px solid var(--line);
    box-shadow: 8px 0 30px rgba(16,24,40,.25);
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-106%); transition: transform .26s ease;
  }
  body.has-tabbar .menu-panel.open { transform: translateX(0); }
  .menu-close {
    margin-left: auto; flex: 0 0 auto; width: 34px; height: 34px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card);
    color: var(--muted); font-size: .95rem; cursor: pointer; line-height: 1;
  }
  .menu-div { border-top: 1px solid var(--line); margin: 8px 0; }
  .menu-head { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); }
  .menu-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 9px; }
  .menu-id { display: flex; flex-direction: column; min-width: 0; }
  .menu-name { font-weight: 800; line-height: 1.25; }
  .menu-email { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-link { display: flex; align-items: center; gap: 10px; padding: 11px 8px; text-decoration: none; color: var(--ink); font-weight: 700; border-radius: 8px; }
  .menu-link:active { background: var(--bg); }
}

/* ===== Contacts: the rolodex (2026-11-12) =====
   Phone + Customers merged. Rows ride on .thread-row; urgency is the
   sort and the color language. The detail is a contact card in the
   shape of a phone's contact screen: identity head, round action
   buttons, then stacked info cards. */
.con-ava {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 999px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem;
}
.con-ava-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.4rem; background: var(--accent); }
.con-reason { display: block; color: var(--ink); font-size: .92rem; line-height: 1.45; margin-top: 2px; }
.con-call { color: var(--primary); flex: 0 0 auto; align-self: center; display: inline-flex; }
.con-call .ic { width: 20px; height: 20px; }
.tier-chip {
  border-radius: 999px; padding: 2px 8px; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.tier-now { background: var(--danger); color: #fff; }
.tier-today { background: #fbe9e7; color: var(--danger); }
.tier-week { background: #e8edef; color: var(--muted); }
.tier-good { background: #e6f4ea; color: #2e7d32; }
.con-head { display: flex; gap: 14px; align-items: center; }
.con-head-main { min-width: 0; }
.con-head h2 { margin: 0; }
.con-sub { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.con-actions { display: flex; gap: 12px; margin-top: 14px; }
.con-act {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 6px 10px; color: var(--primary); text-decoration: none;
  font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.con-act .ic { width: 21px; height: 21px; }
.con-why h3, #contact-detail-body .card h3 { margin: 0 0 6px; font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.con-why p { margin: 6px 0; line-height: 1.55; }
.fact-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); line-height: 1.45; }
.fact-row:first-of-type { border-top: none; }
.fact-k { flex: 0 0 92px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.fact-v { flex: 1 1 auto; }

/* ===== Chat: one pinned 1:1 window (2026-11-12) =====
   The shell is sized to the viewport so the window itself never scrolls
   away: the header and composer are fixed rows, and only the message
   list scrolls, inside the shell. On mobile the shell accounts for the
   70px floating-menu headroom and the tab bar. */
/* Full screen, no card (2026-11-12): the shell is fixed to the viewport —
   under the site header on desktop, edge to edge above the tab bar on
   mobile — and only the message list scrolls inside it. */
.chat-shell {
  position: fixed; left: 0; right: 0; top: 64px; bottom: 0; z-index: 5;
  display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden;
}
@media (max-width: 759px) {
  body.has-tabbar .chat-shell { top: 0; bottom: calc(62px + env(safe-area-inset-bottom)); }
}
.chat-msgs { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 6px; }
.chat-composer {
  flex: 0 0 auto; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: transparent;
}
/* The composer floats as a pill over the message list, like the
   assistant chat Jacob modeled it on. */
.chat-pill {
  display: flex; gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 18px;
}
.chat-pill input {
  flex: 1 1 auto; min-width: 0; width: auto; margin: 0; border: none; background: transparent;
  box-shadow: none; outline: none; font: inherit; color: var(--ink); padding: 8px 0;
}
.chat-pill .btn { border-radius: 999px; padding: 10px 18px; }
.chat-shell .mock-note { margin: 8px 4px 0; }
.chat-sample { margin: 0 0 12px; }

/* Chat takeover: no site footer under the full-screen chat (2026-11-12). */
body.chat-open footer { display: none; }

/* No chat header (2026-11-12, Jacob's call): the conversation starts at
   the top. On mobile the first message clears the floating hamburger. */
@media (max-width: 759px) {
  body.has-tabbar .chat-msgs { padding-top: calc(64px + env(safe-area-inset-top)); }
}

/* ---- Leads: the live-fare marketplace (2026-11-12) ---- */
.pulse-card { border-left: 4px solid var(--accent); }
.pulse-card h2 .ic { color: var(--accent); }
.autograb-card .autograb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.autograb-card h2 { margin: 0; }
.autograb-rule { font-weight: 700; color: var(--primary); }
.fare-card { margin-bottom: 14px; }
.fare-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fare-title { font-size: 1.08rem; line-height: 1.3; }
.fare-price { font-size: 1.7rem; font-weight: 800; color: var(--primary); line-height: 1; white-space: nowrap; }
.fare-price.fare-tick { animation: fareTick .6s ease; }
@keyframes fareTick { 0% { color: var(--accent); transform: scale(1.12); } 100% { color: var(--primary); transform: scale(1); } }
.fare-meta { color: var(--muted, #666); font-size: .9rem; margin-top: 4px; }
.fare-meta .ic { width: 1em; height: 1em; vertical-align: -0.12em; }
.fare-detail { margin: 10px 0 6px; }
.fare-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.fare-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.fare-chip .ic { width: 1em; height: 1em; }
.fare-chip-surge { background: var(--accent); color: #fff; }
.fare-chip-decay { background: #eef1f3; color: var(--primary); }
.fare-why { color: var(--muted, #666); font-size: .92rem; margin: 6px 0 12px; }
.fare-lock { color: var(--muted, #666); font-size: .85rem; text-align: center; margin: 8px 0 0; }
.fare-card.is-taken { opacity: .62; }
.fare-gone { font-weight: 700; color: var(--muted, #666); margin: 4px 0 0; }
.fare-card.is-yours { border: 2px solid var(--accent); }
.fare-yours p { margin: 4px 0 10px; }
.fare-yours .ic { color: var(--accent); }

/* Call-out cards inside the fare market (2026-11-12): a homeowner's
   live ask, their budget as the number, a countdown to expiry. */
.fare-card.is-callout { border-left: 4px solid var(--primary); }
.fare-pricebox { display: flex; flex-direction: column; align-items: flex-end; }
.fare-pricelabel { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #666; margin-top: 3px; }
.fare-quote { font-style: italic; margin: 10px 0 6px; }
.fare-chip-call { background: var(--primary); color: #fff; }
.fare-card.is-expired { opacity: .62; }

/* Public website view (/site/<slug>, 2026-11-18): the one-page business
   site bundled with ServiceLite, modeled on the demo-pipeline one-pager.
   Themed by the tenant's --primary / --accent like every other view. */
#view-site { max-width: none; padding: 0; }
.site-hero {
  background: linear-gradient(135deg, var(--primary), #101418 140%);
  color: #fff; padding: 56px 20px 48px; text-align: left;
}
.site-hero > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.site-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 auto 8px; }
.site-hero h1 { font-size: 2.5rem; line-height: 1.1; margin: 0 auto 10px; }
.site-tagline { font-size: 1.35rem; font-weight: 600; margin: 0 auto 12px; color: #fff; }
.site-herotext { font-size: 1.05rem; color: #e8edf2; max-width: 56ch; margin: 0 auto 8px; }
.site-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.site-cta-center { justify-content: center; }
.btn-accent { background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 24px; border-radius: 999px; display: inline-block; }
.btn-accent:hover { filter: brightness(.92); }
.btn-ghostlight { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.65); text-decoration: none; font-weight: 700; padding: 12px 24px; border-radius: 999px; display: inline-block; }
.site-hero-img { margin-top: 30px; width: 100%; max-width: 1080px; height: 300px; object-fit: cover; object-position: center 25%; border-radius: 14px; display: block; }
.site-section { max-width: 1080px; margin: 0 auto; padding: 44px 20px 8px; }
.site-section h2 { font-size: 1.6rem; margin: 0 0 14px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.site-svc h3 { margin: 0 0 6px; font-size: 1.05rem; }
.site-svc p { margin: 0; }
.site-price { margin-top: 10px !important; font-weight: 800; color: var(--primary); }
.site-split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.site-why { margin: 0; padding-left: 20px; }
.site-why li { margin-bottom: 10px; }
.site-about-img { margin-top: 16px; max-width: 100%; max-height: 260px; border-radius: 12px; display: block; }
.site-h2-sm { font-size: 1.25rem !important; }
.site-hours { width: 100%; border-collapse: collapse; }
.site-hours td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.site-hours tr:last-child td { border-bottom: none; }
.site-band { background: var(--primary); color: #fff; text-align: center; padding: 48px 20px; margin-top: 44px; }
.site-band h2 { color: #fff; margin: 0 0 8px; font-size: 1.7rem; }
.site-band p { color: #e8edf2; margin: 0; }
.site-band .site-cta { justify-content: center; }
.site-foot { max-width: 1080px; margin: 0 auto; padding: 22px 20px 34px; font-size: .9rem; }
@media (max-width: 760px) {
  .site-split { grid-template-columns: 1fr; }
  .site-hero h1 { font-size: 1.9rem; }
  .site-hero-img { height: 190px; }
}

/* Signup view (2026-11-18) */
.signup-links { margin: 12px 0 20px; padding-left: 20px; }
.signup-links li { margin-bottom: 8px; word-break: break-all; }
body.site-open main { max-width: none; padding: 0 0 48px; }
