:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e7e5e4;
  --brand: #1f2937;
  --brand-2: #ea580c;
  --brand-soft: #ffedd5;
  --orange: #f97316;
  --accent: #f97316;
  --danger: #dc2626;
  --top-bg: #ffffff;
  --tile-dark: #1f2937;
  --bubble-in: #efedea;
  --bubble-out: #ea580c;
  --s-new: #f97316;
  --s-contacted: #3b82f6;
  --s-quoted: #8b5cf6;
  --s-booked: #16a34a;
  --s-done: #6b7280;
  --s-lost: #a8a29e;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card: #1c1c1e;
    --ink: #f3f4f6;
    --muted: #a1a1aa;
    --line: #2e2e33;
    --brand: #f3f4f6;
    --brand-2: #fb8a3c;
    --brand-soft: #3a2414;
    --top-bg: #1c1c1e;
    --tile-dark: #2a2a2e;
    --bubble-in: #2a2a2e;
    --bubble-out: #ea580c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--top-bg); color: var(--ink); border-bottom: 1px solid var(--line); padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px; min-height: 58px; }
.top h1 { font-size: 18px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.top button, .top a.iconbtn { background: var(--bg); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 7px 12px; cursor: pointer; text-decoration: none; font-size: 16px; line-height: 1.2; }
.brandmark { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.brandmark svg { width: 32px; height: 32px; flex: none; border-radius: 9px; }
.top .mini svg { width: 28px; height: 28px; border-radius: 8px; display: block; }
.wordmark { font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.wordmark b { color: var(--brand-2); font-weight: 800; }

/* Page head + business pill */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; }
.pagehead h2 { margin: 0; flex: none; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pagehead .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.biz { position: relative; display: inline-flex; min-width: 0; align-items: center; gap: 6px; max-width: 58%; background: var(--brand-soft); color: var(--brand-2); border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 700; }
.biz span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.biz select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.biz .caret { flex: none; font-size: 11px; }

/* Dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { border: 0; text-align: left; border-radius: var(--radius); padding: 12px; background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(0,0,0,.04); min-width: 0; }
.tile .v { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .l { display: block; font-size: 12px; font-weight: 600; opacity: .8; margin-top: 2px; }
.tile.hot { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.tile.dark { background: var(--tile-dark); color: #fff; }

main { max-width: 720px; margin: 0 auto; padding: 12px 12px calc(84px + var(--safe-b)); }

/* Bottom tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { flex: 1; text-align: center; padding: 10px 0 9px; font-size: 12px; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--brand-2); font-weight: 700; }
.tabs a.on svg { background: var(--brand-soft); border-radius: 10px; padding: 3px 14px; width: 52px; height: 30px; margin: -3px 0 -3px; }

/* Stage chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.chip .n { background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 12px; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip.on .n { background: var(--orange); color: #fff; }

.search { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }

/* Lead list */
.list { display: flex; flex-direction: column; gap: 8px; }
.lead { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; border: 1px solid var(--line); }
.lead .ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); }
.lead .ico svg { width: 20px; height: 20px; }
.lead .ico.av { border-radius: 50%; font-weight: 800; font-size: 14px; color: #fff; letter-spacing: .02em; }
.lead { box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.hot-badge { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: var(--orange); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
.lead .body { flex: 1; min-width: 0; display: block; }
.lead .row1 { display: flex; gap: 8px; align-items: baseline; }
.lead .name { font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .when { font-size: 12px; color: var(--muted); flex: none; }
.lead .preview { display: block; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lead.unread .name::before { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.stage { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 6px; padding: 2px 7px; color: #fff; background: var(--s-new); }
.stage.contacted { background: var(--s-contacted); } .stage.quoted { background: var(--s-quoted); } .stage.booked { background: var(--s-booked); } .stage.done { background: var(--s-done); } .stage.lost { background: var(--s-lost); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.fab { position: fixed; right: 16px; bottom: calc(76px + var(--safe-b)); z-index: 6; width: 56px; height: 56px; border-radius: 18px; border: 0; background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; }

/* Cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
label.f { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
label.f input, label.f textarea, label.f select { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--ink); font-size: 16px; }
label.f textarea { min-height: 80px; resize: vertical; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-bottom: 12px; }
label.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; background: var(--brand-2); color: #fff; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-2); }
.btn.warn { background: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; margin-bottom: 10px; }
.actions .btn { flex: 1; flex-direction: column; font-size: 13px; padding: 10px 4px; gap: 3px; }
.actions .btn svg { width: 22px; height: 22px; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.stages button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 2px; font-size: 13px; cursor: pointer; }
.stages button.on { color: #fff; border-color: transparent; font-weight: 700; }
.stages button.on.new { background: var(--s-new); } .stages button.on.contacted { background: var(--s-contacted); } .stages button.on.quoted { background: var(--s-quoted); } .stages button.on.booked { background: var(--s-booked); } .stages button.on.done { background: var(--s-done); }
.linkbtn { background: none; border: 0; color: var(--brand-2); cursor: pointer; padding: 0; font-size: 14px; }

/* Thread */
.thread { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); color: #fff; border-bottom-right-radius: 4px; }
.bubble.failed { background: #fbe9e7; color: var(--danger); border: 1px solid #f1c3bd; }
.meta { font-size: 11px; color: var(--muted); margin: -2px 6px 4px; }
.meta.out { align-self: flex-end; }
.meta.in { align-self: flex-start; }
.sys { align-self: center; font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; display: flex; gap: 8px; align-items: center; }
.sys svg { width: 16px; height: 16px; flex: none; }
.sys audio { max-width: 200px; height: 32px; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--card); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; background: var(--bg); resize: none; max-height: 140px; min-height: 42px; font-size: 16px; }
.composer button { flex: none; border: 0; background: var(--brand-2); color: #fff; border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; }
.composer button svg { width: 20px; height: 20px; }
.composer .note { font-size: 13px; color: var(--muted); padding: 10px; flex: 1; text-align: center; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat:nth-child(1) { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; border-color: transparent; }
.stat:nth-child(2) { background: var(--tile-dark); color: #fff; border-color: transparent; }
.stat:nth-child(1) .l, .stat:nth-child(2) .l { color: rgba(255,255,255,.82); }
.stat .v { font-size: 30px; font-weight: 750; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
table.months { width: 100%; border-collapse: collapse; font-size: 14px; }
table.months th, table.months td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--line); }
table.months th:first-child, table.months td:first-child { text-align: left; }
table.months th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.months tr.on td { font-weight: 700; }
table.months tr { cursor: pointer; }

/* Login */
.login { max-width: 380px; margin: 0 auto; padding: calc(12vh + var(--safe-t)) 20px 40px; }
.login .logo { width: 64px; height: 64px; border-radius: 16px; display: block; margin-bottom: 16px; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login p { color: var(--muted); margin: 0 0 24px; }
.err { color: var(--danger); font-size: 14px; margin: 0 0 12px; }

/* Sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + var(--safe-b)); }
.sheet h3 { margin: 0 0 8px; font-size: 19px; }
.sheet p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.sheet .preview { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.sheet .btns { display: flex; flex-direction: column; gap: 8px; }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--danger); }
.small { font-size: 13px; color: var(--muted); }
code { background: var(--bg); padding: 2px 5px; border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

/* appointments + follow-up settings */
.lead .appt { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--brand-2); margin-top: 3px; }
.lead .appt svg { width: 14px; height: 14px; flex: none; }
.check input.num { display: inline-block; width: 64px; margin: 0 4px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 15px; }
.check select { margin: 0 4px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 15px; }
.card hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.daypick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.daypick label { position: relative; }
.daypick input { position: absolute; opacity: 0; inset: 0; }
.daypick span { display: block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 14px; background: var(--card); cursor: pointer; }
.daypick input:checked + span { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.daypick input:focus-visible + span { outline: 2px solid var(--accent); }

/* Quotes */
.btn svg { width: 18px; height: 18px; flex: none; }
.qrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.qrow:first-of-type { border-top: 0; padding-top: 0; }
.amt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-viewed { color: var(--brand-2); font-weight: 600; }
.q-accepted { color: var(--brand-2); font-weight: 700; }
.q-declined { color: var(--danger); }
.lead .appt.q-sent { color: var(--muted); }
.lead .appt.q-declined { color: var(--danger); }
.q-banner { font-weight: 600; background: var(--brand-soft); border-color: transparent; }
.q-banner.q-declined { background: transparent; border-color: var(--danger); }
.qline { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.qline input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
.qnums { display: grid; grid-template-columns: 1fr 1.1fr 1.4fr auto 30px; gap: 6px; align-items: end; margin-top: 6px; }
.qnums label { font-size: 12px; color: var(--muted); min-width: 0; }
.qnums .lt { font-weight: 600; font-size: 14px; padding-bottom: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.qdel { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 0 8px; cursor: pointer; }
.qdel:disabled { opacity: .3; }
.qtotals { margin-top: 12px; font-variant-numeric: tabular-nums; }
.qtotals div { display: flex; justify-content: space-between; padding: 3px 0; }
.qtotals .grand { font-size: 19px; font-weight: 700; border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; }
.qline-ro { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.qline-ro:first-of-type { border-top: 0; }
.qbtns { display: grid; gap: 8px; }
.qbtns .grid2 { gap: 8px; }

/* Customers */
.lead .appt.due { color: var(--accent); }
.tag { display: inline-block; background: var(--brand-soft); color: var(--brand-2); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.kv dd.muted { color: var(--muted); }
.lead .appt.order { color: var(--ink); }

/* Instagram */
.composer { flex-direction: column; align-items: stretch; }
.composer .crow { display: flex; gap: 8px; align-items: flex-end; }
.chan { display: flex; gap: 4px; align-self: flex-start; background: var(--bg); border-radius: 999px; padding: 3px; }
.chan button { border: 0; background: none; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; width: auto; height: auto; display: inline; }
.chan button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.composer button.ig, .btn.ig { background: linear-gradient(45deg, #f59e0b, #e1306c 55%, #833ab4); }
.bubble.out.ig { background: linear-gradient(135deg, #e1306c, #833ab4); }
.igline { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.igline svg { width: 22px; height: 22px; color: #e1306c; flex: none; }
.igline span { flex: 1; }

/* Team */
.team { display: flex; flex-direction: column; gap: 10px; }
.mrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mrow .ico.av { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.mrow .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mrow .who b, .mrow .who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .role { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); }
.mrow .role.member { background: var(--bg); color: var(--ink); }
fieldset[disabled] { opacity: .75; }

/* Agency admin */
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.acl { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 16px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.acl-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acl-top b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl-use { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted, #6b7280); }
.acl-use b { color: var(--ink); }
.acl-note { font-style: italic; }
.st { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); }
.st-active { background: #dcfce7; color: #166534; }
.st-trial { background: var(--brand-soft); color: var(--brand-2); }
.st-paused { background: #fef9c3; color: #854d0e; }
.st-cancelled { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .st-active { background: #14532d; color: #bbf7d0; }
  .st-paused { background: #713f12; color: #fef08a; }
  .st-cancelled { background: #7f1d1d; color: #fecaca; }
}

/* Price list */
.plhead, .plrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 84px 32px; gap: 6px; align-items: center; }
.plhead { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.plrow { margin-bottom: 6px; }
.plrow input { width: 100%; min-width: 0; font: inherit; font-size: 15px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.plpick { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 8px; }
.plpick button { display: flex; justify-content: space-between; gap: 10px; text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.plpick button[hidden] { display: none; }
.plpick button span:first-child { font-weight: 600; min-width: 0; }
.plpick button .small { flex: none; }

/* Getting-started checklist */
.setup-top { display: flex; align-items: baseline; gap: 10px; }
.setup-top h2 { margin: 0; }
.setup-top .linkbtn { margin-left: auto; }
.setup .bar { height: 6px; border-radius: 99px; background: var(--bg); margin: 10px 0 12px; overflow: hidden; }
.setup .bar span { display: block; height: 100%; background: linear-gradient(90deg, #fb923c, #ea580c); border-radius: 99px; }
.setup .step { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.setup .step .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.setup .step.ok .tick { background: #16a34a; border-color: #16a34a; }
.setup .step.ok b { font-weight: 500; color: var(--muted); text-decoration: line-through; }
.setup .step a { color: inherit; }

/* Facebook */
.composer button.fb, .btn.fb { background: #1877f2; color: #fff; }
.bubble.out.fb { background: #1877f2; }

/* Schedule */
.sched-day { font-size: 15px; margin: 18px 2px 8px; }
.sched-day:first-of-type { margin-top: 4px; }
.sched { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.sched-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sched-time { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.sched-end { font-weight: 600; font-size: 14px; color: var(--muted); }
.sched-kind { white-space: nowrap; }
.sched-crew { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.sched-crew svg { width: 14px; height: 14px; flex: none; }
.sched-crew.none { color: var(--muted); font-weight: 500; }
.sched-kind { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--brand-soft); color: var(--brand-2); }
.sched-kind.job { background: var(--ink); color: var(--card); }
.sched-who { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.sched-who.none { color: var(--muted); font-weight: 500; }
.sched-name { display: block; font-weight: 650; color: inherit; text-decoration: none; font-size: 16px; }
.sched-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sched-btns .btn { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 14px; }
.sched-btns .btn svg { width: 15px; height: 15px; }
.sched-assign { flex: 1 1 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }

/* Remind me + To do */
.btn.sm { padding: 6px 10px; font-size: 13px; min-height: 0; }
.actions .btn.on { color: var(--accent); border-color: var(--accent); }
.lead .appt.remind { color: var(--muted); }
.lead .appt.remind.due { color: var(--accent); }
.remind-bar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.remind-bar.due { border-color: var(--accent); }
.remind-bar svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.remind-bar span { flex: 1; min-width: 0; }
.todo h2 { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.todo h2 svg { width: 16px; height: 16px; }
.todo h2 .n { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; letter-spacing: 0; }
.todo-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.todo-row:first-of-type { border-top: 0; padding-top: 0; }
.todo-row a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.todo-row a .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-btns { display: flex; gap: 6px; flex: none; }
.btn.rpick { flex-direction: column; gap: 2px; padding: 10px 6px; line-height: 1.2; }
.btn.rpick .small { font-weight: 400; color: var(--muted); }

/* Optional add-ons on estimates */
.qopt { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.qline .qopt select { font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; min-width: 0; flex: 1; }
.qline-ro.passed { color: var(--muted); }
.qline-ro.passed .amt { text-decoration: line-through; }
.qtotals .small { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* Job photos */
.card h2 .n { background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 12px; letter-spacing: 0; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pthumb { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--bg); cursor: pointer; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .pon { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; font-weight: 600; border-radius: 6px; padding: 1px 5px; }
.pbig { width: 100%; max-height: 55vh; object-fit: contain; border-radius: 12px; background: var(--bg); display: block; }
label.btn input[type=file] { display: none; }

/* Money owed */
.owed-line { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; font: inherit; cursor: pointer; text-align: left; }
.owed-line b { margin-left: auto; font-variant-numeric: tabular-nums; }
.owed-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.owed-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.owed-top { display: flex; justify-content: space-between; gap: 10px; }
.owed-top a { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.owed-top > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.owed-top > b.late { color: var(--danger); }
.owed-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.owed-btns .btn { flex: 1 1 auto; }
.owed-btns .btn svg { width: 15px; height: 15px; }

/* Signatures and change orders */
.sigimg { display: block; max-width: 220px; width: 60%; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 4px; }
.co-row { padding: 10px 0; border-top: 1px solid var(--line); }
.co-row:first-of-type { border-top: 0; padding-top: 0; }
.co-row.declined { color: var(--muted); }
.co-row.declined .amt { text-decoration: line-through; }
.co-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

/* Job days */
.vdays { display: grid; gap: 6px; margin-bottom: 10px; }
.vday { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.vday.past { opacity: .55; }
.crewpick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.crewpick label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.crewpick input { margin: 0; }

/* Repeat visits */
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.plan.off { opacity: .7; }
.plan-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.plan-head .small { display: inline-flex; align-items: center; gap: 4px; }
.plan-head .small svg { width: 13px; height: 13px; }
.plan .vdays { margin-bottom: 0; }
.plan .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sched-kind.visit { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* customer history + warranty */
.cust-badge { display: inline-block; font-size: 11px; font-weight: 800; color: var(--ink); background: var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
.cust-badge.warr { color: #fff; background: #2563eb; }
.hist .jobs .qrow .stage { margin-left: 4px; }
.warr-bar { display: flex; gap: 8px; align-items: flex-start; background: #eff6ff; color: #1e3a8a; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 14px; }
.warr-bar svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.hist .wq { margin: 0 0 10px; }
@media (prefers-color-scheme: dark) {
  .warr-bar { background: #172554; color: #bfdbfe; }
}
.mrow .role.crew { background: var(--bg); color: var(--muted, #6b7280); border: 1px dashed currentColor; }
h3.sect { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); margin: 14px 2px 6px; }
.logo-row { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; }
.logo-box { width: 64px; height: 64px; flex: none; border: 1px dashed var(--line, #d1d5db); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.owed-row .late { color: var(--danger); font-weight: 600; }

.sched-day { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sched-route { margin-left: auto; }
.sched-stop { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-2); color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px; }
.route-list { margin: 0 0 12px; padding-left: 22px; }
.route-list li { margin: 0 0 8px; }
.color-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.color-row input[type="color"] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: none; flex: none; }
.qline .qnotax { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pbm .check { margin: 0 0 10px; }
.tlist { border-top: 1px solid var(--line); }
.trow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.trow .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trow .live { color: var(--brand-2); font-weight: 600; }
.clockbar { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; border: 2px solid var(--brand-2); }
.clockbar svg { width: 20px; height: 20px; color: var(--brand-2); flex: none; }
.qtotals .neg { color: var(--danger, #dc2626); }
.aibar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; font-size: 13px; }
.aibar .linkbtn { display: inline-flex; align-items: center; gap: 4px; }
.aibar svg { width: 14px; height: 14px; }
.composer .aibar button { display: inline-flex; width: auto; height: auto; border-radius: 6px; background: none; color: var(--brand-2); font: inherit; font-weight: 600; padding: 2px 0; }
.composer .aibar button svg { width: 14px; height: 14px; }
.composer .aibar .small { flex: 1; min-width: 0; }

/* Progress payments on the estimate page */
.draw-list { display: flex; flex-direction: column; gap: 10px; }
.draw-row { border-top: 1px solid var(--line); padding-top: 10px; }
.draw-row:first-child { border-top: 0; padding-top: 0; }
.draw-row .amt { float: right; font-weight: 600; }
.draw-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

/* Overtime line on the Team card */
.otline { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; margin-top: 4px; }
.small.ot { color: var(--accent, #ea580c); }

/* Calls on this computer: the bar at the bottom while ringing or on a call */
.deskbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--brand); color: var(--bg, #fff); box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: 560px; margin: 0 auto; }
.deskbar > span { flex: 1; min-width: 0; }
.deskbar .small { color: inherit; opacity: .8; }

/* Real estate investor mode: call list, deals, pipelines */
.sheet.tall { max-height: 88vh; overflow-y: auto; }
.script { white-space: pre-wrap; font-size: 15px; line-height: 1.45; }
.deal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.deal-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.opp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.opp-row:first-of-type { border-top: 0; }
.opp-row a { color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden; }
.opp-row select { max-width: 52%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); color: var(--ink); font-size: 14px; }
.pipe-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.pipe-row .amt { font-weight: 700; font-size: 18px; }
