/* v1.82 design polish: one form system, page chrome, and legible type.
   Loaded last so it wins over earlier inline stages. */

:root{--ctl-h:40px;--ctl-r:10px;--ink:#1d1d1f;--ink2:#6e6e73;--line2:#d2d2d7}

html,body{font-size:14px!important;line-height:1.45}
body,button,input,select,textarea{font-size:14px}

/* Nothing smaller than 12px. Body copy stays 14. */
.muted,.cnt,.pill,.sp2,.kl,.ks,.sub,.hint,.crumb,.pal .hint,.pal .t,.pal .s,
th,label,.f2,footer,.navsec2,.side2 .n,.qpill,.kbd,.kage,.ktot,.empty,
.listbar .links,.nshown,small,.tip2,.fuph,.fchip{font-size:12px!important}
.pal .t{text-transform:none!important;letter-spacing:0!important;min-width:72px;font-weight:600}
.pal li a{font-size:14px;padding:10px 12px}
.pal .s{font-size:12px!important}

h1,.ph2 h1,.rec-title{font-size:28px!important;font-weight:600!important;letter-spacing:-.4px;line-height:1.2;text-transform:none!important;color:var(--ink)}
.card>h2,.card h2,.card>h3,.card h3,h2,h3,
.dw2>div:first-child h2,.dg2 .card>h2,.kp2 h2,.ph2~.card>h2,.sec h3,.cf h3{
  font-size:17px!important;font-weight:600!important;line-height:1.3;
  text-transform:none!important;letter-spacing:-.2px!important;color:var(--ink)!important}
th{font-size:12px!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important;color:#6e6e73!important;background:transparent}

/* ---- forms: 40px, white, 1px #d2d2d7, 10px radius ---- */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=hidden]):not(.nm):not(.kbtn):not(.kbtn2),
select:not([multiple]),
textarea{
  height:40px!important;min-height:40px!important;box-sizing:border-box;
  background:#fff!important;background-color:#fff!important;
  border:1px solid #d2d2d7!important;border-radius:10px!important;
  color:#1d1d1f!important;font-size:14px!important;font-weight:400!important;
  padding:0 12px!important;margin:0;box-shadow:none;line-height:38px}
