:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #10233a;
  --muted: #5a6b7d;
  --line: #e1e7ef;
  --brand: #1c5a96;
  --brand-ink: #144678;
  --brand-soft: #e8f1fa;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #2e8b3e;
  --ok-soft: #dcfce7;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 58, .06), 0 1px 1px rgba(16, 35, 58, .04);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; }
.boot { padding: 3rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #0f2f52; color: #d3e0ee; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .25rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; padding: .25rem .5rem 1rem; line-height: 1.2; }
.brand img { width: 30px; height: 30px; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: 8px; color: #cfe3de; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.active { background: rgba(153, 246, 228, .14); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .me { margin-top: auto; padding: .75rem .5rem 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.sidebar .me button { margin-top: .5rem; }
main { padding: 1.5rem 2rem 4rem; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  main { padding: 1rem 1rem 6rem; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 20; justify-content: space-around; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); padding: .25rem 0; }
  .tabbar a.active { color: var(--brand); }
  .tabbar svg { width: 22px; height: 22px; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin: -0.25rem 0 1rem; font-weight: 700; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.stat.warn .value { color: var(--warn); }
@media (max-width: 860px) {
  .grid.two, .grid.side { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tables & lists ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sorted { color: var(--ink); }
th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
td { padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8fbfa; }
.table-wrap { overflow-x: auto; margin: -.25rem -.6rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .75rem; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { color: var(--muted); padding: 1rem 0; text-align: center; font-size: .9rem; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
dl.info dt { color: var(--muted); font-size: .85rem; }
dl.info dd { margin: 0; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: #eef2f1; color: var(--muted); white-space: nowrap; }
.badge.scheduled, .badge.sent { background: var(--info-soft); color: var(--info); }
.badge.in_progress, .badge.approved { background: var(--warn-soft); color: var(--warn); }
.badge.completed, .badge.paid, .badge.converted { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled, .badge.declined, .badge.void, .badge.overdue { background: var(--danger-soft); color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.crew { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; background: #f1f5f4; border-radius: 999px; padding: .15rem .55rem .15rem .4rem; }

/* ---------- forms ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.field { margin-bottom: .9rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: .75rem; }
input, select, textarea { width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid #cdd6d3; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 118, 110, .35); outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .55rem .95rem; border-radius: 8px; border: 1px solid #cdd6d3; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f4f7f6; text-decoration: none; }
.btn.primary { background: #3e8c2f; border-color: #3e8c2f; color: #fff; }
.btn.primary:hover { background: #2f7224; border-color: #2f7224; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .8rem; }
.btn.big { padding: 1rem 1.2rem; font-size: 1.05rem; width: 100%; border-radius: 12px; }
.btn.go { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.stop { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid #cdd6d3; border-radius: 8px; overflow: hidden; }
.seg a, .seg button { padding: .4rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); background: #fff; border: 0; border-right: 1px solid #cdd6d3; cursor: pointer; }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg .on { background: var(--brand-soft); color: var(--brand-ink); }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

/* ---------- line items ---------- */
.items td { padding: .35rem .3rem; border: 0; }
.items input { padding: .45rem .5rem; }
.items .desc { width: 55%; }
.items .q { width: 12%; }
.items .p { width: 16%; }
.totals { margin-left: auto; width: min(320px, 100%); margin-top: .75rem; }
.totals div { display: flex; justify-content: space-between; padding: .25rem 0; }
.totals .grand { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .25rem; }

/* ---------- schedule ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .6rem; border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.day-head .d { font-size: 1.1rem; }
.day-body { padding: .4rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.ev { display: block; background: #f6faf9; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brand)); border-radius: 7px; padding: .4rem .45rem; font-size: .8rem; color: var(--ink); line-height: 1.3; }
.ev:hover { text-decoration: none; background: #eef6f4; }
.ev .t { font-weight: 700; }
.ev.completed { opacity: .6; }
.ev.cancelled { opacity: .45; text-decoration: line-through; }
.add-day { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .2rem; }
.add-day:hover { color: var(--brand); }
/* 2-week and month views */
.week.two-weeks .day { min-height: 160px; }
.month-head { margin-bottom: .35rem; }
.month-head div { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.week.month { gap: .35rem; }
.week.month .day { min-height: 110px; }
.week.month .day-head { padding: .3rem .45rem; border-bottom: 0; }
.week.month .day-head .d { font-size: .9rem; }
.week.month .day-head .wd { display: none; }
.week.month .day-head .count { margin-left: auto; margin-right: .2rem; font-size: .7rem; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 0 .4rem; }
.week.month .day-body { padding: 0 .3rem .3rem; gap: .2rem; }
.week.month .day.out { background: #f7f9f8; }
.week.month .day.out .day-head, .week.month .day.out .ev { opacity: .55; }
.ev.mini { padding: .15rem .35rem; font-size: .72rem; border-left-width: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.mini .t { font-weight: 700; }
@media (max-width: 1000px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day-body:empty::after { content: 'Nothing scheduled'; color: var(--muted); font-size: .8rem; padding: .25rem; }
  .month-head { display: none; }
  .week.month .day { min-height: 0; }
  .week.month .day.out, .week.month .day.empty-day { display: none; }
  .week.month .day-head .wd { display: inline; margin-left: .4rem; color: var(--muted); font-weight: 500; }
  .ev.mini { white-space: normal; font-size: .8rem; padding: .3rem .45rem; }
}

/* ---------- job (field) ---------- */
.job-hero { display: flex; flex-direction: column; gap: .35rem; }
.job-hero .when { font-size: 1.05rem; font-weight: 600; }
.checklist label { display: flex; gap: .65rem; align-items: center; font-weight: 500; font-size: .95rem; padding: .55rem 0; border-bottom: 1px solid var(--line); margin: 0; cursor: pointer; }
.checklist label:last-child { border-bottom: 0; }
.checklist input { width: 20px; height: 20px; accent-color: var(--brand); }
.checklist .done span { text-decoration: line-through; color: var(--muted); }
.note { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note img { max-width: 100%; max-height: 260px; border-radius: 8px; margin-top: .4rem; display: block; cursor: zoom-in; }
.note .meta { font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; }
.clock-banner { background: var(--warn-soft); color: #78350f; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700; text-align: center; margin: .25rem 0 .75rem; }
.pay-box { display: flex; justify-content: space-between; background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; padding: .6rem .8rem; font-weight: 600; margin-top: .5rem; flex-wrap: wrap; gap: .25rem .75rem; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 25, 22, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; }
.modal .body { padding: 1.1rem 1.2rem; }
.modal footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
.modal img.full { max-width: 100%; border-radius: 8px; }
#toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; visibility: hidden; background: #0f2f52; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600; font-size: .9rem; transition: transform .2s, opacity .2s, visibility .2s; z-index: 60; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
#toast.error { background: var(--danger); }
@media (max-width: 860px) { #toast { bottom: 5.5rem; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, #e3eefa, #f4f7fb 55%); }
.auth .card { width: min(400px, 100%); padding: 1.75rem; }
.auth .brand { color: var(--ink); padding: 0 0 1.25rem; font-size: 1.15rem; }
.err { color: var(--danger); font-size: .88rem; margin-bottom: .75rem; }

/* ---------- printable docs ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2.25rem; box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.doc-head .biz { font-weight: 700; font-size: 1.2rem; }
.doc h1 { font-size: 1.6rem; color: var(--brand-ink); }
.doc .bill { margin-bottom: 1.5rem; }
.doc table th { border-bottom: 2px solid var(--ink); color: var(--ink); }
@media print {
  .sidebar, .tabbar, .no-print, .page-head .actions, .mobile-top { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body, :root { background: #fff; }
  .doc { border: 0; box-shadow: none; padding: 0; }
}

/* ---------- before/after photos & language switch ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.photos:empty { display: none; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; cursor: zoom-in; background: #eef2f1; }
.photos figcaption { font-size: .7rem; color: var(--muted); margin-top: .2rem; display: flex; justify-content: space-between; align-items: center; gap: .25rem; }
.photos figcaption .btn { padding: 0 .3rem; }
.seg.lang button { padding: .3rem .6rem; font-size: .8rem; }
.sidebar .seg.lang { border-color: rgba(255,255,255,.2); }
.sidebar .seg.lang button { background: transparent; color: #d3e0ee; border-color: rgba(255,255,255,.2); }
.sidebar .seg.lang .on { background: rgba(155, 224, 138, .22); color: #fff; }
.lang-select { width: auto; padding: .3rem .5rem; font-size: .85rem; }
.sidebar .lang-select { background: transparent; color: #d3e0ee; border-color: rgba(255,255,255,.25); }
.sidebar .lang-select option { color: var(--ink); }
details summary { list-style-position: inside; }

.offer-card { display: block; color: inherit; text-decoration: none; margin-bottom: .75rem; border: 2px solid var(--brand); background: #f3fbf9; }
.offer-card:hover { text-decoration: none; background: var(--brand-soft); }
.alerts-banner { border: 2px solid #fcd34d; background: #fffbeb; margin-bottom: 1rem; }

.avail-banner { border: 2px solid var(--brand); background: #f3fbf9; margin-bottom: 1rem; }
.av-day { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; flex-wrap: wrap; }
.av-day:last-of-type { border-bottom: 0; }
.av-name { width: 130px; margin: 0; padding-top: .45rem; }
.av-ranges { flex: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 210px; }
.av-range { display: flex; gap: .35rem; align-items: center; }
.av-range input { width: auto; min-width: 0; flex: 1; padding: .4rem .45rem; }
.savebar { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
@media (max-width: 860px) { .savebar { bottom: 62px; } }
.av-grid td, .av-grid th { padding: .45rem .4rem; font-size: .8rem; white-space: nowrap; }
.av-grid .off { color: var(--muted); }

.book-tabs a { white-space: nowrap; }
table.report td, table.report th { padding: .4rem .5rem; }
table.report tr.sec td { font-weight: 700; padding-top: 1rem; border-bottom: 1px solid var(--ink); }
table.report tr.tot td { font-weight: 600; border-top: 1px solid var(--line); }
table.report tr.grand td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--ink); }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
table.bank select { min-width: 200px; font-size: .85rem; padding: .35rem .4rem; }
.je { padding: .75rem 1rem; }

ol.steps { padding-left: 1.3rem; margin: 0; line-height: 1.6; }
ol.steps li { margin-bottom: .4rem; }
details.card summary { cursor: pointer; }
.prop-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: .6rem; background: #eef2f1; }
.prop-facts { display: flex; gap: .4rem; flex-wrap: wrap; }
.prop-facts span { background: #f1f5f4; border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; font-weight: 600; }

/* address boxes + crew availability */
.addr-links { display: flex; gap: .9rem; margin-top: .4rem; }
.addr-links a { font-weight: 600; }
.avail { margin: .15rem 0 0 1.7rem; line-height: 1.35; }
.av-yes { color: var(--ok); font-weight: 600; }
.av-partly, .av-booked { color: var(--warn); }
.av-no { color: var(--danger); }
.av-unknown { color: var(--muted); }

/* address suggestions */
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + .15rem); background: #fff; border: 1px solid var(--line, #dfe5e3); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,40,34,.16); overflow: hidden; }
.ac-item { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .75rem; cursor: pointer; }
.ac-item + .ac-item { border-top: 1px solid #f0f3f2; }
.ac-item.on, .ac-item:hover { background: var(--brand-soft, #e7f3f0); }
.ac-main { font-weight: 600; }
.ac-pin { font-size: .9rem; margin-top: .1rem; }
.ac-foot { padding: .35rem .75rem; background: #fafbfb; border-top: 1px solid #f0f3f2; font-size: .7rem; }

/* yes / no toggles and 3-across row on the client form */
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .75rem; }
.yn { display: inline-flex; border: 1px solid #cdd6d3; border-radius: 10px; overflow: hidden; }
.yn label { margin: 0; cursor: pointer; }
.yn input { position: absolute; opacity: 0; pointer-events: none; }
.yn span { display: block; padding: .5rem 1.25rem; font-weight: 600; color: var(--muted); background: #fff; }
.yn label + label span { border-left: 1px solid #cdd6d3; }
.yn input:checked + span { background: var(--brand, #0f766e); color: #fff; }
.yn input:focus-visible + span { outline: 2px solid var(--brand, #0f766e); outline-offset: -2px; }
.entry-box { margin-top: .6rem; padding: .6rem .75rem; background: #fff8e6; border: 1px solid #f1d58a; border-radius: 10px; }
.entry-box strong { display: block; margin-bottom: .15rem; }

.items input.svc-line { background: #f3f6f5; font-weight: 600; cursor: default; }
.items .addon-row td { padding-top: .5rem; border-bottom: 0; }
.items .addon-row select { max-width: 320px; }
.home-info { grid-template-columns: auto 1fr; }

/* ---- Performance ---- */
.grid.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; align-items: start; }
.perf-filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.perf-filters select { width: auto; }
.pace { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pace-fast { background: #e6f4e3; color: #2e6b22; }
.pace-par { background: #eef1f0; color: #4b5b58; }
.pace-slow { background: #fdf0dc; color: #8a4b08; }
.pbar { position: relative; height: 10px; background: #f1f4f3; border-radius: 6px; min-width: 120px; }
.pbar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #9aa9a6; transform: translateX(-1px); }
.pbar b { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.pbar b.f, .pbar-key b.f { background: #14897d; }
.pbar b.s, .pbar-key b.s { background: #d9891f; }
.pbar-key { display: flex; justify-content: space-between; margin: .3rem 0 .6rem; padding-left: 2.2rem; }
.pbar-key b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .25rem; vertical-align: -1px; }
.perf-rank { width: 100%; border-collapse: collapse; }
.perf-rank td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.perf-rank td.rank { width: 1.8rem; font-weight: 700; color: var(--muted); }
.perf-rank td.bar-cell { width: 40%; }
.perf-table td { white-space: nowrap; }
.perf-table th { white-space: normal; vertical-align: bottom; }
.perf-table .dot, .perf-rank .dot, .perf-months .dot { margin-right: .4rem; }
.table-wrap { overflow-x: auto; }
.perf-table td:nth-child(2) { white-space: normal; min-width: 150px; }
.perf-alerts { list-style: none; margin: 0; padding: 0; }
.perf-alerts li { display: flex; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.perf-alerts li:last-child { border-bottom: 0; }
.perf-alerts .ai { flex: none; }
.perf-alerts .small { margin-top: .15rem; }
.perf-months { width: 100%; }
.hbar { position: relative; height: 22px; background: #f1f4f3; border-radius: 6px; min-width: 140px; overflow: hidden; }
.hbar b { position: absolute; left: 0; top: 0; bottom: 0; background: #bfe3dd; border-radius: 6px; }
.hbar span { position: relative; padding-left: .5rem; font-size: .82rem; line-height: 22px; font-variant-numeric: tabular-nums; }
.good-txt { color: #2e7d32; font-weight: 600; } .bad-txt { color: #8a4b08; font-weight: 600; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
@media (max-width: 700px) { .grid.two-col { grid-template-columns: 1fr; } }
/* leads + pricing */
.chip-s { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; background: #eef2f7; color: #475569; margin-left: .25rem; vertical-align: middle; }
.late { color: var(--danger); font-weight: 600; }
.lead-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.list.leads li { align-items: flex-start; }
.calc-extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem .8rem; }
.calc-x { display: flex; align-items: center; gap: .45rem; font-weight: 500; justify-content: space-between; }
.calc-x input[type=checkbox] { width: auto; }
.calc-out { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: #f1faf6; border: 1px solid #b7e4d0; }
.calc-big { font-size: 1.6rem; font-weight: 800; }
@media (max-width: 640px) {
  .list li { flex-wrap: wrap; }
  .list li .grow { min-width: 60%; }
  .list li .lead-actions { width: 100%; justify-content: flex-start; }
}

/* ---------- messages ---------- */
.nav a, .tabbar a { position: relative; }
.msg-count { margin-left: auto; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.tabbar a .msg-count { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; min-width: 1.05rem; height: 1.05rem; font-size: .65rem; }
.msg-count.static { margin-left: .25rem; }
.inbox li { cursor: pointer; }
.inbox a.grow { color: inherit; }
.inbox a.grow:hover { text-decoration: none; }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chat { display: flex; flex-direction: column; padding: .75rem; }
.msgs { display: flex; flex-direction: column; gap: .45rem; overflow-y: auto; max-height: calc(100vh - 290px); min-height: 220px; padding: .25rem .15rem .5rem; }
.msgs.compact { max-height: none; min-height: 0; overflow: visible; }
@media (max-width: 860px) { .msgs { max-height: calc(100dvh - 380px); } } /* fallback only; messages.js sizes it to the screen */
.msg { max-width: 82%; padding: .5rem .7rem; border-radius: 14px; background: #eef2f6; align-self: flex-start; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; }
.msg.mine a { color: #fff; }
.msg-text { white-space: pre-wrap; }
.msg-name { font-size: .75rem; font-weight: 700; margin-bottom: .1rem; }
.msg-meta { font-size: .7rem; opacity: .7; margin-top: .2rem; text-align: right; }
.msg-seen { font-size: .7rem; opacity: .85; text-align: right; }
.msg-tag { font-size: .72rem; opacity: .8; margin-bottom: .15rem; }
.msg-job { display: inline-block; font-size: .74rem; font-weight: 600; background: rgba(255, 255, 255, .7); color: var(--brand-ink); border-radius: 999px; padding: .1rem .5rem; margin-bottom: .25rem; }
.msg.theirs .msg-job { background: #fff; }
.msg.mine .msg-job, .msg.mine a.msg-job { background: rgba(255, 255, 255, .2); color: #fff; }
.msg img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: .3rem; cursor: zoom-in; }
.msg-orig { font-size: .78rem; margin-top: .25rem; opacity: .85; }
.msg-orig summary { cursor: pointer; }
.msg-orig div { white-space: pre-wrap; margin-top: .15rem; font-style: italic; }
.composer { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .25rem; display: flex; flex-direction: column; gap: .45rem; }
.composer-row { display: flex; gap: .45rem; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 2.5rem; max-height: 160px; }
.msg-jobsel { font-size: .85rem; }
.icon-btn { margin: 0; padding-left: .7rem; padding-right: .7rem; }
.msg-photo { display: flex; align-items: flex-start; gap: .4rem; }
.msg-photo img { max-height: 90px; border-radius: 8px; }

/* miles from cleaner home to job */
.dist-mi { color: var(--brand); font-weight: 600; }
.dist-out { color: var(--warn, #b45309); font-weight: 600; white-space: nowrap; }

/* New client form: Recent callers from Quo, duplicate warning */
.rc label { display: flex; align-items: center; justify-content: space-between; }
.rc-list { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow: auto; }
.rc-item { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; cursor: pointer; }
.rc-item:hover { border-color: var(--brand); }
.rc-item.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rc-item .chip-s { margin-left: auto; }
.chip-s.new { background: var(--ok-soft); color: var(--ok); }
.dup-box { border: 1px solid var(--line); background: var(--info-soft); border-radius: 8px; padding: .5rem .65rem; margin-bottom: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.dup-box.warn { background: var(--warn-soft); border-color: #fcd34d; }
.dup-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dup-row .grow { flex: 1; min-width: 180px; }
.alerts-banner .dup-row + .dup-row { margin-top: .5rem; }

/* Quo conversation thread on the client page */
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.thread-head .actions { display: flex; gap: .4rem; }
.thread { max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: .55rem; padding: .25rem .1rem; background: #f8fafc; border-radius: 8px; padding: .6rem; }
.t-day { text-align: center; font-size: .75rem; color: var(--muted); margin: .4rem 0 .1rem; }
.t-day span { background: #eef2f7; border-radius: 999px; padding: .1rem .6rem; }
.t-msg { display: flex; flex-direction: column; max-width: 78%; }
.t-msg.in { align-self: flex-start; align-items: flex-start; }
.t-msg.out { align-self: flex-end; align-items: flex-end; }
.t-msg .bub { padding: .5rem .75rem; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.t-msg.in .bub { background: #e9edf2; color: var(--ink); border-bottom-left-radius: 4px; }
.t-msg.out .bub { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.t-media { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.t-media img { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; }
.t-msg.out .t-media a { color: #fff; }
.t-meta { font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.t-who { font-weight: 600; color: var(--ink); }
.t-call { align-self: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; font-size: .9rem; }
.t-call.missed { border-color: #fecaca; background: #fff7f7; }
.t-call.missed .t-call-top strong { color: var(--danger); }
.t-sum { margin: .35rem 0 .2rem; padding-left: 1.1rem; font-size: .85rem; }
.t-vm { margin-top: .3rem; }
.t-btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.t-audio { margin-top: .45rem; }
.t-audio audio { width: 100%; height: 36px; }
.t-transcript { margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .5rem; display: flex; flex-direction: column; gap: .4rem; max-height: 360px; overflow-y: auto; font-size: .85rem; }
.t-line .t-spk { font-weight: 600; }
.t-line.us .t-spk, .t-line.ai .t-spk { color: var(--brand); }

/* "You drove away without clocking out" alarm */
#leave-alarm { position: fixed; inset: 0; z-index: 100; background: rgba(127, 29, 29, .92); display: flex; align-items: center; justify-content: center; padding: 1.25rem; animation: leave-flash 1.2s ease-in-out infinite alternate; }
@keyframes leave-flash { from { background: rgba(127, 29, 29, .92); } to { background: rgba(185, 28, 28, .95); } }
#leave-alarm .leave-card { background: #fff; border-radius: 18px; padding: 1.5rem 1.25rem; width: min(420px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#leave-alarm .leave-icon { font-size: 3rem; line-height: 1; }
#leave-alarm h1 { color: var(--danger); margin: .5rem 0; font-size: 1.6rem; }
#leave-alarm p { margin: .25rem 0 1rem; }
#leave-alarm .btn.big { width: 100%; margin-bottom: .6rem; }

/* salesperson: hide owner-only controls */
.role-sales .owner-only { display: none !important; }

/* Open lead (caller didn't book yet) */
.open-lead-btn { margin-right: auto; border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.open-lead-btn:hover { background: #fef3c7; }
.open-lead-note { border-color: #fde68a; background: #fffbeb; }
.open-lead-why { color: #92400e; margin-top: .15rem; }
.chips-quick { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.chips-quick .chip-s { cursor: pointer; border: 1px solid var(--line, #e2e8f0); background: #fff; font: inherit; font-size: .8rem; padding: .2rem .55rem; border-radius: 999px; }
.chips-quick .chip-s:hover { background: #f1f5f9; }

/* auto checklist + photo categories */
.check-room{font-size:.95rem;margin:1rem 0 .4rem;display:flex;justify-content:space-between;align-items:baseline;gap:.5rem}
.card h2 + .check-room, .auto-checklist .check-room:first-child{margin-top:.2rem}
.auto-list{list-style:none;margin:0 0 .4rem;padding:0;font-size:.9rem;columns:2;column-gap:1.5rem}
.auto-list li{padding:.15rem 0;break-inside:avoid}
@media (max-width:700px){.auto-list{columns:1}}
.photo-room{border-top:1px solid var(--line, #e3e8ee);padding:.7rem 0 .2rem}
.photo-room:first-of-type{border-top:0}
.photo-room-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.4rem}
.photo-room-head h3{margin:0;font-size:.95rem}
.photo-room.need{background:linear-gradient(90deg,rgba(255,170,0,.08),transparent);border-radius:8px;padding-left:.5rem}

/* Check all buttons on checklist sections */
.check-room-right{display:inline-flex;align-items:center;gap:.5rem;font-weight:400}
.check-room .check-all{padding:.25rem .6rem;font-size:.78rem}
.check-room .check-all:disabled{opacity:.45;cursor:default}

/* 📞 New call */
.btn.call-btn { background: #0f766e; border-color: #0f766e; color: #fff; }
.btn.call-btn:hover { background: #115e59; }
.call-steps { background: #f0fdfa; border-color: #99f6e4; font-size: .92rem; line-height: 1.5; }

/* ---- 📞 Phone guide (booking script) ---- */
.guide{border-color:#bfdbfe;background:#f8fbff}
.gq{display:flex;gap:.7rem;padding:.75rem 0;border-top:1px solid #e2e8f0}
.guide h2+p+.gq,.modal .guide .gq:first-child{border-top:0}
.gq-n{flex:0 0 1.75rem;height:1.75rem;border-radius:50%;background:#2563eb;color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center;font-size:.9rem}
.gq-body{flex:1;min-width:0}
.gq-say{font-weight:600;color:#1e3a8a;margin:0 0 .5rem;line-height:1.35}
.gq-tip{font-size:.8rem;color:#64748b;margin-top:.4rem}
.gq-glabel{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin:0 0 .3rem}
.gq-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.5rem 1rem}
.gq-opt{display:flex;align-items:center;gap:.4rem;font-weight:500;margin:.15rem 0;cursor:pointer}
.gq-row{display:flex;flex-wrap:wrap;gap:.3rem 1.2rem}
.gq-extras{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.35rem .9rem}
.gq-x{display:flex;align-items:flex-start;gap:.45rem;font-weight:500;line-height:1.25;cursor:pointer}
.gq-x>input[type=checkbox]{margin-top:.15rem}
.gq-x .gq-xnote{display:block}
.gq-x .gq-inc{display:none;color:#15803d;font-weight:700;margin-left:.3rem}
.gq-x.included{opacity:.55}.gq-x.included .gq-inc{display:inline}.gq-x.included .gq-xprice{text-decoration:line-through}
.gq-price{margin-bottom:.5rem}
.hours-box{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;padding:.6rem .75rem;margin:0 0 .75rem;font-size:.9rem;line-height:1.45}
.hours-title{font-weight:700;margin-bottom:.15rem}
.guide-note{margin:-.3rem 0 .5rem}
.gq input[type=checkbox],.gq input[type=radio]{width:auto;margin:0}
.gq-rating{display:flex;flex-wrap:wrap;gap:.3rem}
.gq-rate{cursor:pointer}.gq-rate input{position:absolute;opacity:0;width:1px!important;height:1px}
.gq-rate span{display:inline-flex;align-items:center;justify-content:center;width:2.3rem;height:2.1rem;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-weight:700}
.gq-rate input:checked+span{background:#2563eb;color:#fff;border-color:#2563eb}
.gq-rate input:focus-visible+span{outline:2px solid #93c5fd}
.gq-cond{margin-top:.35rem}
.gq-xwhen{margin:0 0 .45rem;display:flex;flex-wrap:wrap;gap:.2rem .9rem;align-items:center}.gq-xwhen .gq-opt{display:inline-flex;margin:0}
.ct-details{margin-top:.55rem;border:1px solid #bfdbfe;border-radius:10px;background:#fff}
.ct-details summary{cursor:pointer;padding:.5rem .7rem;font-weight:700;color:#1d4ed8}
.ct-box{padding:0 .7rem .7rem}
.ct-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.7rem}
.ct{border:1px solid #e2e8f0;border-radius:8px;padding:.55rem .65rem;background:#f8fafc}
.ct-h{font-weight:800;margin-bottom:.3rem}
.ct ul{margin:.2rem 0 .4rem 1.1rem;padding:0;font-size:.85rem}
.ct .gq-say{font-size:.9rem}

/* Add-ons on the cleaner checklist: booked extras that aren't part of a normal clean */
.checklist label.addon{background:#fff4d6;border-left:4px solid #f2a900;border-bottom-color:#f3d68a;padding-left:.6rem;padding-right:.5rem;margin:.2rem 0;border-radius:6px;font-weight:700}
.checklist label.addon.done{background:#eef7ee;border-left-color:#3a9a4a}
.checklist label.addon span:first-of-type{flex:1}
.addon-tag{display:inline-block;background:#f2a900;color:#3b2a00;font-size:.68rem;font-weight:800;letter-spacing:.04em;padding:.12rem .45rem;border-radius:999px;white-space:nowrap}
.checklist label.addon.done .addon-tag{background:#3a9a4a;color:#fff}
.addon-banner{background:#fff4d6;border:2px solid #f2a900;border-radius:10px;padding:.7rem .85rem;margin:.2rem 0 .8rem;color:#3b2a00}
.addon-banner ul{margin:.45rem 0 .35rem;padding-left:1.2rem}
.addon-banner li{font-weight:700;margin:.15rem 0}
.addon-banner li.done{text-decoration:line-through;opacity:.6}
.addon-banner .addon-left{font-weight:700}
.addon-offer{background:#fff4d6;border-radius:6px;padding-left:.4rem}

/* ---- 📞 New call / booking screen ---- */
.bk-who{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.6rem}
.bk-find{margin:0 0 .6rem}.bk-find input{width:100%}
.bk-results{display:flex;flex-direction:column;gap:.3rem;margin-top:.35rem}
.bk-picked{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start;flex-wrap:wrap;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:10px;padding:.55rem .7rem;margin:0 0 .6rem}
.bk-rush{margin-top:.6rem;font-weight:500}
.bk-cal{border:1px solid var(--line);background:#fff;border-radius:10px;padding:.55rem .6rem;margin:.2rem 0 .5rem;transition:opacity .15s}
.bk-cal.loading{opacity:.55}
.bk-calhead{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}.bk-calhead strong{margin:0 .3rem}.bk-calhead .bk-jump{width:auto;margin-left:auto;padding:.25rem .4rem}
.bk-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.35rem}
@media (max-width:900px){.bk-week{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}}
.bk-day{border:1px solid var(--line);border-radius:8px;padding:.35rem;min-height:4rem;display:flex;flex-direction:column;gap:.22rem;background:#fbfdff}
.bk-day.on{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.bk-dh{font-weight:700;font-size:.82rem;color:var(--ink);margin-bottom:.1rem}.bk-dh span{font-weight:500;color:var(--muted)}
.bk-slot{font:inherit;font-size:.8rem;font-weight:600;border:1px solid #93c5fd;background:var(--info-soft);color:#1e3a8a;border-radius:6px;padding:.18rem .3rem;cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:.2rem}
.bk-slot i{font-style:normal;font-weight:700;font-size:.68rem;background:#fff;border-radius:999px;padding:0 .32rem;color:#1e3a8a}
.bk-slot:hover{border-color:var(--brand)}
.bk-slot.part{border-color:#fcd34d;background:var(--warn-soft);color:#92400e}
.bk-slot.sel{background:var(--brand);border-color:var(--brand);color:#fff}.bk-slot.sel i{color:var(--brand)}
.bk-part{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-top:.15rem}
.bk-none{padding:.2rem 0}.bk-unk{margin-top:auto}
.bk-reg{border-top:1px dashed #cbd5e1;margin-top:.6rem;padding-top:.6rem}
.bk-actions{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;border-top:1px solid #e2e8f0;padding-top:.8rem;margin-top:.2rem}
.bk-actions .btn.big{width:auto;flex:1 1 220px}
.bk-actions .open-lead-btn{margin-right:0}
.bk-side .bk-sum{border-color:#bfdbfe}
.bk-sum dl.info{margin:0}
.bk-more summary{cursor:pointer}
.bk-cardok{padding:.45rem .6rem;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:8px}
.field-help{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center;margin-top:.8rem}
.unfinished-calls{border-color:#bfdbfe}

/* Phone / email checks */
input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(185,28,28,.12); }
.field-err { color: var(--danger); font-size: .8rem; margin-top: .25rem; font-weight: 600; }
/* Booking: home type, bedrooms and bathrooms on one line */
.bk-home { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: .6rem; }
@media (max-width: 600px) { .bk-home { grid-template-columns: 1fr 1fr; } }
/* Cleaners needed -> time in the home */
.crew-time-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.crew-time { font-size: .88rem; }
.crew-long { color: var(--warn); font-weight: 600; }
/* Card step */
.bk-cardok { background: #e8f5ea; border: 1px solid #b7dfbe; color: #1d5e2a; border-radius: 8px; padding: .55rem .7rem; }
.bk-cardwait { background: #eef4ff; border: 1px solid #c7d7f5; border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; font-size: .9rem; display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.bk-cardbad { background: #fdecec; border: 1px solid #f5c2c2; color: var(--danger); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; font-size: .9rem; }
.bk-cardwarn { background: var(--warn-soft); color: #78350f; border-radius: 8px; padding: .55rem .7rem; font-size: .9rem; }
.spin { width: 14px; height: 14px; border: 2px solid #9db6e6; border-top-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hold-check { margin-top: .5rem; align-items: flex-start; }
.share-note { background: var(--warn-soft); color: #78350f; border-radius: 8px; padding: .55rem .7rem; margin-bottom: .75rem; font-size: .88rem; }
#bk-book.needs-card { background: #9aa4b2; border-color: #9aa4b2; }

/* ---------- Tips library (cleaner portal) ---------- */
.tips-hero { position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 1rem; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3fb6a8 0%, rgba(63,182,168,0) 55%), linear-gradient(135deg, #0f2f52 0%, #1c5a96 60%, #2a7bc2 100%); box-shadow: 0 10px 30px rgba(15,47,82,.25); }
.tips-hero::after { content: '✨'; position: absolute; right: 1rem; top: .6rem; font-size: 2.6rem; opacity: .25; }
.tips-hero-in { padding: 1.4rem 1.25rem 1.1rem; }
.tips-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.tips-hero h1 { color: #fff; font-size: 1.75rem; margin: .15rem 0 .35rem; }
.tips-hero p { margin: 0 0 1rem; opacity: .9; max-width: 38rem; line-height: 1.45; }
.tips-search { display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 14px; padding: .25rem .4rem .25rem .8rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.tips-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1.05rem; padding: .65rem 0; color: var(--ink); background: transparent; min-width: 0; }
.tips-search button { border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 999px; width: 2rem; height: 2rem; font-size: .9rem; cursor: pointer; }
.tips-quick { display: flex; gap: .4rem; overflow-x: auto; padding: .8rem 0 .1rem; scrollbar-width: none; width: 0; min-width: 100%; }
.tips-quick::-webkit-scrollbar { display: none; }
.tips-quick button { flex: none; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tips-quick button:active { background: rgba(255,255,255,.3); }
.tip-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.tip-cat { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: .95rem .9rem .8rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: var(--ink); overflow: hidden; min-height: 132px; }
.tip-cat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tc); }
.tip-cat:hover { text-decoration: none; border-color: var(--tc); }
.tip-cat strong { font-size: 1rem; line-height: 1.2; }
.tip-cat .small { color: var(--muted); line-height: 1.3; }
.tip-cat-ic { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, var(--tc) 14%, #fff); margin-bottom: .2rem; }
.tip-cat-ic.big { width: 3.2rem; height: 3.2rem; font-size: 1.8rem; flex: none; }
.tip-cat-n { margin-top: auto; font-size: .75rem; font-weight: 700; color: var(--tc); }
.tip-cat-head { display: flex; gap: .9rem; align-items: center; margin: .25rem 0 1rem; }
.tip-cat-head p { margin: .2rem 0 0; color: var(--muted); }
.tip-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.tip-row:last-child { border-bottom: 0; }
.tip-row:hover { text-decoration: none; background: #f8fafc; }
.tip-row strong { display: block; font-weight: 600; line-height: 1.3; }
.tip-row .grow { flex: 1; min-width: 0; }
.tip-ic { width: 2.3rem; height: 2.3rem; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; background: color-mix(in srgb, var(--tc, var(--brand)) 13%, #fff); }
.tip-ic.big { width: 3.4rem; height: 3.4rem; font-size: 1.9rem; border-radius: 16px; }
.tip-go { color: var(--muted); font-size: 1.4rem; }
.tips-start h2, .tips-results h2 { margin-bottom: .3rem; }
.tip { max-width: 760px; }
.tip-head { display: flex; gap: .9rem; align-items: center; margin: .25rem 0 1rem; }
.tip-head h1 { font-size: 1.4rem; line-height: 1.25; }
.tip-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.tip-meta span { font-size: .8rem; font-weight: 600; background: color-mix(in srgb, var(--tc) 12%, #fff); color: var(--ink); border-radius: 999px; padding: .2rem .6rem; }
.tip-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tip-chips span { background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; padding: .35rem .6rem; font-size: .88rem; line-height: 1.3; }
.tip-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.tip-steps li { counter-increment: s; position: relative; padding: 0 0 .9rem 2.6rem; line-height: 1.5; }
.tip-steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; width: 1.85rem; height: 1.85rem; border-radius: 50%; background: var(--tc); color: #fff; font-weight: 700; font-size: .9rem; display: grid; place-items: center; }
.tip-steps li:not(:last-child)::after { content: ''; position: absolute; left: .9rem; top: 1.9rem; bottom: .15rem; width: 2px; background: color-mix(in srgb, var(--tc) 25%, #fff); }
.tip-avoid { border-color: #fecaca; background: #fff7f7; }
.tip-avoid h2 { color: var(--danger); }
.tip-avoid ul { margin: 0; padding-left: 1.1rem; }
.tip-avoid li { margin-bottom: .45rem; line-height: 1.45; }
.tip-pro { border-color: #fde68a; background: #fffbeb; }
.tip-pro p { margin: 0; line-height: 1.5; }
.btn.tip-video { display: flex; justify-content: center; background: #c4302b; border-color: #c4302b; color: #fff; }
.btn.tip-video:hover { background: #a82723; text-decoration: none; }
.tip-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; margin-bottom: 1.5rem; }
.tip-nav .btn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-align: center; }
.tip-nav a:last-child:nth-child(2) { text-align: center; }
.tip, .tips-hero, .tip-cats { min-width: 0; }
@media (max-width: 860px) { .tips-hero h1 { font-size: 1.5rem; } .tip-cats { grid-template-columns: 1fr 1fr; } .tabbar a { font-size: .64rem; } }
.btn.tip-video { white-space: normal; text-align: center; }
.tip-head > div, .tip-row .grow { min-width: 0; }
.tip-head h1 { overflow-wrap: anywhere; }
.tip-steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.tip-steps-head h2 { margin: 0; }
.tip-steps li { cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 8px; transition: opacity .15s; }
.tip-steps li.done > span { text-decoration: line-through; opacity: .5; }
.tip-steps li.done::before { content: '✓'; background: var(--ok); }
.tips-results .btn { margin-top: .2rem; }
.tips-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* ---------- phone fit (Nov 28 2026) ----------
   Grid/flex children may shrink below their content so a long word, select or table
   can never push the page wider than the phone. Tables scroll inside .table-wrap.
   Inputs are 16px on phones: iPhone zooms in on any box under 16px when tapped and
   the home-screen app then stays zoomed (the "have to pinch" bug). */
.grid > *, .row > *, .card { min-width: 0; }
.card { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  html, body { overflow-x: hidden; }
  input, select, textarea, .lang-select, .toolbar input, .toolbar select, table.bank select { font-size: 16px; }
  .toolbar input, .toolbar select { min-width: 0; max-width: 100%; }
  .grid.two-col { grid-template-columns: minmax(0, 1fr); }
  img, video, canvas, iframe { max-width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .toolbar form { flex-wrap: wrap; max-width: 100%; }
  .toolbar form input[type=date] { flex: 1 1 130px; width: auto; }
}

/* One-photo camera field (damage, lockout door): preview of the shot above the Take photo button */
.cam-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; background: #0001; margin-bottom: .5rem; }

/* ---------- tables on phones (Nov 29 2026) ----------
   Root cause of the one-letter-per-line columns: `.card { overflow-wrap: anywhere }` (phone fit, Nov 28)
   is inherited by table cells, and "anywhere" lets the browser shrink every column to one character.
   Tables keep normal word wrapping; a table wider than the screen slides sideways in .table-wrap. */
.card table { overflow-wrap: normal; word-break: normal; }
.table-wrap td.num, .table-wrap td.right, .table-wrap .badge { white-space: nowrap; }
.phone-only { display: none; }

/* Stacked rows used instead of the table on phones (Jobs, Quotes, Invoices): mobileList() in app.js */
.mlist { margin: -.25rem 0; }
.mrow { padding: .8rem .15rem; border-bottom: 1px solid var(--line); cursor: pointer; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
.mrow:last-child { border-bottom: 0; }
.mrow:active { background: #f8fbfa; }
.mrow-top, .mrow-sub { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.mrow-title { min-width: 0; font-size: 1rem; line-height: 1.3; }
.mrow-amt { flex: none; font-weight: 700; white-space: nowrap; }
.mrow-sub { margin-top: .2rem; align-items: center; }
.mrow-subtxt { min-width: 0; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.mrow-sub .badge, .mrow-badges { flex: none; }
.mrow-badges { display: inline-flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mrow-meta { margin-top: .35rem; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: .3rem; }
.mrow-meta .crew { display: flex; flex-wrap: wrap; gap: .3rem; }

/* Weekly scorecard: metric names stay pinned on the left while the weeks slide sideways */
table.scorecard th[scope=row] { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); font-weight: 600; white-space: normal; min-width: 10rem; }
table.scorecard thead th { white-space: nowrap; }
table.scorecard td { white-space: nowrap; min-width: 3.6rem; }
.sc-target { font-size: .75rem; font-weight: 400; color: var(--muted); margin-top: .15rem; line-height: 1.3; }

@media (max-width: 860px) {
  .phone-only { display: block; }
  .desk-only { display: none !important; }
  table.scorecard th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); box-shadow: 1px 0 0 var(--line); min-width: 8.5rem; max-width: 9.5rem; }
  table.scorecard td, table.scorecard thead th { padding-left: .5rem; padding-right: .5rem; }
  /* Status tabs (All / Scheduled / In progress / Completed / Cancelled) on one line across the screen, sliding if they don't fit */
  .toolbar .seg { display: flex; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .toolbar .seg a { flex: 1 0 auto; text-align: center; white-space: nowrap; padding: .5rem .6rem; }
  .toolbar > form { margin-left: 0 !important; width: 100%; }
  .toolbar > form input[type=search] { width: 100%; }
}

/* Offline banner for cleaners (offline.js) */
.offbar { position: sticky; top: 0; z-index: 60; background: #fff7e6; color: #6b4a00; border-bottom: 1px solid #f3d49a; padding: .55rem .9rem; font-size: .9rem; line-height: 1.35; text-align: center; }
.offbar.offline { background: #2d3748; color: #fff; border-bottom-color: #1a202c; }
.offbar .btn { margin-left: .3rem; color: inherit; }
/* Add-ons on the booking screen (pricing v5): live price/time per add-on, garage bays and basement floors once ticked */
.gq-xwrap{display:flex;flex-direction:column;gap:.2rem}
.gq-xmore{margin:0 0 .2rem 1.6rem;display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.gq-xmore input[type=number]{margin-left:.3rem}
.gq-x .gq-xlive{display:block;color:#475569}
.gq-x.included .gq-xlive{display:none}
.crew-total{display:block;font-size:.9rem;margin-top:.3rem}

/* post-clean walkthrough yes / no above the finish button (Nov 29 2026) */
.walk-box{border:1px solid #cbd5e1;border-radius:10px;padding:.6rem .7rem;margin:0 0 .6rem;background:#f8fafc}
.walk-box.need{border-color:#fca5a5;background:#fff5f5}
.walk-q{font-weight:700;margin-bottom:.45rem}
.walk-opts{display:flex;gap:.5rem}
.walk-opt{flex:1;cursor:pointer;margin:0}
.walk-opt input{position:absolute;opacity:0;width:1px!important;height:1px}
.walk-opt span{display:flex;align-items:center;justify-content:center;min-height:2.8rem;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-weight:700;font-size:1.05rem}
.walk-opt input:checked+span{background:#2563eb;color:#fff;border-color:#2563eb}
.walk-opt input:focus-visible+span{outline:2px solid #93c5fd}

/* helpers on the availability page (Nov 29 2026) */
.av-hmodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.av-hmode { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .7rem .4rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink, #1f2a28); cursor: pointer; text-align: center; }
.av-hmode span { font-size: 1.5rem; line-height: 1; }
.av-hmode.on { border-color: var(--brand, #0f766e); background: var(--brand-soft); color: var(--brand-ink); }
.av-stepper { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.av-stepper > span { flex: 1; min-width: 140px; font-weight: 600; }
.av-stepper .btn { width: 44px; height: 44px; padding: 0; font-size: 1.3rem; }
.av-stepper strong { font-size: 1.3rem; min-width: 1.5rem; text-align: center; }
.av-help { width: auto; max-width: 100%; padding: .35rem .5rem; font-size: .85rem; }
.av-help.on { border-color: var(--brand, #0f766e); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* 💬 "If they push back on price" on New call (Nov 30 2026): same spot and look for every clean type, collapsed until tapped */
.bk-closer{border:1px solid #fcd34d;background:#fffbeb;border-radius:10px;margin:.25rem 0 .75rem;padding:.55rem .8rem}
.bk-closer>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;min-height:2rem}
.bk-closer>summary::-webkit-details-marker{display:none}
.bk-closer>summary::before{content:'▸';color:#92400e;font-weight:700}
.bk-closer[open]>summary::before{content:'▾'}
.bk-closer-t{font-weight:700;color:#92400e}
.bk-closer-body{padding:.4rem 0 .2rem 1.1rem}
.bk-or{margin:.2rem 0 .3rem;text-transform:uppercase;font-size:.72rem;letter-spacing:.05em}
/* "Did you mean name@gmail.com?" under an email box (Nov 30 2026): tap the address to fix the box */
.field-tip { font-size: .85rem; margin-top: .3rem; color: #92400e; }
.field-tip .linklike { background: none; border: 0; padding: .15rem .1rem; color: #1d4ed8; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 0; }

/* TEST copy bar + account switcher + "Viewing as" bar (public/testenv.js, since Nov 30 2026) */
#envbar { position: sticky; top: 0; z-index: 70; font-size: .9rem; line-height: 1.3; padding-top: env(safe-area-inset-top); background: #c62828; }
#envbar > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .8rem; padding: .4rem .8rem; }
.envbar-test { background: #c62828; color: #fff; }
.envbar-test > strong:first-child { background: #ffd600; color: #000; padding: .05rem .5rem; border-radius: 4px; letter-spacing: .08em; }
.envbar-view { background: #ffd600; color: #3b2f00; }
.envbar-quiet { background: #eef3f8; color: var(--ink); justify-content: flex-end !important; }
.envbar-hint { opacity: .85; font-size: .82rem; }
#envbar select { font-size: .85rem; padding: .2rem .4rem; border-radius: 6px; max-width: 16rem; }
#envbar .btn.small { padding: .2rem .6rem; }
body.has-envbar .sidebar { top: var(--envbar-h, 0px); height: calc(100vh - var(--envbar-h, 0px)); }
@media (max-width: 860px) { #envbar { font-size: .82rem; } #envbar > div { gap: .3rem .5rem; padding: .3rem .5rem; } #envbar select { font-size: 16px; max-width: 11rem; padding: .1rem .3rem; } .envbar-hint { display: none; } }
.outbox-row { align-items: flex-start; }
.outbox-text { white-space: pre-wrap; background: var(--bg, #f4f7fb); border-radius: 8px; padding: .5rem .65rem; margin: .35rem 0; font-size: .92rem; overflow-wrap: anywhere; }
.outbox-reply { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.outbox-input { flex: 1 1 12rem; min-width: 0; }
