/* Build 134: compact estimate / invoice workspace, centred pop-up messages. Loaded last on purpose. */
#message{margin:0;border:0;overflow:visible;color:#fff;top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:max-content;max-width:min(92vw,480px);text-align:center;font-size:19px;font-weight:600;line-height:1.35;padding:20px 28px;border-radius:14px;box-shadow:0 12px 48px rgba(0,0,0,.38);z-index:1000;cursor:pointer}

main:has(#estimate) h1{font-size:23px;margin:0;line-height:1.2}
main:has(#estimate) header{margin:0 0 8px;padding:0 0 4px;border:0;gap:10px}
main:has(#estimate) header small{font-size:13px}
.docwho{font-size:20px;font-weight:800;color:#17231D;line-height:1.2;margin:1px 0 2px}
main:has(#estimate) .document-actions{margin:0 0 8px;padding:6px 8px;gap:8px;border-radius:10px}
main:has(#estimate) .document-actions button{min-height:34px;padding:4px 14px;font-size:15px}
main:has(#estimate) .panel{padding:10px 14px;margin:0 0 8px;border-radius:12px}
main:has(#estimate) .panel h2{font-size:16px;margin:0 0 4px}
main:has(#estimate) label{margin:3px 0;font-size:13px;font-weight:600}
main:has(#estimate) input,main:has(#estimate) select,main:has(#estimate) textarea{min-height:34px;padding:5px 9px;font-size:15px;border-width:1px;border-radius:7px}
main:has(#estimate) input[type=checkbox]{min-height:0}
main:has(#estimate) textarea{min-height:46px}
main:has(#estimate) .grid{gap:6px 12px;margin:4px 0}
main:has(#estimate) .grid.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
main:has(#estimate) p{margin:4px 0}
main:has(#estimate) hr{margin:8px 0}
.custrow{display:flex;gap:10px;align-items:flex-end}
.custpick{position:relative;flex:1;max-width:560px}
.custrow .newcust{margin:0 0 3px;white-space:nowrap}

#documentActivity{padding:6px 12px!important}
#documentActivity .decision-banner{padding:4px 8px;gap:4px 18px;font-size:14px;align-items:center;border-radius:8px}
#documentActivity .decision-banner b{font-size:15px}
#documentActivity .timeline-summary{margin:4px 0;font-size:13px}
.act-tools{display:flex;gap:12px;align-items:flex-start;font-size:13px}
.act-tools details{flex:1;min-width:0}.act-tools summary{cursor:pointer}
.act-tools button.small{min-height:28px;padding:2px 10px;font-size:13px;white-space:nowrap}
#documentActivity .timeline li{padding:4px 0}

main:has(#estimate) .line-editor{padding:8px 10px;gap:6px;border-radius:10px;margin:6px 0}
main:has(#estimate) .line-editor textarea{min-height:38px}
main:has(#estimate) .line-editor .linemini input{min-height:32px;font-size:14px;padding:4px 8px}
main:has(#estimate) .line-editor .linefoot{gap:4px 14px}
main:has(#estimate) .line-editor .linefoot button{min-height:30px;padding:2px 12px}
main:has(#estimate) .split{gap:12px;grid-template-columns:minmax(0,1fr) 270px}
main:has(#estimate) .actions{gap:6px;margin:4px 0}
main:has(#estimate) .actions button,main:has(#estimate) .toolbar button{min-height:32px;padding:3px 12px;font-size:14px}
main:has(#estimate) .toolbar{margin:6px 0}
main:has(#estimate) small{font-size:12px}
main:has(#estimate) .amount{font-size:24px}
main:has(#estimate) #quoteTotal{margin:8px 0!important}
main:has(#estimate) .summary .grid{margin-top:8px!important}
.savebar{padding:8px 12px;margin-top:6px;gap:8px}
.savebar button{min-height:36px;padding:4px 18px;font-size:15px}
@media(max-width:1050px){main:has(#estimate) .grid.g4{grid-template-columns:repeat(2,minmax(0,1fr))}main:has(#estimate) .split{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){main:has(#estimate) .grid.g4{grid-template-columns:1fr}.custrow{flex-wrap:wrap}.act-tools{flex-wrap:wrap}}
.provrow{border:1px solid var(--line,#dce5e0);border-radius:10px;margin:0 0 10px;padding:6px 12px}
.provrow legend{font-weight:700;padding:0 6px}.provrow legend label{display:flex;gap:8px;align-items:center;margin:0}.provrow legend input{width:auto;min-height:0}

/* Build 135: side panel styled like the desktop app */
.workpanel{padding:14px 16px;border-radius:16px}
.wp-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}
.wp-pills{display:flex;flex-wrap:wrap;gap:8px}
button.pill{border:1px solid #cfd8d2;background:#f4f7f5;color:#17301f;border-radius:999px;min-height:38px;padding:0 16px;font-weight:600;font-size:15px;cursor:pointer}
button.pill:hover{background:#e8efeb}
button.pill.dark{background:#1f4d2e;border-color:#1f4d2e;color:#fff}
button.pill.dark:hover{background:#173d24}
button.pill.reject{background:#fdecec;border-color:#f3c4c4;color:#a32020}
button.pill.small{min-height:30px;padding:0 12px;font-size:13px}
.wp-minor{margin:8px 0 0;font-size:13px;color:#5b6b61}
button.linkbtn{border:0;background:none;color:#1f4d2e;text-decoration:underline;padding:0;min-height:0;font-size:13px;cursor:pointer}
.wp-balance{display:flex;justify-content:space-between;align-items:baseline;margin:14px 0 4px;font-size:15px}
.wp-balance b{font-size:20px}
.wp-check{margin-top:10px;padding:10px 12px;border:1px solid #dfe6e2;border-radius:12px;background:#fafcfb}
.wp-check h3{margin:0 0 6px;font-size:15px}
.wp-check ul{list-style:none;margin:0;padding:0;display:grid;gap:4px;font-size:14px}
.wp-check li.ok span{color:#1f7a3a;font-weight:700}
.wp-check li.todo{color:#6b6b6b}
.wp-note{margin:12px 0 0;font-size:12px;color:#6b7a70}

/* Build 135 */
.backbar{margin:0 0 8px}
button.backbtn{border:1px solid #cfd8d2;background:#fff;border-radius:999px;min-height:34px;padding:0 14px;font-weight:600;cursor:pointer}
button.backbtn:hover{background:#eef3f0}
.op-colorrow{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:6px 0}
.op-colorrow input[type=color]{width:64px;height:40px;padding:2px;border-radius:8px;cursor:pointer}
.op-event .wolink{font-size:12px}
.ctypes{border:1px solid #dfe6e2;border-radius:12px;padding:10px 12px;margin:12px 0}
.ctypes legend{font-weight:600;padding:0 6px}
.ctypegrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:4px 12px}
label.ctype{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:400}
label.ctype input{width:auto;min-height:0}

/* Build 137: search bar between the brand and + Create */
.gsearch{position:relative;flex:1;max-width:560px;min-width:180px;margin:0 auto}
.gsearch input{width:100%;min-height:40px;border-radius:999px;border:1px solid #cfd8d2;background:#fff;padding:0 16px;font-size:15px}
.gsres{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:60;background:#fff;border:1px solid #dce5e0;border-radius:14px;box-shadow:0 12px 36px rgba(16,36,27,.18);max-height:70vh;overflow:auto;padding:6px}
.gsres[hidden]{display:none}
.gsgroup h3{margin:8px 10px 2px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#65756f}
.gsitem{display:flex;flex-direction:column;align-items:flex-start;width:100%;border:0;background:none;text-align:left;padding:8px 10px;border-radius:10px;cursor:pointer;min-height:0}
.gsitem:hover,.gsitem:focus{background:#eef3f0}
.gsitem small{color:#65756f;font-size:13px}
.gsempty{margin:10px;color:#65756f}
@media(max-width:700px){.gsearch{order:5;flex-basis:100%;max-width:none}}

/* Build 138: install button + dialog */
button.installbtn{border:1px solid #1f4d2e;background:#fff;color:#1f4d2e;border-radius:999px;min-height:38px;padding:0 14px;font-weight:600;cursor:pointer}
button.installbtn:hover{background:#eef3f0}
button.installbtn[hidden]{display:none}
dialog.installdlg{max-width:min(560px,94vw);max-height:90vh;overflow:auto}
dialog.installdlg h3{margin:14px 0 4px;font-size:16px}
dialog.installdlg ol{margin:4px 0 0;padding-left:22px;line-height:1.5}
dialog.installdlg details{margin:12px 0}
dialog.installdlg .selectable{user-select:all;word-break:break-all}
/* Build 139: feedback */
button.feedbackbtn{background:none;border:0;cursor:pointer;font:inherit}
.feedbackdlg label{display:block;margin:10px 0;font-weight:600}
.feedbackdlg select,.feedbackdlg textarea{display:block;width:100%;margin-top:4px;font:inherit;box-sizing:border-box}
/* Build 140 */
main.auth{margin:8vh auto;max-width:460px;width:calc(100% - 32px);text-align:center}
main.auth form{text-align:left}
main.auth .brand{justify-content:center}
main.auth #signin>button,main.auth #signin>.actions{margin:6px 4px 0 0}
main.auth details#signupName{margin:10px 0}
.deskrow .tabgroup .tabmenu{left:auto;right:0}
.deskrow>.tabgroup{margin:0 2px}
.op-reqfilter{display:inline-flex;gap:8px;align-items:center;margin:8px 0;font-weight:600}
.op-soonnote{background:#fff7e0;border:1px solid #ecd9a0;border-radius:10px;padding:10px 14px}
.op-event[draggable=true]{cursor:grab}
/* Build 141: field photos */
.fieldbar{display:grid;gap:8px}.fielderr{color:#a3342a;font-weight:600}
.camerabtn{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 22px;border:1px solid #1f4d2e;border-radius:14px;font-weight:700;font-size:18px;cursor:pointer;background:#fff;color:#1f4d2e}
.camerabtn.primary{background:#1f4d2e;color:#fff}
.fieldgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:12px}
.fieldph{margin:0;border:1px solid #dce5e0;border-radius:12px;overflow:hidden;background:#fff}.fieldph img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.fieldph figcaption{padding:8px;font-size:14px}.fieldph.pending{border-color:#d9a400}.fieldph.failed{border-color:#a3342a}.fieldph.uploaded{border-color:#1f7a45}
/* Build 142: company logo directly above the company name, as wide as the name */
.deskwho{align-items:flex-end}
.deskwho .whobrand{display:flex;flex-direction:column;align-items:stretch;max-width:260px}
.deskwho .wholog{display:block;width:0;min-width:100%}
.deskwho .wholog:empty{display:none}
.deskwho .whologimg{display:block;width:100%;height:auto;max-height:96px;max-width:none;object-fit:contain;object-position:right center;margin:0 0 2px}
.deskwho .whoname{text-align:right}
@media(max-width:800px){.deskwho .whologimg{max-height:52px}}

/* Build 142: list search/date controls, sortable column headers */
.toolbar{flex-wrap:wrap;gap:8px;align-items:flex-end}
.toolbar #search{flex:1 1 280px;min-width:200px}
.toolbar .datebox{display:flex;flex-direction:column;font-size:11px;color:var(--muted,#5b655f);gap:2px}
.toolbar .datebox input{min-height:36px}
.toolbar.exportbar{margin-top:-4px}
th.sortable{cursor:pointer;user-select:none;white-space:nowrap}
th.sortable:hover{text-decoration:underline}
th.sortable .arrow{font-size:10px;color:var(--brand,#1f6b45)}
.toolbar select,.toolbar .datebox input{width:auto;min-width:0;flex:0 0 auto;max-width:170px}
.toolbar select{max-width:150px}
.toolbar #search{flex:1 1 220px;max-width:none;width:auto}
.toolbar .datebox{flex:0 0 auto}
.operations th.sortable{cursor:pointer;user-select:none;white-space:nowrap}.operations th.sortable:hover{text-decoration:underline}.operations th .arrow{font-size:10px;color:var(--brand,#1f6b45)}
.colpick{margin:0 0 8px;font-size:13px}.colpick summary{cursor:pointer;display:inline-block;padding:6px 12px;border:1px solid var(--line,#d6dbd7);border-radius:999px;background:#fff}
.colpick>div{display:flex;flex-wrap:wrap;gap:6px 16px;padding:8px 4px}.colpick label{display:flex;align-items:center;gap:6px}
/* Build 144: create-account link opens a new window; beta notes */
a.btnlink{display:inline-flex;align-items:center;min-height:46px;padding:0 16px;margin:6px 4px 0 0;border:1px solid var(--line);border-radius:9px;background:#fff;color:#253650;font-weight:550;text-decoration:none}
a.btnlink:hover{background:#edf3ee}
main.auth .betanote{font-size:14px;color:#5f4300;background:#fff4d6;border:1px solid #e2bd5a;border-radius:10px;padding:8px 12px;margin:14px 0 0;text-align:left}
/* company backup */
.bk-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}
.bk-points{margin:.4rem 0 1rem 1.2rem}.bk-status{min-height:1.4em;margin:.6rem 0;font-weight:600}
.bk-ok{border-left:4px solid #2e7d32}.bk-bad{border-left:4px solid #b3261e}.bk-warn{border-left:4px solid #b26a00}
.bk-table{border-collapse:collapse;width:100%;margin-top:.6rem}.bk-table th,.bk-table td{padding:4px 8px;border-bottom:1px solid #d9ddd5;text-align:left}
/* income over time */
.ic-funnel{display:flex;gap:6px;align-items:stretch;flex-wrap:wrap;margin:8px 0 18px}.ic-card{flex:1 1 180px;border:1px solid #d9ddd5;border-top:4px solid #2e8b5e;border-radius:6px;padding:12px 14px;background:#fff;display:flex;flex-direction:column;gap:4px}
.ic-card.warn{border-top-color:#e0a230}.ic-card b{font-size:1.5rem}.ic-badge{align-self:flex-start;border-radius:10px;padding:1px 8px;font-size:.78rem;background:#e3f2e8;color:#1f6b45}.ic-badge.warn{background:#fdecc8;color:#8a5a00}.ic-arrow{align-self:center;font-size:1.6rem;color:#7b857e}
.ic-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:flex-start}.ic-head h3{margin:0 0 4px}.ic-total b{font-size:1.7rem}.ic-ctl{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.ic-toggle{display:flex;gap:6px;align-items:center}
.ic-svg{width:100%;height:auto;max-height:300px}.ic-grid{stroke:#e3e6df;stroke-width:1}.ic-axis{font-size:11px;fill:#6b756e}.ic-line{stroke:#5aa832;stroke-width:2.2}.ic-prev{stroke:#9aa39d;stroke-width:1.6;stroke-dasharray:5 4}.ic-dot{fill:#5aa832}
.ic-legend{font-size:.85rem}.ic-key{display:inline-block;width:18px;height:3px;background:#5aa832;vertical-align:middle;margin:0 4px 0 10px}.ic-key.prev{background:#9aa39d}