textarea{height:auto!important;min-height:88px!important;padding:10px 12px!important;line-height:1.4!important}
textarea.ebdesc,.ev2 #lines textarea.ebdesc{min-height:32px!important;max-height:72px;height:auto!important;padding:4px 8px!important;line-height:1.35!important;resize:vertical}
input[list]{border-radius:10px!important;background:#fff!important;border:1px solid #d2d2d7!important;color:#1d1d1f!important;height:40px!important}
select:not([multiple]){
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236e6e73' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;background-position:right 12px center!important;
  background-color:#fff!important;padding:0 32px 0 12px!important;width:auto;max-width:100%}
select:not([multiple]):disabled{opacity:.6}
input:focus,select:focus,textarea:focus{outline:0;border-color:#0071e3!important;box-shadow:0 0 0 3px rgba(0,113,227,.15)!important}
input[type=color]{width:40px;height:40px!important;padding:4px!important;border-radius:10px!important;border:1px solid #d2d2d7!important;background:#fff!important}
.stsel{height:40px!important;border-radius:10px!important;font-size:14px!important;font-weight:500!important;padding:0 32px 0 12px!important}

/* table status menus stay readable but still on the same control system */
table select:not([multiple]),.lv2 table.lt td select{height:40px!important;min-height:40px!important;font-size:14px!important;font-weight:500!important}

/* checkbox / radio labels stay on one row and never cover the next field */
.grid2,.fgrid,.frow,.sf,.setw .card form{align-items:start}
.grid2>*,.fgrid>*,.frow>*{min-width:0}
:is(label,.grid2 label,.fgrid label,.frow label,.sf label):has(>input[type=checkbox]),
:is(label,.grid2 label,.fgrid label,.frow label,.sf label):has(>input[type=radio]){
  display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
  align-items:center!important;gap:8px!important;min-height:40px;height:auto!important;
  white-space:normal!important;min-width:0}
:is(label)>input[type=checkbox],:is(label)>input[type=radio]{
  width:18px!important;height:18px!important;min-height:0!important;flex:none;margin:0!important;padding:0!important}
.grid2 label:has(>select)>select,.fgrid label:has(>select)>select,.frow label:has(>select)>select,
:is(label.muted,.fgrid label,.grid2 label,.frow label):has(>select)>select{width:100%!important}

/* date stand-in already used by the shell script */
.dp2{height:40px;border:1px solid #d2d2d7;border-radius:10px;background:#fff;font-size:14px}
.dp2.ph{color:#86868b;font-weight:400}

/* ---- settings nav (shared by every settings section) ---- */
.setw{display:grid!important;grid-template-columns:220px minmax(0,1fr)!important;gap:18px!important;align-items:start;min-width:0}
.setnav{position:sticky;top:72px;padding:8px!important;display:flex;flex-direction:column;gap:2px;min-width:0}
.setnav a{display:block!important;padding:8px 12px!important;border-radius:10px!important;color:#1d1d1f!important;text-decoration:none!important;font-size:14px!important;font-weight:500;white-space:nowrap;line-height:1.3}
.setnav a:hover{background:#f5f5f7;text-decoration:none}
.setnav a.on{background:#e8f1fc!important;color:#0071e3!important;font-weight:600!important}
.setw .card,.sf,.card.sf{max-width:none}
.setw>.card.setnav{max-width:none}
@media(max-width:860px){
  .setw{grid-template-columns:minmax(0,1fr)!important}
  .setnav{position:static;flex-direction:row;flex-wrap:wrap;overflow:visible}
  .setnav a{white-space:nowrap}
}

/* ---- page chrome ---- */
.ph2{align-items:flex-end}
.ph2 .acts{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ph2 .acts .seg2{order:1}
.ph2 .acts .btn.pri,.ph2 .acts a.btn.pri,.ph2 .acts a.pri,.ph2 .acts button.pri{order:2}
.tabs,.subtabs,.lv2 .tabs,.ctabs{
  display:flex;gap:4px;align-items:stretch;border-bottom:1px solid #e5e5ea;
  margin:0 0 14px;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.tabs::-webkit-scrollbar,.subtabs::-webkit-scrollbar,.lv2 .tabs::-webkit-scrollbar,.ctabs::-webkit-scrollbar{display:none;height:0}
.tabs>a,.subtabs>a,.lv2 .tabs a,.ctabs a,.lv2 .subtabs a{
  display:inline-flex;align-items:center;gap:6px;padding:10px 12px!important;margin:0 0 -1px;
  border:0;border-bottom:2px solid transparent;border-radius:0!important;background:none!important;
  color:#6e6e73!important;font-size:14px!important;font-weight:500;text-decoration:none;white-space:nowrap}
.tabs>a.on,.subtabs>a.on,.lv2 .tabs a.on,.ctabs a.on,.lv2 .subtabs a.on{
  color:#1d1d1f!important;border-bottom-color:#0071e3!important;font-weight:600;background:none!important}
.cnt{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:#efeff4;color:#3a3a3c;font-weight:600;line-height:1}
.tabs a.on .cnt,.lv2 .tabs a.on .cnt,.ctabs a.on .cnt{background:#0071e3;color:#fff}
.lv2 .subtabs a{border:0!important;border-bottom:2px solid transparent!important;border-radius:0!important;background:none!important}

/* sidebar counts: one badge style, user pinned to the bottom */
.side2{overflow:hidden}
.navscroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px}
.side2 .n,.navscroll .n{
  margin-left:auto;font-size:12px!important;font-weight:600;color:#3a3a3c!important;
  background:#efeff4;border-radius:999px;min-width:20px;height:20px;padding:0 6px;
  display:inline-flex;align-items:center;justify-content:center}
.side2 a.on .n{background:#0071e3;color:#fff!important}
.foot2{margin-top:0;flex:none}
.qpill{font-size:12px!important;padding:6px 12px}
.qpill.warn{background:#fff4e0;color:#b25e00}
.qpill.warn:before{background:#ff9f0a}
@media(max-width:900px){.qpill{display:inline-flex!important}}

/* search + new menu */
dialog.pal{width:min(680px,94vw)!important;max-width:94vw}
.newmenu .umenu-pop a{display:flex;align-items:center;gap:10px;font-size:14px;padding:10px 14px;color:#1d1d1f}
.newmenu .umenu-pop a i,.newmenu .umenu-pop a svg{width:16px;height:16px;color:#6e6e73;flex:none}
.nsep{height:1px;background:#f0f0f2;margin:4px 8px}
.note-pop{position:absolute;right:0;top:42px;width:min(320px,86vw);background:#fff;border:1px solid #e5e5ea;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.14);padding:12px 14px;z-index:40;color:#1d1d1f}
.note-pop h2{margin:0 0 6px;font-size:17px!important;text-transform:none!important;letter-spacing:0!important;color:#1d1d1f!important}
.note-pop p{margin:0 0 10px;font-size:14px;color:#6e6e73}
.top2 .notemenu{position:relative}
.top2 .notemenu>summary{list-style:none}
.top2 .notemenu>summary::-webkit-details-marker{display:none}

/* boards fill the row; empty columns say so */
.kanban,.view-cards .kanban{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;width:100%;overflow:visible;align-items:stretch}
.kcol{flex:1 1 0!important;min-width:0;width:auto;min-height:160px}
.kcol:not(:has(.kcard)) .kempty,.kempty{color:#86868b;font-size:13px;text-align:center;padding:18px 8px}
.khead{text-transform:none!important;font-size:14px}

/* empty states */
.empty{text-align:center;padding:36px 16px;color:#6e6e73}
.empty b{display:block;color:#1d1d1f;font-size:17px;font-weight:600;margin-bottom:4px}
.empty .acts{margin-top:14px;display:flex;gap:8px;justify-content:center}
tr.empty-row td{text-align:center;padding:28px 12px!important;color:#6e6e73;background:#fff!important}

/* catalog item tabs */
.citabs{display:flex;gap:4px;border-bottom:1px solid #e5e5ea;margin:4px 0 16px;overflow-x:auto;scrollbar-width:none}
.citabs::-webkit-scrollbar{display:none}
.citabs a{padding:10px 12px;border-bottom:2px solid transparent;margin-bottom:-1px;color:#6e6e73;font-weight:500;text-decoration:none;white-space:nowrap;font-size:14px}
.citabs a.on{color:#1d1d1f;border-bottom-color:#0071e3;font-weight:600}
.cpanel{display:none}
.cpanel.on{display:block}

/* PO scope table: headers sit on the inputs */
table#lines{table-layout:fixed;width:100%}
table#lines th,table#lines td{vertical-align:middle;overflow:hidden}
table#lines input{width:100%!important;max-width:100%;min-width:0}
table#lines td.r,table#lines th.r{text-align:right}
table#lines td.r input{text-align:right}

/* group row actions appear on hover */
.grow{position:relative}
tr:hover .grow>summary,tr:focus-within .grow>summary,.grow[open]>summary{opacity:1}
.grow>summary{opacity:0}
@media(hover:none){.grow>summary{opacity:1}}

/* footer sits under the page, not mid-flow */
body.shell{min-height:100vh}
body.shell main{min-height:calc(100vh - 160px)}
footer{font-size:12px!important;padding:20px 16px 28px;color:#86868b}

/* activity rows ellipsize instead of slicing mid-word */
.dact td:nth-child(2){max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dact{table-layout:fixed;width:100%}

/* dashboard cards share one height rhythm */
.dash{align-items:stretch}
.dash>.card{display:flex;flex-direction:column;min-height:240px}

form.addrow{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end}
form.addrow>label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#6e6e73;min-width:140px;flex:1}
form.addrow>label input,form.addrow>label select{width:100%}
.grow>summary{cursor:pointer;border:0;background:transparent;font-size:18px;line-height:1;padding:4px 8px}
button.danger{background:#ff3b30!important;color:#fff!important;border-color:#ff3b30!important}

@media(max-width:900px){
  h1,.ph2 h1,.rec-title{font-size:24px!important}
  .kanban{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
}

/* ---- skipped-audit presentation (display only) ---- */
.kcard{min-height:118px;box-sizing:border-box}
.ph2 .acts .btn,.ph2 .acts a.btn,.ph2 .acts button{min-height:40px;height:40px;display:inline-flex;align-items:center}

/* estimates toolbar sits on one band instead of stacked micro-rows */
.etools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-bottom:8px}
.etools .listbar,.etools .fbar2{flex:1 1 420px;margin:0!important}
.etools .subtabs{border-bottom:0;margin:0}
.epill,.ep-draft{color:#1d1d1f!important}
.ep-draft{background:#e8e8ed!important}
select[name=status]{text-transform:capitalize}

/* jobs filters: three equal selects */
#fg-jt.fgrid{grid-template-columns:repeat(3,minmax(160px,1fr))}
#fg-jt.fgrid select{width:100%!important}
@media(max-width:700px){#fg-jt.fgrid{grid-template-columns:1fr}}

/* job header */
.jh h1{gap:8px!important}
.jh .meta{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0}
.jh .meta>span:not(:last-child)::after{content:"·";margin:0 6px;color:#c7c7cc}
a.fname{display:inline-block;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
#tab-attachments form:not(.dropz){display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}
#tab-attachments h3{margin:16px 0 8px}

/* dashboard reorder */
.dlist{list-style:none;margin:10px 0;padding:0;max-width:440px}
.dlist li{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #e5e5ea;border-radius:10px;margin:0 0 6px;background:#fff;cursor:grab}
.dlist li.drag{opacity:.45}
.dlist li label{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;margin:0;flex:1;min-height:0!important;height:auto!important}

/* contacts */
table.ctquiet a{color:#1d1d1f;font-weight:600;text-decoration:none}
table.ctquiet a:hover{color:#0071e3}
.hubscroll{max-height:520px;overflow:auto}
#t-sites .sitefoot{display:flex;justify-content:flex-start;margin-top:0}

/* settings cards, list editor, scan table */
.setw>.card{max-width:760px!important}
.setw>.card.setnav{max-width:none!important}
.le input.le-dot:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not(.nm){width:22px!important;height:22px!important;min-height:22px!important;max-height:22px!important;padding:0!important;border-radius:50%!important;border:1px solid #d2d2d7!important}
.le .le-in{text-transform:capitalize}
.le .le-h{color:#3a3a3c!important;font-weight:700;font-size:16px!important}
.le .le-add{flex-wrap:wrap}
.le .le-btn{flex:none;min-width:72px!important;height:40px!important;padding:0 14px!important}
table.fit{width:auto;min-width:280px}

/* estimate editor: layout and type only */
.ev2-act .btn,.ev2-act button,.ev2-act a.btn{height:40px!important;min-height:40px!important;font-size:14px!important;padding:0 14px!important}
.spill{font-size:13px!important;padding:5px 12px!important}
.ev2-sub{font-size:14px!important;color:#3a3a3c!important}
.mpill.n{background:#efeff4!important;color:#6e6e73!important}
#totcard.bare .mbar2 div{background:#efeff4!important}
#totcard.bare #ebmg{color:#6e6e73!important}
.eb>div>.card:first-child{display:flex!important;flex-wrap:wrap!important;align-items:center;gap:8px!important}
.eb>div>.card:first-child>div:first-child{flex:1 1 100%;min-width:240px}
.eb>div>.card:first-child>form{flex:1 1 260px;display:flex!important;flex-wrap:wrap;align-items:center;gap:6px}
@media(min-width:1100px){.eb>div>.card:first-child>div:first-child{flex:1 1 320px}}
.ev2 #lines .ebsec th.r,.ev2 #lines .ebsec td.r{text-align:right}
.ev2 #lines .ebsec td:last-child{width:78px!important;min-width:78px;white-space:nowrap!important}
.ev2 #lines .ebsec td:last-child form{display:inline!important}
.ev2 #lines .ebsec td:last-child button{display:inline-flex!important;vertical-align:middle;margin:0 2px!important}
#travel .warn,.ev2 .warn{color:#b25e00!important;background:#fff4e0;border-radius:10px;padding:8px 10px;font-weight:500!important;font-size:14px!important}
#travel input::placeholder{color:#86868b;font-size:14px}
#travel .tvr3>label,#travel .tvrow>label{min-width:0}
#travel .tvr3 input,#travel .tvrow input{width:100%}
#pay button[name=preset]{text-transform:capitalize}
#p-notes textarea{min-height:160px!important;max-height:280px!important}
.ev2-panel>.card.muted{text-align:center;padding:28px 16px;color:#6e6e73;font-size:14px}
#ev2side .card,#totcard{padding:16px 18px}
#ev2side .card>h2,#totcard>h2,.tc2>h2,#terms h2{font-size:17px!important;font-weight:600!important;text-transform:none!important;letter-spacing:-.2px!important;color:#1d1d1f!important}
#totcard .row{font-size:14px!important;color:#1d1d1f}
#totcard .row .lb,#totcard #ebcost{color:#3a3a3c!important}
#p-history .card{padding:16px 18px}
#nfgo:disabled{opacity:1!important;background:#e5e5ea!important;color:#86868b!important;border-color:#e5e5ea!important;cursor:not-allowed;box-shadow:none!important}
.card.nfempty{background:transparent!important;border:0!important;box-shadow:none!important;padding:4px 2px 0!important;text-align:left!important;color:#6e6e73!important}
.card.nfempty i,.card.nfempty .ti{display:none!important}
#nf .btn.pri,#nf .btn.secondary{height:40px;font-size:14px}
