:root {
  --teal: #0F3D44; --teal-2: #17616b; --orange: #FF5A1F; --bg: #f4f6f7; --card: #fff;
  --text: #1b2426; --muted: #6a7679; --line: #dde3e5; --ok: #1b6b32; --warn: #a85800; --bad: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--teal-2); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--teal); color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.who { font-size: 13px; opacity: .9; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.who button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 80px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
label.field { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid #c9d1d3; border-radius: 9px; background: #fff; color: var(--text); width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; background: #e7eced; color: var(--text); text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--teal); color: #fff; font-weight: 600; }
button.accent { background: var(--orange); color: #fff; font-weight: 600; }
button.link { background: none; padding: 4px 6px; color: var(--teal-2); }
button.danger { background: none; color: var(--bad); padding: 4px 6px; }
button:disabled { opacity: .5; cursor: default; }
.search { font-size: 17px; padding: 12px 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: block; padding: 11px 4px; color: var(--text); text-decoration: none; }
.list a:hover { background: #f2f6f7; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #e7eced; color: var(--muted); margin-left: 6px; }
button.link.danger-link { color: var(--bad); }
li.archived > div { opacity: .7; }
.pill.com { background: #e3edfb; color: #1f4f9a; }
.pill.res { background: #e4f4e6; color: #22662f; }
.pill.phone { background: #fff0e8; color: #a53a10; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sticky { position: sticky; top: 70px; }
.lines .line { display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; padding: 8px 0; border-top: 1px dashed var(--line); }
.lines .line:first-of-type { border-top: 0; }
.lines .line.wide { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.lines .price { text-align: right; font-variant-numeric: tabular-nums; min-width: 80px; padding-bottom: 9px; }
.warn { color: var(--warn); font-size: 12px; }
.err { color: var(--bad); }
.ok { color: var(--ok); }
.range { font-size: 30px; font-weight: 750; color: var(--teal); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.checks label { display: flex; gap: 8px; align-items: center; margin: 4px 0; font-size: 14px; }
.mods { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.mods label { display: flex; gap: 5px; align-items: center; }
.signin { max-width: 380px; margin: 40px auto; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--teal); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 20; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos figure { margin: 0; }
.photos video { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: #000; display: block; }
.plan-svg { width: 100%; max-height: 560px; background: #fff; border: 1px solid var(--line); border-radius: 10px; display: block; }
.photos img, .photos .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #e7eced; display: block; }
.photos figcaption { margin-top: 4px; line-height: 1.3; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .lines .line, .lines .line.wide { grid-template-columns: 1fr 1fr; }
  .lines .price { text-align: left; padding-bottom: 0; }
}

.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; opacity: .92; }
.nav a:hover { opacity: 1; text-decoration: underline; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary::before { content: "▾ "; }
details.card[open] > summary { margin-bottom: 8px; }
.savebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; position: sticky; top: 58px; background: var(--bg); padding: 8px 0; z-index: 3; }
table.mini { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.mini td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
table.mini td.amt { text-align: right; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* Proposal preview (proposal.js) */
.pe-page { background: #fff; max-width: 820px; margin: 0 auto; padding: 36px 44px; border-radius: 10px; box-shadow: 0 2px 14px rgba(0,0,0,.08); color: #111; font-size: 14px; line-height: 1.45; }
.pe-head { display: flex; gap: 16px; align-items: flex-start; border-bottom: 3px solid; padding-bottom: 12px; }
.pe-logo { max-width: 130px; max-height: 80px; object-fit: contain; }
.pe-company { font-size: 20px; font-weight: 700; }
.pe-right { text-align: right; }
.pe-word { font-weight: 800; letter-spacing: .5px; font-size: 18px; }
.pe-small { font-size: 12px; color: #666; }
.pe-label { font-size: 11px; font-weight: 700; color: #777; letter-spacing: .5px; }
.pe-for { margin: 18px 0 6px; }
.pe-title { margin: 16px 0 6px; font-size: 20px; }
.pe-section { margin-top: 22px; }
.pe-section h3 { font-size: 13px; letter-spacing: .6px; text-transform: uppercase; border-bottom: 1px solid; padding-bottom: 4px; margin: 0 0 10px; }
.pe-scope { margin: 0 0 10px; }
.pe-para { white-space: pre-wrap; }
.pe-table { width: 100%; border-collapse: collapse; }
.pe-table td { padding: 6px 4px; border-bottom: 1px solid #eee; vertical-align: top; }
.pe-table .pe-amt { text-align: right; width: 130px; font-variant-numeric: tabular-nums; }
.pe-table .pe-sum td { color: #444; }
.pe-table .pe-total td { font-weight: 800; font-size: 16px; border-top: 2px solid #222; border-bottom: 0; }
.pe-table .pe-off td { color: #aaa; text-decoration: line-through; }
.pe-price { width: 110px; text-align: right; border: 1px dashed transparent; background: transparent; padding: 2px 4px; font: inherit; }
.pe-price:hover, .pe-price:focus { border-color: #bbb; background: #fffbe8; }
.pe-tools { width: 64px; white-space: nowrap; }
.pe-tools button { padding: 2px 8px; margin-left: 2px; }
.pe-hint { font-size: 11px; color: #a25a00; }
.pe-note:empty::before { content: "+ note"; color: #bbb; }
.pe-note { font-size: 12px; color: #555; }
.pe-edit { outline: none; border-radius: 4px; }
.pe-edit:hover { background: #fffbe8; box-shadow: 0 0 0 1px #ead9a0; cursor: text; }
.pe-edit:focus { background: #fffbe8; box-shadow: 0 0 0 2px #e0b84a; }
.pe-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pe-accept { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; font-size: 13px; }
.pe-perk { margin-top: 22px; border: 1px dashed; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.pe-follow { margin-top: 18px; border-top: 1px solid #eee; padding-top: 8px; }
.pe-follow a { color: inherit; }
.pe-social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pe-social a { display: inline-block; padding: 3px 12px; border: 1.5px solid; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tabs button { border-radius: 0; border: 0; }
.tabs button.on { background: var(--teal, #0F3D44); color: #fff; }
@media print {
  header.top, .noprint, .tabs, .sticky, .savebar, nav, #who { display: none !important; }
  body { background: #fff; }
  .layout { display: block !important; }
  .pe-page { box-shadow: none; padding: 0; max-width: none; }
  .pe-edit:hover, .pe-edit:focus { background: none; box-shadow: none; }
  .pe-note:empty::before { content: ""; }
  .pe-price { border: 0; }
}
.support-banner { background: #a53a10; color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 13px; margin-right: 10px; }
.support-banner .link { color: #fff; text-decoration: underline; }

/* Customer page folders (collapsible sections) */
details.folder > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.folder > summary::-webkit-details-marker { display: none; }
details.folder > summary::before { content: "▸"; color: var(--muted, #777); transition: transform .15s; display: inline-block; }
details.folder[open] > summary::before { transform: rotate(90deg); }
details.folder > summary h2 { margin: 0; }
details.folder[open] > summary { margin-bottom: 10px; }
.folder-body > .card { box-shadow: none; border: 0; padding: 0; margin: 0; background: none; }
.folder-body > .card > h2:first-child, .folder-body > .card > .spread > h2, .folder-body > .card > .spread > div > h2 { display: none; }

/* Send dialog + sent estimate */
dialog.send-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 0; border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.send-dialog::backdrop { background: rgba(20, 30, 32, .45); }
dialog.send-dialog textarea { width: 100%; font: inherit; }
dialog.send-dialog input:not([type=checkbox]) { width: 100%; }
.banner { padding: 12px 14px; border-radius: 10px; background: #eef3f4; font-weight: 600; margin: 8px 0; }
.banner.ok { background: #e6f6ea; color: #1b6b32; }
.banner.qbo-reconnect { background: #fdecea; color: #8a1c12; margin: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.banner.qbo-reconnect .btn { text-decoration: none; padding: 6px 12px; border-radius: 8px; display: inline-block; }
.pill.sent { background: #e3edfb; color: #1f4f9a; }
.pill.accepted { background: #e4f4e6; color: #22662f; }
.pill.declined { background: #fdecec; color: #9a1c1c; }
.pill.draft { background: #eef0f1; }
table.lines { width: 100%; border-collapse: collapse; }
table.lines td { padding: 7px 0; border-bottom: 1px solid #eef0f1; vertical-align: top; }
table.lines td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
table.lines tr.grand td { border-bottom: 0; padding-top: 10px; }
@media print { dialog.send-dialog { display: none; } }

/* Rooms, floor plans, blueprints */
.plan-svg.big { max-height: none; height: min(72vh, 760px); touch-action: none; cursor: grab; }
.room-svg { height: min(60vh, 560px); max-height: none; touch-action: none; cursor: grab; }
.room-svg .handle { cursor: move; }
.room-svg .edge-label { cursor: pointer; }
.plan-room { fill: transparent; stroke: none; cursor: pointer; }
.plan-room:hover { fill: rgba(255, 90, 31, .14); }
.plan-label.link { cursor: pointer; }
.doc-svg.adding { cursor: crosshair; }
.doc-svg .pin { cursor: pointer; }
.plan-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.plan-bar .grow, .row .grow { flex: 1; }
h3.sub { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.doc-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.doc-card:hover { border-color: #0F3D44; }
.doc-card img, .doc-card .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #eef0f1; border-radius: 6px; display: block; margin-bottom: 6px; }
.zone-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; padding: 6px 0; border-top: 1px dashed var(--line); }
.mark-chip { display: inline-block; border: 1px solid; border-radius: 999px; padding: 1px 8px; margin: 2px 4px 2px 0; }
.note-row { margin: 4px 0; }
.pin-list { padding-left: 18px; }
@media print {
  .plan-bar, .noprint { display: none !important; }
  .plan-svg.big { height: auto; border: 0; }
}

/* Customer page: floor plan as a small preview, not the whole screen */
.plan-thumb { cursor: zoom-in; max-width: 420px; }
.plan-thumb .plan-svg { height: 200px; max-height: 200px; }
.plan-thumb figure { margin: 0 !important; }
.plan-thumb:hover .plan-svg { border-color: #0F3D44; }

/* Results */
.rtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.rtile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.rtile-label { font-size: 13px; color: var(--muted); }
.rtile-value { font-size: 30px; font-weight: 700; color: #0F3D44; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.rtile-sub { font-size: 12px; color: var(--muted); }
.rchart { display: grid; gap: 10px; margin: 8px 0 4px; }
.rrow { display: grid; grid-template-columns: 120px 1fr 120px; gap: 10px; align-items: center; }
.rlabel { font-size: 14px; }
.rtrack { height: 14px; background: #eef0f1; border-radius: 4px; overflow: hidden; }
.rbar { height: 100%; background: #0F3D44; border-radius: 0 4px 4px 0; }
.rrow:hover .rbar { background: #1F6B75; }
.rvalue { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rvalue .muted { font-weight: 400; font-size: 12px; }
table.rtable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 6px; }
table.rtable th.num, table.rtable td.num { text-align: right; }
.demo-banner { background: #fff4d6; color: #7a5200; }
@media (max-width: 600px) { .rrow { grid-template-columns: 90px 1fr 80px; } }
.demo-banner .link { color: #7a5200; }
/* An account's locations (temples, stations, managed houses) */
.locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.location { border: 1px solid var(--line, #dde3e5); border-radius: 10px; padding: 10px 12px; background: var(--card); min-width: 0; }
.location.archived { opacity: .7; background: #f6f8f8; }
.location a b { overflow-wrap: anywhere; }
.list li.nested a { padding-left: 26px; }
/* Crew notes, permission to scan, crew marks (build 11) */
.crew-notes { margin-top: 8px; display: grid; gap: 3px; }
.consent { margin-top: 8px; }
.crew-mark { cursor: pointer; }
.plan-bar.small { font-size: 13px; }
.map-box { height: 460px; border-radius: 10px; overflow: hidden; margin: 8px 0; background: #e8eef0; }
@media (max-width: 640px) { .map-box { height: 340px; } }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-left: 6px; }
.right { text-align: right; }
/* ---- add-ons: crew, fleet, rugs, time clock (phone-first) ---- */
.big-btn { min-height: 46px; padding: 10px 16px; font-size: 16px; border-radius: 12px; }
a.btn.big-btn { display: inline-flex; align-items: center; }
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.status-row .big-btn { width: 100%; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.type-btn { text-align: left; padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid #d9e2e4; }
.type-btn.on { border-color: var(--teal-2, #0f8b8d); background: #eef8f8; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill.ok-pill { background: #e3f4e8; color: #1c7a3d; }
.pill.bad-pill { background: #fde7e4; color: #b42318; }
ul.tight { margin: 4px 0 8px 18px; padding: 0; }
.checklist label { padding: 4px 0; }
.job-card h2 { font-size: 20px; }
@media (max-width: 640px) {
  .status-row .big-btn { font-size: 15px; padding: 10px 6px; }
  .type-grid { grid-template-columns: 1fr; }
}
.angle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.angle { border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.angle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.angle-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .angle-row { grid-template-columns: 1fr; } }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--teal); color: #fff; }
div.tabs { margin-bottom: 10px; flex-wrap: wrap; }
dialog.dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 0; border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dialog::backdrop { background: rgba(20, 30, 32, .45); }
dialog.dialog input:not([type=checkbox]), dialog.dialog textarea, dialog.dialog select { width: 100%; }
.plant { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.plant-col { background: #eef2f3; border-radius: 12px; padding: 8px; min-height: 120px; }
.plant-head { font-weight: 700; font-size: 13px; margin: 2px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.rug-card { display: block; background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); border-left: 4px solid var(--teal-2); }
.rug-card.risk { border-left-color: var(--bad); }
.rug-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin: 6px 0 10px; }

/* Team chat */
.chat-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: calc(100vh - 170px); min-height: 420px; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: block; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.chat-item.on { background: #e9f1f2; }
.chat-item.unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-left: 6px; vertical-align: middle; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; position: relative; }
.chat-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; text-decoration: none; font-size: 22px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.msg { max-width: 75%; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.msg.mine { align-self: flex-end; background: #dff0f2; border-color: #c6e1e4; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-time { font-size: 11px; margin-top: 2px; }
.msg-atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; margin: 4px 0; }
.msg-atts img, .msg-atts video { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; cursor: pointer; background: #000; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 42px; max-height: 160px; }
.chat-new { padding: 14px; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-people { max-height: 240px; overflow-y: auto; margin: 8px 0; }
.chat-manage { position: absolute; top: 50px; right: 10px; left: 10px; z-index: 3; max-height: 70%; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.badge-dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .chat-wrap .chat-pane { display: none; }
  .chat-wrap.has-thread .chat-list { display: none; }
  .chat-wrap.has-thread .chat-pane { display: flex; }
  .chat-back { display: inline; }
  .msg { max-width: 88%; }
}
.meter { height: 10px; border-radius: 6px; background: #e7eced; overflow: hidden; margin: 6px 0; }
.meter-fill { height: 100%; background: var(--teal-2); border-radius: 6px; }

/* Customers folded A–Z when the list is long */
.letter-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0 4px; border-top: 0 !important; }
.letter { min-width: 30px; padding: 5px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; color: var(--text); cursor: pointer; text-align: center; }
.letter:hover { background: #f2f6f7; }
.letter.none { color: #c3c9cb; border-color: transparent; background: transparent; cursor: default; }
details.letter-group > summary { list-style: none; cursor: pointer; padding: 11px 4px; display: flex; gap: 8px; align-items: baseline; }
details.letter-group > summary::-webkit-details-marker { display: none; }
details.letter-group > summary::before { content: "▸"; color: var(--muted, #777); display: inline-block; transition: transform .15s; }
details.letter-group[open] > summary::before { transform: rotate(90deg); }
details.letter-group > summary:hover { background: #f2f6f7; }
details.letter-group > .list { margin-left: 18px; }

/* Pre-inspection (inspection.js): short "what to look for" tips under fields. */
details.tip { margin: 2px 0 6px; }
details.tip summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.tip > div { padding: 4px 0 2px 12px; max-width: 60ch; }
/* Company switcher (reports.js) */
.switcher { position: relative; display: inline-block; margin-right: 8px; }
.switcher-button { font-weight: 700; }
.switcher-button .chev { opacity: .6; }
.switcher-menu { position: absolute; z-index: 50; top: 100%; left: 0; min-width: 240px; max-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px 0; }
.switcher-menu[hidden] { display: none; }
.switcher-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px 2px; }
.switcher-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: 0; }
.switcher-item:hover, .switcher-item.active { background: #f1f4f5; }
