:root{--gold:#FFBF00;--gold-d:#d9a200;--ink:#1f1f1f;--mut:#6b6b6b;--line:#e6e3dc;--bg:#f7f5f1;--card:#fff;--red:#c0392b;--green:#1e7e34;--warn:#fff4d6;--nav-h:68px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:Arial,Helvetica,sans-serif;font-size:16px;color:var(--ink);background:var(--bg);padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px)}
a{color:inherit}
.top{position:sticky;top:0;z-index:20;background:var(--ink);color:#fff;display:flex;align-items:center;gap:10px;padding:8px 12px;padding-top:calc(8px + env(safe-area-inset-top));border-bottom:3px solid var(--gold)}
.top img{width:36px;height:36px;border-radius:50%;background:#fff}
.top .t{font-weight:bold;font-size:17px;flex:1;min-width:0;overflow:hidden}
.top .t small{display:block;font-weight:normal;color:var(--gold);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top a.icon{color:#fff;text-decoration:none;font-size:15px;padding:8px 10px;border:1px solid #555;border-radius:8px}
main{max-width:900px;margin:0 auto;padding:12px}
h1{font-size:22px;margin:6px 0 12px}
h2{font-size:17px;margin:18px 0 8px;display:flex;align-items:center;gap:8px}
h2 .count{background:var(--gold);color:#000;border-radius:12px;padding:1px 9px;font-size:13px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:12px}
.card.gold{border-top:4px solid var(--gold)}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
@media(min-width:700px){.grid.g4{grid-template-columns:repeat(4,1fr)}.cols2{display:grid;grid-template-columns:1fr 1fr;gap:12px}}
.stat{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;text-decoration:none;display:block}
.stat .n{font-size:24px;font-weight:bold}
.stat .l{font-size:13px;color:var(--mut)}
.stat.alert{border-color:var(--gold);background:var(--warn)}
.list{list-style:none;margin:0;padding:0;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.list li{border-bottom:1px solid var(--line)}
.list li:last-child{border-bottom:0}
.list a.row,.list .row{display:flex;align-items:center;gap:10px;padding:12px 14px;text-decoration:none;min-height:56px}
.row .main{flex:1;min-width:0}
.row .main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .sub{font-size:13px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .right{text-align:right;font-size:14px;white-space:nowrap}
.row.low{background:var(--warn)}
.empty{padding:14px;color:var(--mut);font-size:14px}
.badge{display:inline-block;font-size:12px;padding:2px 8px;border-radius:10px;background:#eee;color:#333;white-space:nowrap;vertical-align:middle}
.b-lead{background:#e8f0fe}.b-quoted,.b-Quoted{background:#fff1c2}.b-scheduled,.b-Open{background:#e3f4ea}
.b-in-progress,.b-In-Progress{background:#ffe0b2}.b-done,.b-Complete{background:#d4edda}.b-lost,.b-Lost{background:#f5d0d0}.b-On-Hold{background:#e0e0e0}
.badge.ex{background:#6b6b6b;color:#fff}.badge.warn{background:#ffd6d6;color:#8a1c1c}.badge.low{background:var(--gold);color:#000}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:10px 16px;border-radius:10px;border:1px solid #ccc;background:#fff;color:var(--ink);font-size:16px;font-weight:bold;text-decoration:none;cursor:pointer;font-family:inherit}
.btn.primary{background:var(--gold);border-color:var(--gold-d);color:#000}
.btn.dark{background:var(--ink);border-color:var(--ink);color:#fff}
.btn.danger{color:var(--red);border-color:#e3b3ad}
.btn.block{display:flex;width:100%}
.btn.sm{min-height:42px;padding:6px 12px;font-size:14px}
.btns{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.btns .btn{flex:1 1 140px}
label{display:block;font-size:13px;font-weight:bold;color:#444;margin:12px 0 4px}
input,select,textarea{width:100%;font-size:16px;font-family:inherit;padding:12px;border:1px solid #ccc;border-radius:10px;background:#fff;min-height:48px;color:var(--ink)}
textarea{min-height:90px}
input:focus,select:focus,textarea:focus{outline:2px solid var(--gold);border-color:var(--gold-d)}
.fr{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fr3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.checks{display:grid;grid-template-columns:1fr;gap:6px}
@media(min-width:600px){.checks{grid-template-columns:1fr 1fr}}
.check{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-weight:normal;font-size:15px;margin:0;background:#fff;min-height:48px}
.check input{width:24px;height:24px;min-height:0;accent-color:var(--gold-d)}
.flash{padding:12px 14px;border-radius:10px;margin-bottom:10px;font-size:15px}
.flash.ok{background:#e3f4ea;border:1px solid #b7dfc4}
.flash.err{background:#fde2e0;border:1px solid #f1b0aa}
.muted{color:var(--mut);font-size:13px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:15px}
.kv dt{color:var(--mut)}.kv dd{margin:0;font-weight:bold;text-align:right}
.big{font-size:28px;font-weight:bold}
.pos{color:var(--green)}.neg{color:var(--red)}
table.t{width:100%;border-collapse:collapse;font-size:14px;background:#fff}
table.t th{text-align:left;border-bottom:3px solid var(--gold);padding:8px 6px;font-size:12px;color:#444}
table.t td{border-bottom:1px solid var(--line);padding:8px 6px;vertical-align:top}
table.t td.r,table.t th.r{text-align:right}
.scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:12px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.chip{border:1px solid #ccc;background:#fff;border-radius:20px;padding:8px 12px;font-size:14px;min-height:40px;cursor:pointer;font-family:inherit;color:var(--ink)}
.chip.on,.chip:active{background:var(--gold);border-color:var(--gold-d)}
.tabs{display:flex;gap:6px;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -12px 10px;padding:0 12px 4px;scrollbar-width:none;min-width:0}
.tabs::after{content:"";flex:0 0 16px}
.tabs a{flex:0 0 auto;padding:10px 15px;border-radius:20px;border:1px solid #ccc;background:#fff;text-decoration:none;font-size:14px;white-space:nowrap}
.tabs a.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.search{display:flex;gap:8px;margin-bottom:10px}
.search input{flex:1}
/* item picker */
.picker .results{max-height:300px;overflow:auto;border:1px solid var(--line);border-radius:10px;margin-top:6px;background:#fff;display:none}
.picker .results.show{display:block}
.picker .opt{padding:12px;border-bottom:1px solid var(--line);cursor:pointer;min-height:52px}
.picker .opt:active,.picker .opt.hi{background:var(--warn)}
.picker .opt b{display:block;font-size:14px}.picker .opt span{font-size:13px;color:var(--mut)}
.picked{display:none;border:2px solid var(--gold);background:var(--warn);border-radius:10px;padding:10px 12px;margin-top:6px}
.picked.show{display:flex;gap:10px;align-items:center}
.picked .main{flex:1;min-width:0}.picked b{display:block}.picked span{font-size:13px;color:#555}
.qtyrow{display:grid;grid-template-columns:56px 1fr 56px;gap:8px}
.qtyrow button{font-size:26px;font-weight:bold;border-radius:10px;border:1px solid #ccc;background:#fff;min-height:52px;color:var(--ink)}
.qtyrow input{text-align:center;font-size:22px;font-weight:bold}
.total-line{display:flex;justify-content:space-between;align-items:center;margin:12px 0;padding:10px 12px;background:#f1efe9;border-radius:10px}
details summary{cursor:pointer;padding:10px 0;font-weight:bold;font-size:14px;color:#444;min-height:44px;display:flex;align-items:center}
/* copy blocks */
.copyblk{position:relative;margin-bottom:14px}
.copyblk pre{white-space:pre-wrap;word-wrap:break-word;background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;font-family:Arial,Helvetica,sans-serif;font-size:14px;margin:6px 0 0;max-height:260px;overflow:auto}
.copyblk .hd{display:flex;align-items:center;justify-content:space-between}
.copyblk .hd b{font-size:15px}
/* bottom nav */
nav.bn{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#fff;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--nav-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -2px 10px rgba(0,0,0,.06)}
nav.bn a{display:flex;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;font-size:12px;color:#555;gap:3px}
nav.bn a svg{width:24px;height:24px}
nav.bn a.on{color:#000;font-weight:bold}
nav.bn a.on svg{stroke:var(--gold-d)}
nav.bn a.fab{position:relative}
nav.bn a.fab .circle{width:58px;height:58px;border-radius:50%;background:var(--gold);border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;margin-top:-26px}
nav.bn a.fab .circle svg{stroke:#000;width:28px;height:28px}
nav.bn a.fab span{font-weight:bold;color:#000}
.login{max-width:380px;margin:12vh auto;padding:20px;text-align:center}
.login img{width:140px;height:140px;border-radius:50%}
.right-actions{display:flex;gap:8px;justify-content:flex-end}
.sticky-save{position:sticky;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 6px);z-index:5}
hr{border:0;border-top:1px solid var(--line);margin:14px 0}

.chips.scrollx{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;margin-left:-2px;min-width:0;max-width:100%}
.chips.scrollx .chip{flex:0 0 auto}
/* v2: send / track / invoices / client portal */
.steps{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.step{border:1px solid var(--line);border-radius:10px;padding:8px 6px;text-align:center;background:#faf9f6;min-width:0}
.step b{display:block;font-size:13px}.step span{display:block;font-size:11px;color:var(--mut);margin-top:2px;overflow-wrap:anywhere}
.step.on{background:var(--warn);border-color:var(--gold-d)}.step.on b::before{content:'✓ '}
.timeline{list-style:none;margin:6px 0 0;padding:0 0 0 14px;border-left:3px solid var(--gold)}
.timeline li{position:relative;padding:6px 0 6px 6px;font-size:14px}
.timeline li::before{content:'';position:absolute;left:-20px;top:11px;width:9px;height:9px;border-radius:50%;background:var(--gold-d)}
.timeline li span{display:block;font-size:12px;color:var(--mut)}
.timeline li.t-view::before{background:#8ab4f8}
.notice{background:#f1efe9;border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin-bottom:12px;font-size:15px}
.notice.warn{background:var(--warn);border-color:var(--gold-d)}
.linkbox{font-family:monospace;font-size:13px;background:#f7f5f1;border:1px solid var(--line);border-radius:8px;padding:10px;overflow-wrap:anywhere}
.inv-Draft{background:#e0e0e0}.inv-Sent{background:#e8f0fe}.inv-Viewed{background:#fff1c2}.inv-Partially-paid{background:#ffe0b2}.inv-Paid{background:#d4edda}
.lineitem .fr3{margin-top:4px}
.chip input{accent-color:var(--gold-d)}
body.portal{background:#fff;padding:0}
.ownerbar{background:var(--ink);color:#fff;font-size:13px;padding:8px 12px;text-align:center}.ownerbar a{color:var(--gold)}
.pwrap{max-width:760px;margin:0 auto;padding:16px 16px 40px;line-height:1.5}
.phead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:12px}
.phead img{width:130px;max-width:40%;height:auto}
.phead .biz{text-align:right;font-size:13px;color:#333}.phead .biz a{color:inherit}
.pmeta{display:grid;grid-template-columns:1fr;gap:10px;font-size:14px;margin-bottom:12px}
@media(min-width:560px){.pmeta{grid-template-columns:1.4fr 1fr 1fr}}
.gh,h2.gold{color:#FFBF00;font-family:Arial,Helvetica,sans-serif;font-weight:normal}
.gh{font-size:14px}
h2.gold{font-size:20px;margin:22px 0 6px;display:block}
.pwrap h3{font-size:15px;margin:14px 0 4px}
.pwrap p{margin:0 0 8px;font-size:15px}.pwrap p.fine{font-size:13px;color:#555}
.pstatus{background:var(--warn);border:1px solid var(--gold-d);border-radius:10px;padding:12px 14px;font-size:15px}
.pstatus.ok{background:#e3f4ea;border-color:#b7dfc4}
.ptable{width:100%;border-collapse:collapse;font-size:15px;margin-top:6px}
.ptable th{color:#FFBF00;font-weight:normal;text-align:left;border-top:4px solid #FFBF00;padding:8px 0}
.ptable td{border-bottom:1px solid #c8ccd8;padding:10px 0;vertical-align:top}
.ptable .r,.r{text-align:right}
.ptot{width:100%;max-width:420px;margin:8px 0 6px auto;border-collapse:collapse;font-size:15px}
.ptot td{padding:4px 0;text-align:right}.ptot td:first-child{padding-right:16px}
.ptot tr.grand td{border-top:3px double #c8ccd8;padding-top:8px;font-weight:bold}.ptot tr.grand td:first-child{color:#FFBF00}
.plist{list-style:none;padding:0;margin:0 0 10px}.plist li{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:8px 0;font-size:15px}
.pfoot{margin-top:28px;border-top:1px solid var(--line);padding-top:12px;font-size:12px;color:var(--mut);text-align:center}.pfoot a{color:inherit}
/* v3: leads / pipeline / intake */
.chip.on{background:var(--gold);border-color:var(--gold-d);color:#000;font-weight:bold}
.chip.lost.on{background:#ddd;border-color:#999}
.stagebar{margin:4px 0 10px}
a.chip{text-decoration:none}
.chip b{margin-left:4px;opacity:.75}
.chips.seg{gap:6px}
.chip.radio{display:inline-flex;align-items:center;cursor:pointer;margin:0}
.chip.radio input{position:absolute;opacity:0;width:1px;height:1px}
.chip.radio:has(input:checked){background:var(--gold);border-color:var(--gold-d);font-weight:bold}
.waiting{margin-top:6px;padding:8px 10px;border-radius:8px;font-size:15px}
.waiting.w-you{background:var(--warn);border:1px solid var(--gold-d)}
.waiting.w-client{background:#eef3f8;border:1px solid #c8d4e2}
.badge.oot{background:#fde8d8;border-color:#e8a87c;margin-left:4px}
.badge.st{white-space:nowrap}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.photos .ph{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:#eee;border:1px solid var(--line)}
.photos img{width:100%;height:100%;object-fit:cover;display:block}
.photos .heic{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;font-size:12px;text-align:center;padding:4px;text-decoration:none}
.photos .x{position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:13px;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:16px;line-height:26px;padding:0;min-height:0}
.hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
body.embed{background:transparent}
body.embed .pwrap{padding-top:0}

/* v4 */
ul.plain{list-style:none;margin:6px 0 0;padding:0}
ul.plain li{padding:6px 0;border-bottom:1px solid var(--line);font-size:15px}
ul.plain li:last-child{border-bottom:0}
.omw .chips{margin:8px 0 4px}
.rule{border-top:1px solid var(--line);margin-top:10px}
.card.fu .btns{margin-top:8px}
/* v5 estimate */
.estrow{display:flex;justify-content:space-between;gap:8px;margin:4px 0}.estrow b{font-size:18px}
.flash.warn{background:#fffaeb;border:1px solid #fec84b;color:#93370d}
tr.muted td{color:var(--mut)}
/* v6 prepare & send */
.prepsteps{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:10px}
.prepsteps .ps{text-align:center;padding:10px 4px;border-radius:10px;border:1px solid var(--line);background:#faf9f6;text-decoration:none;color:inherit;font-size:14px}
.prepsteps .ps b{display:inline-block;width:20px;height:20px;line-height:20px;border-radius:50%;background:#ddd;margin-right:4px;font-size:12px}
.prepsteps .ps.on{background:var(--warn);border-color:var(--gold-d);font-weight:bold}.prepsteps .ps.on b{background:var(--gold);}
.prepsteps .ps.off{opacity:.45;pointer-events:none}
.previewframe{width:100%;height:70vh;border:1px solid var(--line);border-radius:10px;background:#fff}
.pdfpage{width:100%;display:block;margin:0 0 8px;border:1px solid var(--line);border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.prepbtn{margin:0 0 12px;min-height:56px;font-size:17px}
.notice.ok{background:#e3f4ea;border:1px solid #b7dfc4}
.bbchoice{grid-column:1/-1;border-top:1px dashed var(--line);margin-top:6px;padding-top:6px}
/* v7 navigation: 5 bottom tabs on phones, left sidebar on desktop */
nav.bn{grid-template-columns:repeat(5,1fr)}
nav.bn a{font-size:11.5px;position:relative}
nav.bn a.on::before{content:'';position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 3px 3px;background:var(--gold)}
nav.bn .brand{display:none}
.top a.back{color:#fff;text-decoration:none;font-size:34px;line-height:30px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:50%;padding-bottom:4px}
.top a.icon.add{background:transparent;color:var(--gold);border-color:var(--gold);font-weight:bold;white-space:nowrap;min-height:40px;display:inline-flex;align-items:center}
.segtabs{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;background:#ebe8e1;border-radius:12px;padding:4px;margin:0 0 12px}
.segtabs a{text-align:center;text-decoration:none;padding:9px 4px;border-radius:9px;font-size:14px;font-weight:bold;color:#555}
.segtabs a.on{background:#fff;color:#000;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.quick{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
.quick .btn{min-height:54px}
.sec{display:flex;justify-content:space-between;align-items:baseline;margin:18px 0 8px}
.sec h2{margin:0}.sec a{font-size:14px;color:#555;white-space:nowrap}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.tiles .stat{padding:10px}.tiles .stat .n{font-size:21px}
.visit{padding:12px 14px}
.visit .when{font-weight:bold}
.visit .acts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.visit .acts .btn{min-height:44px;font-size:15px}
.visit.today{background:#fffdf3}
.badge.today{background:var(--gold);color:#000}
.badge.overdue{background:#fde2e0;color:#8a1c1c}
.nextstep{border:2px solid var(--gold-d);background:#fffdf3;padding:12px}
.nextstep .lbl{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#7a5c00;font-weight:bold;margin-bottom:6px}
.nextstep .btn{margin:0;min-height:56px;font-size:17px}
.nextstep .sub{margin-top:6px}
.nextstep .doneline{font-weight:bold;color:var(--green);font-size:17px}
.jumpbar{position:sticky;top:calc(55px + env(safe-area-inset-top));z-index:15;background:var(--bg);margin:0 -12px 10px;padding:6px 12px;min-width:0}
.jumpbar .chips{margin:0}
.jumpbar .chip{min-height:38px;padding:7px 13px;font-size:14px;display:inline-flex;align-items:center;text-decoration:none}
.menu-h{font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--mut);margin:18px 2px 6px}
@media(min-width:900px){
  body.app{padding-bottom:24px;padding-left:220px}
  nav.bn{top:0;right:auto;width:220px;height:auto;display:flex;flex-direction:column;align-items:stretch;gap:2px;padding:12px 10px;border-top:0;border-right:1px solid var(--line);box-shadow:none;background:var(--ink)}
  nav.bn .brand{display:flex;flex-direction:row;justify-content:flex-start;gap:10px;color:#fff;font-weight:bold;font-size:15px;padding:6px 8px 16px;border-bottom:3px solid var(--gold);margin-bottom:10px}
  nav.bn .brand img{width:38px;height:38px;border-radius:50%;background:#fff}
  nav.bn a{flex-direction:row;justify-content:flex-start;gap:12px;font-size:15px;padding:11px 12px;border-radius:10px;color:#ddd}
  nav.bn a:hover{background:#333}
  nav.bn a.on{background:var(--gold);color:#000}
  nav.bn a.on svg{stroke:#000}
  nav.bn a.on::before{display:none}
  .top .logo{display:none}
  .sticky-save{bottom:6px}
}
/* v8 time clock */
.timecard.on{border:2px solid #2e9d5b;background:#f3fbf6}
ul.clocked li{display:flex;align-items:center;gap:10px;padding:8px 0}
ul.clocked .dot{width:10px;height:10px;border-radius:50%;background:#2e9d5b;box-shadow:0 0 0 3px rgba(46,157,91,.2);flex:0 0 auto;animation:pulse 1.6s infinite}
@keyframes pulse{50%{box-shadow:0 0 0 6px rgba(46,157,91,.08)}}
ul.clocked .who,.qclock .who{flex:1;min-width:0;display:flex;flex-direction:column}
ul.clocked .who a,.qclock .who span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.timer{font-variant-numeric:tabular-nums;font-weight:bold;font-size:18px;min-width:76px;text-align:right}
.qclock{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line)}
.clockbtn{min-height:56px;font-size:17px}
.chip small{font-weight:normal}
/* v9 card processing fee disclosure */
.feebox{border:1px solid var(--gold-d);background:#fffaf0;border-radius:10px;padding:12px 14px}
.feehead{font-weight:bold;margin-bottom:8px;font-size:15px}
.feebox .kv dd{font-weight:normal}.feebox .kv b{font-weight:bold}
.cardform>div{margin:6px 0}
/* v10 change orders */
.coline{border:1px solid var(--line);border-radius:10px;padding:8px;margin:6px 0;background:#fff}
.colrow{display:grid;grid-template-columns:70px 1fr auto auto;gap:8px;align-items:end;margin-top:6px}
.colrow label{margin:0;font-size:12px;color:var(--mut)}.colrow .lt{font-weight:bold;font-size:14px;padding-bottom:12px;white-space:nowrap}
.colrow .co-del{min-height:44px}
.cototal{margin-top:12px;border-top:2px solid var(--gold);padding-top:8px}
.cototal>div:not(.muted){display:flex;justify-content:space-between;font-size:16px;padding:2px 0}
.badge.co-draft{background:#eee}.badge.co-sent{background:#fff1c2}.badge.co-viewed{background:#ffe08a}.badge.co-signed{background:#d9f2e2;color:#05603a}
.badge.co-declined{background:#ffd6d6;color:#8a1c1c}.badge.co-void{background:#ddd;color:#666;text-decoration:line-through}
.sigpad{position:relative;border:2px dashed var(--gold-d);border-radius:10px;background:#fff;height:160px;touch-action:none}
.sigpad canvas{width:100%;height:100%;display:block;touch-action:none;border-radius:8px}
.sighint{position:absolute;left:12px;bottom:10px;color:#aaa;pointer-events:none;font-size:14px}
/* v11 quick website request */
.quickwrap{max-width:520px}
.quickcard h1{font-size:24px}
.ordiv{display:flex;align-items:center;gap:10px;color:var(--mut);font-size:13px;margin:12px 0 6px}
.ordiv:before,.ordiv:after{content:"";flex:1;border-top:1px solid var(--line)}
.qcheck{width:56px;height:56px;border-radius:50%;background:var(--gold);color:#000;font-size:30px;font-weight:bold;line-height:56px;margin:0 auto}
.quickreq .acts .btn{min-height:46px}
/* v12: signed records + offsite backup */
.sigrec{margin-top:4px}
.sigrec-h{display:flex;justify-content:space-between;align-items:center;gap:8px}
.sigrec .kv{margin-top:6px}
.sigrec .hash{font:11px/1.35 ui-monospace,SFMono-Regular,Menlo,monospace;word-break:break-all;color:var(--muted,#667);margin-top:6px;background:rgba(0,0,0,.035);border-radius:8px;padding:6px 8px}
.sigrec .hash span{display:block;font:600 10px/1.4 system-ui,-apple-system,sans-serif;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667)}
.sigrec-old{border-top:1px solid rgba(0,0,0,.08);padding-top:8px;margin-top:8px}
.badge.ok{background:#e3f4e8;color:#1d6b37}.badge.bad{background:#fde8e6;color:#a3261b}
/* v12: estimate vs actual variance column */
.t.ev td.var{font-size:12px;white-space:nowrap}.t.ev td.var.over{color:#b42318}.t.ev td.var.under{color:#067647}
.t.ev th,.t.ev td{padding-left:4px;padding-right:4px}
.t.ev td.big{font-size:20px}.t.ev td .muted{font-size:12px}
/* v13: mileage */
.trips details.trip>summary{list-style:none;cursor:pointer}.trips details.trip>summary::-webkit-details-marker{display:none}
.trips .tripform{padding:4px 2px 0}.trips details.trip form{margin:6px 0}
.badge.auto{background:#eef2ff;color:#3538cd}.badge.manual{background:#f2f4f7;color:#344054}
.chip.warn{border-color:#f79009;color:#b54708}
.linkbtn{background:none;border:0;padding:0;color:inherit;text-decoration:underline;font:inherit;cursor:pointer}
/* v14: floor care guide */
.care .care-h{margin:4px 0 2px;font-size:26px}.care .care-who{margin-bottom:8px}
.care h2.gold{margin:18px 0 8px}
.care-tl{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.care-tl li{display:flex;gap:10px;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--line)}
.care-tl .what{font-weight:700;flex:1 1 50%}.care-tl .when{flex:1 1 50%;text-align:right}.care-tl .when b{display:block}.care-tl .when .muted{font-size:13px}
.care-tips{margin:0;padding-left:20px}.care-tips li{margin:0 0 8px}
.care-donts{display:flex;flex-wrap:wrap;gap:6px}.care-donts span{background:#fef3f2;color:#b42318;border-radius:999px;padding:5px 10px;font-size:14px}
.care-deep{background:#fff6d6;border-radius:12px;padding:14px 16px;margin-top:18px}.care-deep p{margin:0 0 8px}
.care-card .tl{margin:6px 0 0;padding:0;list-style:none;font-size:14px}.care-card .tl li{display:flex;justify-content:space-between;gap:8px;padding:3px 0}
/* v15 scan receipt */
.rc-files{display:flex;gap:8px;overflow-x:auto;margin:0 0 12px}
.rc-files a{flex:0 0 auto}.rc-files img{height:120px;border-radius:8px;border:1px solid var(--line);display:block}
.rc-pdf{display:flex;align-items:center;justify-content:center;width:90px;height:120px;border:1px solid var(--line);border-radius:8px;background:#fff;font-weight:bold}
.rc-line .segtabs{margin:10px 0 4px}.rc-line .segtabs label{text-align:center;padding:9px 4px;border-radius:9px;font-size:14px;font-weight:bold;color:#555;margin:0;cursor:pointer}
.rc-line .segtabs label.on{background:#fff;color:#000;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.rc-line.rc-skip{opacity:.6}.rc-line .rc-q{margin-bottom:6px}
.rc-line select{width:100%}
.tl-row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--line)}
/* v16 quick count */
.cg-btn{all:unset;display:block;width:100%;cursor:pointer;padding:4px 0}.cg-btn b{display:block;font-size:16px}.cg-btn .sub{display:block}
#count-groups .grp-sub{padding-left:26px}
.cnt-prog{height:6px;background:#e6e2d8;border-radius:3px;overflow:hidden;margin:0 0 10px}.cnt-prog div{height:100%;background:var(--gold)}
.cnt-card{padding:18px}.cnt-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.cnt-desc{font-size:22px;font-weight:bold;line-height:1.25}.cnt-id{color:#666;margin:6px 0 10px}
.cnt-exp{font-size:16px;margin-bottom:12px}
.cnt-input{display:grid;grid-template-columns:72px 1fr 72px;gap:10px;align-items:stretch}
.cnt-input input{font-size:40px;text-align:center;font-weight:bold;min-height:80px;padding:0}
.cnt-pm{font-size:34px;min-height:80px;padding:0}
.cnt-diff{text-align:center;min-height:24px;margin:8px 0;color:#666}.cnt-diff.up{color:#1d7a3a}.cnt-diff.down{color:#b3261e}
.cnt-update{min-height:72px;font-size:22px;margin-top:4px}
.cnt-nav{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.cnt-nav .btn{min-height:52px}
.cstats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.cstat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 8px;text-align:center}.cstat b{display:block;font-size:22px}.cstat span{color:#666;font-size:13px}

/* v17 inventory value */
.iv-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.iv-total{font-size:32px;font-weight:bold;line-height:1.15;margin:2px 0}
.iv-low{flex:0 0 auto;text-align:right;text-decoration:none;color:inherit;background:var(--warn);border:1px solid var(--gold);border-radius:10px;padding:8px 10px}
.iv-low b{display:block;font-size:18px}.iv-low span{font-size:12px;color:var(--mut)}
.iv-flags{margin-top:10px}.iv-flags details{margin-top:6px}
.iv-card summary{cursor:pointer;padding:6px 0}
.iv-cats{margin-top:8px;border-top:1px solid var(--line);padding-top:4px}.iv-cats>summary{font-weight:bold}
.iv-mini{list-style:none;margin:4px 0 0;padding:0}
.iv-mini li{border-bottom:1px solid var(--line);padding:7px 0;font-size:14px}.iv-mini li:last-child{border-bottom:0}
.iv-mini li>a{display:flex;justify-content:space-between;gap:8px;text-decoration:none;color:inherit}
.iv-mini li.iv-sum{display:flex;justify-content:space-between;font-weight:bold}
.tiles .iv-tile{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 10px}
.tiles .iv-tile .n{font-size:19px}.tiles .iv-tile .l:last-child:not(:first-child){flex-basis:100%}
.iv-foot{color:var(--mut);font-size:13px;margin:14px 2px 4px}.iv-foot b{font-weight:600;color:inherit}
.iv-foot .iv-note{font-size:12px;margin-top:2px}.iv-foot summary{cursor:pointer;font-size:12px;margin-top:4px}
.iv-foot .iv-mini li{font-size:12px;padding:4px 0}
.iv-foot summary{font-weight:normal;color:var(--mut);text-decoration:underline}

/* v18 UI review */
.remind{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:8px;padding:8px 10px;background:var(--warn);border:1px solid var(--gold-d);border-radius:10px;font-size:14px;font-weight:bold}
.remind .btn{flex:0 0 auto}
.remind .remind-btns{display:flex;flex-wrap:wrap;gap:6px}
.remind .remind-issue{display:block;font-weight:normal;color:var(--bad,#b3261e);margin-top:2px}
.remind.done{background:var(--ok-bg,#e8f5e9);border-color:#9ccc9c;color:#1e6b2e}
.phone-issue{margin-top:6px;padding:8px 10px;border:1px solid var(--gold-d);background:var(--warn);border-radius:10px;font-size:14px}
.list .row .acts,.visit .acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.list .row .acts .btn,.visit .acts .btn{flex:1 1 40%;min-height:44px;font-size:15px}
.list .row .acts .btn.primary{flex-basis:100%}
.acts>span:empty{display:none}
.only-w{display:none}
@media(min-width:700px){.only-m{display:none}.only-w{display:block}}
.costcards .row .main b{white-space:normal}
.costcards .row .sub{white-space:normal}
.costcards .right b{font-size:16px}
/* v20: job history (imported past invoices) */
.hist-note{font-size:14px;color:#444}
a.hist-review{display:block;text-decoration:none;color:inherit}
.yr-tabs a .muted{font-size:12px;margin-left:2px}
.yr-tabs a.on .muted{color:#ddd}
.hist-filter .fr{gap:8px}
.hist-filter label{margin-top:0}
.yr-h{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:16px 2px 6px;border-bottom:3px solid var(--gold);padding-bottom:4px;position:sticky;top:calc(55px + env(safe-area-inset-top));background:var(--bg);z-index:5}
.yr-h h2{margin:0}
.yr-h .muted{font-size:13px;text-align:right}
.badge.est{background:#fff;border:1px dashed #8a7a4a;color:#6b5a2a}
.est-card{border-style:dashed}
.est-c{font-size:12px}
.row .sub.wrap{white-space:normal;overflow:visible;text-overflow:clip}

/* v21: job folds + phone P&L */
details.fold{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:0;margin:18px 0 12px}
details.fold>summary{list-style:none;display:flex;align-items:center;gap:8px;padding:10px 14px;margin:0;min-height:48px;font-weight:normal;cursor:pointer}
details.fold>summary::-webkit-details-marker,details.fold>summary::marker{display:none}
details.fold>summary::before{content:'▸';color:var(--mut);flex:0 0 auto;font-size:14px}
details.fold[open]>summary::before{content:'▾'}
details.fold>summary h2{margin:0;flex:1;min-width:0;font-size:17px}
details.fold .fold-sum{color:var(--mut);font-size:13px;font-weight:normal;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52%}
details.fold .fold-body{padding:0 12px 12px}
details.fold .fold-body .card{margin-bottom:8px}
details.fold .fold-body .card:last-child{margin-bottom:0}

.pnl-cards{display:none}
.pnl-month{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0 0 8px;overflow:hidden}
.pnl-month .pnl-hd{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:6px}
.pnl-month .pnl-hd b{font-size:16px}
.pnl-month .kv{margin:0}
.pnl-month .kv dd span.muted{font-weight:normal;margin-left:4px}
.pnl-month.ytd{border-top:4px solid var(--gold)}
.pnl-month.empty{padding:10px 14px}
.pnl-month.empty .kv{margin-top:4px}
@media(max-width:699px){
  .pnl-table{display:none}
  .pnl-cards{display:block}
}
@media(min-width:700px){
  .pnl-cards{display:none}
  .pnl-table{display:block}
}
/* BW-9: edit proposal wording */
.wording .wblock{padding:12px}
.wording .whead{display:flex;align-items:center;gap:8px;justify-content:space-between;margin-bottom:6px}
.wording .wblock textarea{min-height:64px;line-height:1.4;font-size:16px;resize:vertical;overflow:hidden}
.wording .wblock.edited{border-left:4px solid #ffbf00}
.wording .wblock.stale{border-left:4px solid #f79009}
.wording .wbuilt{margin-top:8px}.wording .wbuilt summary{color:#6b4e00;cursor:pointer}
.wording .wbuilt p{margin:4px 0}
.wording .linkish{background:none;border:none;color:#6b4e00;text-decoration:underline;padding:4px 0;min-height:0}
.wording .wdefault{margin-top:8px;font-size:15px;min-height:44px;align-items:center}
.wording .wbadges{display:flex;gap:6px}
.wdef .tpl p{margin:4px 0}.wdef .ph{background:#fff4cc;border-radius:4px;padding:0 3px;font-family:ui-monospace,monospace;font-size:13px}
/* BW-13 planned materials (estimate) */
.plan-note{background:#f3f6fb;border:1px solid #d6e0ee;border-radius:10px;padding:8px 12px;font-size:14px;margin:0 0 10px;color:#333}
.badge.short{background:#fff1d6;color:#8a5a00}
.plan-list details.plan-line{width:100%}
.plan-list details.plan-line>summary{list-style:none;display:flex;gap:10px;justify-content:space-between;align-items:flex-start;padding:10px 12px;cursor:pointer;min-height:48px}
.plan-list details.plan-line>summary::-webkit-details-marker,.plan-list details.plan-line>summary::marker{display:none}
.plan-list details.plan-line>summary .main{flex:1;min-width:0}
.plan-list details.plan-line>summary .right{text-align:right;white-space:nowrap}
.plan-list details.plan-line[open]>summary{background:#fffbea}
.plan-list .plan-edit{padding:4px 12px 12px;border-top:1px dashed var(--line)}
.plan-list .plan-edit .btns{margin-top:8px}
.plan-list .plan-total{background:#fffbea;padding:12px}
.plan-list details.plan-line>summary{font-weight:normal}
.plan-list details.plan-line>summary .sub{font-weight:normal;color:#555;font-size:14px;white-space:normal}
.plan-list .plan-total .sub{white-space:normal;overflow:visible;text-overflow:clip}
/* BW-15 email-scanner link checks: shown faintly, never counted */
.timeline li.t-scan{opacity:.5}
.scan-note{font-size:13px;margin-top:8px}
/* BW-17 applicants */
.apnote{white-space:pre-wrap;line-height:1.45;font-size:15px}
.apstat{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.apstat .btn{flex:1 1 auto}
.badge.ap-New{background:var(--gold);color:#000}
.badge.ap-Contacted{background:#e3eefc;color:#1d4f91}
.badge.ap-Hired{background:#dff3e4;color:#1f6b35}
.badge.ap-Not-a-fit{background:#eee;color:#666}
input.filein{padding:10px;min-height:0;font-size:15px}
/* BW-18 sample sessions: purple so they never look like a site visit */
.badge.b-sample{background:#efe6fb;color:#5b2d91}
.list li.visit.sample{border-left:4px solid #8a5cc7}
/* BW-18b sample sign-off */
.signoff{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.signoff-h{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.so-start summary{display:inline-flex;list-style:none}
.so-start summary::-webkit-details-marker{display:none}
.so-kv dd{text-align:left;font-weight:bold}
.so-sig{display:flex;gap:10px;align-items:center;margin:8px 0}
.so-sig img{width:120px;height:auto;border:1px solid var(--line);border-radius:8px;background:#fff}
/* BW-20: card form (PayPal ACDC) + PayPal wallet buttons on the invoice */
.cardform .cards-ok{font-size:13px;margin:-4px 0 6px}
.paysep{display:flex;align-items:center;gap:10px;margin:16px 0 4px;color:var(--muted,#667);font-size:13px}
.paysep::before,.paysep::after{content:"";flex:1;border-top:1px solid #ddd}
.paysep[hidden]{display:none}
/* BW-21: Clients sort (A–Z by last name / Recent jobs) */
.sortbar{display:flex;align-items:center;gap:8px;margin:8px 0 2px;flex-wrap:wrap}
.sortbar .chip{text-decoration:none}
.list li.letter{background:none;border:0;padding:8px 6px 0;font-weight:bold;color:var(--gold-d,#a07800);font-size:13px;letter-spacing:.04em;min-height:0}
.lastjob{color:var(--ink,#222);font-weight:600}
/* BW-22: cash/check discount */
.cashdisc{border:2px solid var(--gold);border-radius:10px;padding:12px;margin:10px 0;background:#fffaf0}
.cashdisc .cd-head{font-weight:bold;font-size:1.05em;margin-bottom:6px}
.cashdisc .kv{margin:4px 0 6px}
.ptot tr.disc td{color:#1f7a3a}
label.cashdisc-opt{display:flex;gap:8px;align-items:flex-start;margin-top:10px;padding:10px;border:1px solid var(--gold);border-radius:8px;background:#fffaf0}
label.cashdisc-opt[hidden]{display:none}
/* BW-25: sample session waiting on a photo */
.sp-wait{margin-top:8px;padding:8px 10px;border-radius:8px;background:var(--warn);border:1px solid var(--gold);font-size:14px}
.sp-done{margin-top:8px;padding:8px 10px;border-radius:8px;background:#e3f4ea;border:1px solid #b7dfc4;font-size:14px}
.sp-form{margin-top:8px}
.sp-pick{position:relative;cursor:pointer}
.sp-pick.busy{opacity:.6;pointer-events:none}
.sp-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;left:0;top:0}
.sp-chosen{margin-top:4px;font-size:13px;color:#2e7d4f}
.sp-note{display:block;margin-top:8px;font-size:14px;font-weight:600}
.sp-note .req{font-weight:400;font-size:12px;color:var(--muted,#777);margin-left:4px}
.sp-note textarea{display:block;width:100%;margin-top:4px;font-weight:400}
.sp-save{margin-top:8px}
.sp-note-text{margin-top:4px;font-style:italic;white-space:pre-wrap}
.photos .ph.noted{aspect-ratio:auto;grid-column:span 2;background:#fff}.photos .ph.noted img{height:auto;aspect-ratio:1}
.ph-note{font-size:12px;line-height:1.3;padding:4px 2px;color:#333;word-break:break-word}
/* BW-26: purchase orders */
.po-top{display:grid;grid-template-columns:2fr 1fr;gap:8px;margin-bottom:10px}.po-top .btn{min-height:56px;display:flex;align-items:center;justify-content:center}
.po-list li.po{display:flex;align-items:center}.po-list li.po a.row{flex:1;min-width:0}
.po-list .po-recv{padding:0 12px 0 0;flex:0 0 auto}.po-list .po-recv label.check{margin:0;font-size:13px;flex-direction:column;gap:2px}
.po-line{position:relative}.po-lh{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.po-lh .po-del{min-height:32px;padding:4px 10px}
.po-pick{position:relative}.po-res{max-height:280px;overflow:auto;border:1px solid var(--line);border-radius:10px;margin-top:6px;background:#fff;display:none}
.po-res.show{display:block}.po-res .opt{padding:10px 12px;border-bottom:1px solid var(--line);cursor:pointer}
.po-res .opt b{display:block;font-size:14px}.po-res .opt span{font-size:13px;color:var(--mut)}.po-res .po-optnew{background:#fffbea}
.po-info{font-size:13px;margin-top:4px}.po-line.po-has .po-q{font-weight:600}
.po-newitem{margin-top:6px}.po-lt{text-align:right;margin-top:6px;font-size:14px}.po-note{margin-top:6px}
.po-total{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;margin:10px 0 12px;background:#fff;border:1px solid var(--line);border-radius:12px;font-size:16px}
.po-recvbox.received{border-color:#7cc194;background:#eef8f1}.po-recvbox.partial{border-color:#e0b04a;background:#fff6df}.po-recv-main{font-size:18px}.po-recv-main input{width:24px;height:24px}
.ni-dlg{border:0;border-radius:14px;padding:16px;width:min(94vw,440px);max-height:90vh;overflow:auto}.ni-dlg::backdrop{background:rgba(0,0,0,.45)}
.po-line.po-has .po-newitem{display:none}
/* BW-26b: partial receiving, shipping / tax */
.b-partial{background:#ffe2b0}
.po-rcv{margin-top:8px}.po-rcv-in{display:flex;align-items:center;gap:8px}.po-rcv-in input{flex:0 0 96px;width:96px}.po-rcv-in .po-all{min-height:36px}
.po-rstate{font-size:12px;margin-top:2px}
.po-line.po-full{border-left:4px solid #7cc194}.po-line.po-some{border-left:4px solid #e0b04a}
.po-totals .tl-row b{font-size:16px}.po-grand{border-bottom:0!important;font-size:18px}.po-grand b{font-size:19px!important}
.po-alloc label.check{font-size:14px;margin-top:6px}
.po-status{font-weight:700;font-size:15px;margin-bottom:6px}
.po-list li.po.partial{background:#fffaf0}
/* BW-26c: Today "items on order" row */
.onorder{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:-2px 0 12px;text-decoration:none;color:var(--ink);min-height:52px}
.onorder .ic{font-size:20px}.onorder .t{flex:1;display:flex;flex-direction:column}.onorder .t small{color:var(--mut);font-size:13px}.onorder .go{font-size:22px;color:var(--mut)}
/* BW-27: New leads, website requests in the holding area + the X (two taps: X, then Remove) */
.list.newleads li.nl{display:flex;align-items:stretch}.list.newleads li.nl a.row{flex:1;min-width:0;padding-right:4px}
.list.newleads li.web{background:#fffdf5}
.badge.b-web{background:#fff3cd;color:#7a5a00;font-size:11px}
.lx{display:flex;align-items:center;padding:0 8px 0 0;margin:0}
.lx-x{width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:#fff;color:#888;font-size:22px;line-height:1;padding:0;cursor:pointer}
.lx-yes{display:none;border:0;border-radius:18px;background:#c0392b;color:#fff;font-weight:600;font-size:14px;padding:9px 14px;cursor:pointer}
.lx.arm .lx-x{display:none}.lx.arm .lx-yes{display:inline-block}
.nl-foot{margin:6px 2px 0;font-size:13px}
.undo-toast{position:fixed;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:60;display:flex;align-items:center;gap:10px;
  background:#1f1f1f;color:#fff;border-radius:12px;padding:10px 12px;box-shadow:0 6px 20px rgba(0,0,0,.25);max-width:520px;margin:0 auto}
.undo-toast span{flex:1;font-size:14px}.undo-toast .btn{background:#e8b923;color:#111;border:0}
.undo-toast.gone{display:none}
.wl-card dl{display:grid;grid-template-columns:110px 1fr;gap:6px 10px;margin:0}.wl-card dt{color:#777}.wl-card dd{margin:0;word-break:break-word}
.wl-acts{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.list.newleads li.web .sub,#dismissed-web .sub,#dismissed-jobs .sub{white-space:normal;overflow:visible;text-overflow:clip}
/* BW-28: one consistent "‹ Back to X" link, top-left under the header */
.crumb{display:inline-flex;align-items:center;gap:2px;margin:0 0 10px -2px;padding:6px 10px 6px 6px;border-radius:16px;
  color:var(--gold-d,#8a6a00);font-weight:600;font-size:15px;text-decoration:none;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.crumb:active{background:rgba(232,185,35,.15)}
/* BW-29: companies with contacts and properties */
.companytoggle{background:#faf6e8;border:1px solid #eadfb6;border-radius:10px;padding:10px 12px;margin:0 0 6px}
.ctrow{border:1px solid #e6e6e6;border-radius:10px;padding:4px 12px 10px;margin:10px 0;background:#fcfcfc}
.ctfoot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px}
.ctfoot .btn{min-height:40px;padding:6px 12px;font-size:14px}
.copick{border-top:1px dashed #ddd;margin-top:10px;padding-top:4px}
.newsite{background:#faf6e8;border-radius:10px;padding:2px 10px 10px;margin-top:8px}
.list .row .main .sub a{color:inherit}
#contacts~.list .row .main b,#properties~.list .row .main b{white-space:normal}
#contacts~.list .row .sub,#properties~.list .row .sub,.list .sub.ct{white-space:normal}
.list .row .acts form.inline{display:contents}
.list .row .acts form.inline .btn{flex:1 1 40%;min-height:44px;font-size:15px}
.cobadge{background:#f2ead0;color:#6b5300}
.attn{font-size:14px;color:var(--mut)}
/* t201u: intake form business / billing address (revealed when Company has text) */
.cobill{margin:6px 0 4px;padding:10px 12px;border-left:3px solid var(--gold,#c9a227);background:rgba(201,162,39,.06);border-radius:8px}
.cobill[hidden],#billfields[hidden]{display:none}
/* t204u: company contacts on the Clients list */
.ctlist .co-of{color:var(--ink);font-weight:600}
.colinks{margin:-4px 0 8px 14px;font-size:14px}
.colinks a{color:var(--ink);font-weight:600}
li.ct-on>.row,li:target>.row{box-shadow:inset 4px 0 0 var(--gold);background:#fffaf0}
li[id^="ct-"]{scroll-margin-top:90px}

/* BW-32: tentative work on the schedule + work-day picker */
.badge.tent{background:#fff;color:#8a5a00;border:1px dashed #c9a227;font-weight:700}
.badge.firm{background:#1e7e34;color:#fff}
.tent-row{opacity:.92}
.tent-row .row, .tent-row.visit{border:1px dashed var(--gold-d);background:#fffdf5;border-radius:12px}
.wd-picker{margin-top:10px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.wd-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:8px;flex-wrap:wrap}
.wd-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.wd-month{font-weight:700;text-align:center;flex:1}
.wd-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.wd-dow{display:contents}
.wd-dow span{font-size:11px;color:var(--mut);text-align:center;padding:2px 0}
.wd-day{display:flex;align-items:center;justify-content:center;min-height:40px;border-radius:10px;border:1px solid transparent;margin:0;padding:0;position:relative}
.wd-day input{position:absolute;opacity:0;width:1px;height:1px}
.wd-day .n{display:block;width:100%;text-align:center;padding:8px 0;border-radius:10px;font-weight:600}
.wd-day.on .n{background:var(--gold);color:#000}
.wd-day.out .n{color:#bbb}
.wd-day.wknd .n{color:#999}
.wd-day.out.on .n,.wd-day.wknd.on .n{color:#000}
.wd-day:has(input:focus-visible) .n{outline:2px solid var(--ink)}
.wd-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.wd-list .check{margin:4px 0}

.dates-dd{text-align:right;max-width:64%;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px}
.dates-dd .dates-lab{display:inline;text-align:right}
.dates-dd .badge{white-space:nowrap}

/* ===== BW-34 field-friendly sizing, search, badges, week strip, swipe, dark mode ===== */
.btn.sm{min-height:44px}
.chip{min-height:44px}
.jumpbar .chip{min-height:44px;padding:8px 14px}
.top a.icon.add{min-height:44px;min-width:44px;padding:8px 10px}
.top a.icon.search-ico{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;color:var(--gold);border:1px solid var(--gold);border-radius:10px;margin-left:auto}
.top a.icon.search-ico.on{background:var(--gold);color:#1f1f1f}
.top .t{flex:1;min-width:0}
nav.bn a{position:relative;min-height:48px}
.tab-badge{position:absolute;top:4px;right:calc(50% - 22px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--gold);color:#000;font-size:10px;font-weight:800;line-height:18px;text-align:center}
.today-search{margin:0 0 12px}
.today-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.today-acts .btn, .today-acts form{flex:1 1 30%;min-width:96px}
.today-acts form .btn{width:100%}
.omw-sheet{margin-top:8px}
.sticky-save{background:var(--bg);padding:8px 2px 10px;box-shadow:0 -10px 16px var(--bg)}

/* week strip */
h2[id^="d-"]{scroll-margin-top:calc(52px + env(safe-area-inset-top) + 230px)}
.week-strip{position:sticky;top:calc(52px + env(safe-area-inset-top));z-index:8;background:var(--bg);padding:8px 0 10px;margin:0 0 8px;box-shadow:0 8px 10px var(--bg)}
.week-nav{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.week-nav .week-arr{flex:0 0 44px;min-width:44px;font-size:22px}
.week-label{flex:1;text-align:center;font-weight:700}
.week-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.wd{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;min-height:64px;padding:6px 2px 4px;border-radius:12px;border:1px solid var(--line);background:var(--card);text-decoration:none;color:var(--ink)}
.wd-dow{font-size:11px;color:var(--mut);font-weight:600}
.wd-num{font-size:18px;font-weight:800;line-height:1.1}
.wd-marks{display:flex;gap:3px;min-height:8px}
.wd-dot{width:7px;height:7px;border-radius:50%;background:#5b8def}
.wd-dot.sample{background:#9b59b6}
.wd.today{outline:2px solid var(--gold-d);outline-offset:0}
.wd-firm{background:#e8f6ec;border-color:#1e7e34}
.wd-tent{background:#fffdf5;border:1px dashed var(--gold-d)}
.wd-mixed{background:linear-gradient(180deg,#e8f6ec 50%,#fffdf5 50%);border-color:#1e7e34}
.wd-appt{background:#eef4ff;border-color:#5b8def}
.wd-free{background:var(--card)}
.week-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;font-size:12px}
.wd-key{display:inline-block;width:12px;height:12px;border-radius:3px;border:1px solid var(--line);vertical-align:middle;margin-right:2px}
.wd-key.firm{background:#e8f6ec;border-color:#1e7e34}
.wd-key.tent{background:#fffdf5;border:1px dashed var(--gold-d)}
.wd-key.appt{background:#eef4ff;border-color:#5b8def}

/* swipe actions */
.swipe-row{position:relative;overflow:hidden}
.swipe-row > .row{position:relative;z-index:1;background:var(--card);transition:transform .2s ease}
.swipe-row.open > .row{transform:translateX(-168px)}
.swipe-actions{position:absolute;right:0;top:0;bottom:0;display:flex;z-index:0}
.swipe-actions a, .swipe-sheet a{display:flex;align-items:center;justify-content:center;min-width:56px;padding:0 10px;color:#fff;text-decoration:none;font-size:12px;font-weight:700;text-align:center}
.swipe-actions a.call, .swipe-sheet a.call{background:#1e7e34}
.swipe-actions a.maps, .swipe-sheet a.maps{background:#2c6bed}
.swipe-actions a.open, .swipe-sheet a.open{background:#444}
.swipe-more{position:absolute;z-index:2;right:4px;top:8px;min-width:44px;min-height:44px;border:0;background:transparent;color:var(--mut);font-size:20px;font-weight:700;cursor:pointer}
.swipe-sheet{position:absolute;z-index:80;right:8px;top:44px;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.18);display:flex;flex-direction:column;min-width:160px;overflow:hidden}
.swipe-sheet a{min-height:44px;color:var(--ink);background:transparent;justify-content:flex-start;gap:8px;padding:0 14px;border-bottom:1px solid var(--line)}
.swipe-sheet a:last-child{border-bottom:0}
.swipe-sheet a.call{color:#1e7e34;background:transparent}
.swipe-sheet a.maps{color:#2c6bed;background:transparent}

.theme-picks{display:flex;gap:8px}
.theme-picks .chip{flex:1;text-align:center;position:relative}
.theme-picks .chip input{position:absolute;opacity:0;width:1px;height:1px;margin:0;overflow:hidden;pointer-events:none}

/* Dark mode — owner app only (html.theme-*). Client/portal pages stay light. */
html.theme-dark, html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#f3efe6; --mut:#b4aea0; --line:#3d3933; --bg:#161513; --card:#23211c;
  --warn:#3d3114; --red:#ff8f80; --green:#6dce86; --gold:#FFC107; --gold-d:#e6b000;
}
@media (prefers-color-scheme: dark){
  html.theme-auto, html[data-theme="auto"]{
    color-scheme:dark;
    --ink:#f3efe6; --mut:#b4aea0; --line:#3d3933; --bg:#161513; --card:#23211c;
    --warn:#3d3114; --red:#ff8f80; --green:#6dce86; --gold:#FFC107; --gold-d:#e6b000;
  }
}
html.theme-light, html[data-theme="light"]{ color-scheme:light; }


/* Applied when the boot script detects dark (forced Dark, or Auto + iPhone dark). Never on client portal pages. */
html.scheme-dark body{background:var(--bg);color:var(--ink)}
html.scheme-dark .card,
html.scheme-dark .list,
html.scheme-dark .stat,
html.scheme-dark .login,
html.scheme-dark details.fold,
html.scheme-dark .copyblk pre,
html.scheme-dark .sigpad{background:var(--card);border-color:var(--line)}
html.scheme-dark .btn,
html.scheme-dark input, html.scheme-dark select, html.scheme-dark textarea,
html.scheme-dark .chip,
html.scheme-dark .check,
html.scheme-dark .qtyrow button{background:var(--card);color:var(--ink);border-color:#5a554c}
html.scheme-dark .btn.primary{background:var(--gold);border-color:var(--gold-d);color:#1f1f1f}
html.scheme-dark .btn.dark{background:#0e0d0c;border-color:#0e0d0c;color:#f3efe6}
html.scheme-dark .btn.danger{color:#ffb4aa;border-color:#8a4a44}
html.scheme-dark .chip.on, html.scheme-dark .chip:active,
html.scheme-dark .chip.radio:has(input:checked){background:var(--gold);border-color:var(--gold-d);color:#1f1f1f}
html.scheme-dark nav.bn{background:#1c1b18;border-top-color:var(--line);box-shadow:0 -2px 10px rgba(0,0,0,.4)}
html.scheme-dark nav.bn a{color:#c9c3b6}
html.scheme-dark nav.bn a.on{color:#fff}
html.scheme-dark .top{background:#0e0d0c;color:#fff}
html.scheme-dark .flash{background:#2a2824;color:var(--ink);border-color:var(--line)}
html.scheme-dark .flash.ok{background:#16351f;color:#b8f0c6}
html.scheme-dark .flash.err{background:#3a1c18;color:#ffc4bc}
html.scheme-dark .notice, html.scheme-dark .notice.warn, html.scheme-dark .waiting.w-you,
html.scheme-dark .stat.alert, html.scheme-dark .nextstep, html.scheme-dark .feebox,
html.scheme-dark .pstatus, html.scheme-dark .remind, html.scheme-dark .picked{background:var(--warn);border-color:var(--gold-d);color:var(--ink)}
html.scheme-dark .waiting.w-client{background:#1e2a3a;border-color:#3d5a80;color:var(--ink)}
html.scheme-dark .muted, html.scheme-dark .sub, html.scheme-dark .week-label,
html.scheme-dark table.t th{color:var(--mut)}
html.scheme-dark .list a.row, html.scheme-dark .list .row{color:var(--ink)}
html.scheme-dark .list li{border-color:var(--line)}
html.scheme-dark .list .letter{background:#2a2722;color:var(--mut)}
html.scheme-dark .step{background:#2a2722;border-color:var(--line);color:var(--ink)}
html.scheme-dark .step.on{background:var(--warn);border-color:var(--gold-d)}
html.scheme-dark .timeline{border-left-color:var(--gold)}
html.scheme-dark a{color:#ffd24a}
html.scheme-dark .row a, html.scheme-dark a.row, html.scheme-dark a.stat, html.scheme-dark a.card{color:var(--ink)}
html.scheme-dark .badge{color:#1f1f1f}
html.scheme-dark .badge.tent{background:#2b2410;color:#ffd56a;border-color:#c9a227}
html.scheme-dark .badge.firm{background:#1e7e34;color:#fff}
html.scheme-dark .badge.warn{background:#5a2424;color:#ffc4bc}
html.scheme-dark .tent-row .row, html.scheme-dark .tent-row.visit{background:#2b2410;border-color:#c9a227;color:var(--ink)}
html.scheme-dark .wd-firm{background:#16351f;border-color:#6dce86;color:var(--ink)}
html.scheme-dark .wd-tent{background:#2b2410;border-color:#c9a227;color:var(--ink)}
html.scheme-dark .wd-mixed{background:linear-gradient(180deg,#16351f 50%,#2b2410 50%);border-color:#6dce86;color:var(--ink)}
html.scheme-dark .wd-appt{background:#1a2436;border-color:#7aa2ff;color:var(--ink)}
html.scheme-dark .wd-free{background:var(--card);color:var(--ink)}
html.scheme-dark .wd-key.firm{background:#16351f;border-color:#6dce86}
html.scheme-dark .wd-key.tent{background:#2b2410;border-color:#c9a227}
html.scheme-dark .wd-key.appt{background:#1a2436;border-color:#7aa2ff}
html.scheme-dark .swipe-row > .row{background:var(--card)}
html.scheme-dark .swipe-sheet{background:var(--card);border-color:var(--line);box-shadow:0 8px 24px rgba(0,0,0,.5)}
html.scheme-dark .swipe-sheet a{color:var(--ink);border-color:var(--line)}
html.scheme-dark .tabs a, html.scheme-dark .sortbar .chip{background:var(--card);color:var(--ink);border-color:var(--line)}
html.scheme-dark .tabs a.on, html.scheme-dark .sortbar .chip.on{background:var(--gold);color:#1f1f1f}
html.scheme-dark .menu-h{color:var(--mut)}
html.scheme-dark .kv dt{color:var(--mut)}
html.scheme-dark .big, html.scheme-dark .pos{color:var(--green)}
html.scheme-dark .neg{color:#ff8f80}
html.scheme-dark .crumb{color:var(--gold)}
html.scheme-dark .onorder{background:var(--card);border-color:var(--line);color:var(--ink)}
html.scheme-dark .timecard{background:var(--card);border-color:var(--line)}
html.scheme-dark .timecard.on{background:#16351f}
html.scheme-dark .sp-wait{background:var(--warn);color:var(--ink)}
html.scheme-dark table.t td, html.scheme-dark table.t th{border-color:var(--line)}
html.scheme-dark hr{border-top-color:var(--line)}
html.scheme-dark .copyblk pre{background:#1c1b18;color:var(--ink)}
html.scheme-dark .linkbox{background:#1c1b18;color:var(--ink);border-color:var(--line)}
html.scheme-dark details summary{color:var(--ink)}
html.scheme-dark .plan-note, html.scheme-dark .fold-body{color:var(--ink)}
html.scheme-dark .fold-sum{color:var(--mut)}
html.scheme-dark .visit.today, html.scheme-dark li.today{background:var(--warn)}
html.scheme-dark .card.gold{border-top-color:var(--gold)}
html.scheme-dark .pipecard{color:var(--ink)}
html.scheme-dark .undo-toast{background:#2a2722;color:var(--ink);border-color:var(--line)}
html.scheme-dark .lx-x, html.scheme-dark .lx-yes{color:var(--ink)}
html.scheme-dark .cnt-prog{background:#3d3933}
html.scheme-dark .ownerbar{background:#0e0d0c}
html.scheme-dark .sticky-save{background:var(--bg);box-shadow:0 -10px 16px var(--bg)}
html.scheme-dark .search input{background:var(--card)}
/* contrast on status badges that used light tints */
html.scheme-dark .badge.b-Open, html.scheme-dark .badge.b-Quoted, html.scheme-dark .badge.st{color:#1f1f1f}
html.scheme-dark .badge.inv-Paid, html.scheme-dark .badge.ok, html.scheme-dark .badge.b-done{background:#1e7e34;color:#fff}
html.scheme-dark .badge.inv-Sent, html.scheme-dark .badge.inv-Viewed, html.scheme-dark .badge.inv-Partially-paid{background:var(--gold);color:#1f1f1f}
html.scheme-dark .badge.inv-Draft{background:#3d3933;color:var(--ink)}

html.scheme-dark label{color:var(--ink)}
html.scheme-dark .rc-line .segtabs label{color:var(--ink)}

.swipe-sheet a.open{color:var(--ink);background:transparent}
html.scheme-dark .swipe-sheet a.open{color:var(--ink);background:transparent}

html.scheme-dark .segtabs{background:#2a2722}
html.scheme-dark .segtabs a{color:var(--ink)}
html.scheme-dark .segtabs a.on{background:var(--card);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.4)}

/* BW-35: jump-to-date, still-on-this-job, unclipped prepare */
.week-jump{display:flex;align-items:center;gap:8px;margin-top:8px}
.week-jump label{margin:0;flex:0 0 auto;font-size:13px}
.week-jump input[type=date]{flex:1;min-width:0;min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink);font-size:16px}
.week-jump .btn{flex:0 0 auto;min-height:44px}
.work-cont .row{min-height:48px;padding-top:8px;padding-bottom:8px}
.work-cont b{font-size:15px}
.work-cont .sub{white-space:normal;overflow:visible;text-overflow:unset}
.lead-prepare{background:var(--card);padding:0 12px 10px;position:relative;z-index:1}
.lead-prepare .btn{display:flex;align-items:center;justify-content:center;width:100%;white-space:normal;text-align:center;line-height:1.2}
html.scheme-dark .week-jump input[type=date]{background:var(--card);color:var(--ink);border-color:var(--line);color-scheme:dark}
html.scheme-dark .lead-prepare{background:var(--card)}

/* The tab bar must stay at the bottom of the *visible* screen on iPhone. iOS Safari
   mis-places position:fixed;bottom:0 when its own toolbar hides on scroll, so the bar
   can appear in the middle of the page. On small screens the owner app is a column:
   the header and tab bar stay put, and only main scrolls. Desktop (≥900px) is unchanged. */
@media (max-width: 899px) {
  html:has(body.app), body.app{
    height:100%;
    height:100dvh;
    max-height:100dvh;
    overflow:hidden;
  }
  body.app{display:flex;flex-direction:column;padding-bottom:0}
  body.app > .demo-banner, body.app > .top{flex:0 0 auto}
  body.app > .top{position:relative}
  /* min-width:0 so a wide child (chip row, nowrap button, filter tabs) cannot
     stretch this flex item past the viewport. Without it, main grows to the
     content width and html/body overflow:hidden clips the right edge. */
  body.app > main{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  body.app > nav.bn{position:relative;left:auto;right:auto;bottom:auto;flex:0 0 auto;width:100%;z-index:30}
  /* header is outside the scrollport now, so in-page stickies sit at the top of main */
  body.app .week-strip,
  body.app .jumpbar,
  body.app .yr-h{top:0}
  body.app .sticky-save{bottom:6px}
  body.app h2[id^="d-"]{scroll-margin-top:230px}
}
