/* Staff portal — app shell that lives inside the site. Big targets, one job per screen. */
#portal{position:fixed;inset:0;z-index:120;background:var(--steel-950);display:flex;flex-direction:column;font-size:17px}
#portal[hidden]{display:none}
.p-head{flex:none;padding:calc(env(safe-area-inset-top,0px) + 10px) var(--gutter-r) 10px var(--gutter-l);display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--steel-700);background:var(--steel-900)}
.p-head .brand-name{font-size:22px}
.p-head .who{font-size:14px;color:var(--steel-300);line-height:1.2;text-align:right}
.p-icon{width:46px;height:46px;border-radius:var(--radius);border:1px solid var(--steel-600);background:none;display:grid;place-items:center;cursor:pointer;flex:none}
.p-icon svg{width:22px;height:22px;stroke:var(--chalk);fill:none;stroke-width:2}
.p-main{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:18px var(--gutter-r) 28px var(--gutter-l)}
.p-inner{max-width:760px;margin:0 auto;display:grid;gap:16px}
.p-tabs{flex:none;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;border-top:1px solid var(--steel-700);background:var(--steel-900);padding:0 env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.p-tab{background:none;border:0;min-height:64px;display:grid;place-items:center;gap:2px;padding:8px 4px;cursor:pointer;color:var(--steel-400);font-size:13px;font-weight:600;position:relative}
.p-tab svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2}
.p-tab[aria-current=page]{color:var(--chalk)}
.p-tab[aria-current=page]::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;background:var(--primer)}
.p-tab .dot{position:absolute;top:8px;left:calc(50% + 8px);min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--primer);color:#fff;font-size:12px;display:grid;place-items:center}
.p-title{display:flex;justify-content:space-between;align-items:end;gap:12px}
.p-title h2{font-size:40px;text-transform:uppercase}
.p-sub{color:var(--steel-400);font-size:15px}
.seg{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}
.seg button{flex:none;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--steel-600);background:none;cursor:pointer;font-size:15px;color:var(--steel-300)}
.seg button[aria-pressed=true]{background:var(--chalk);color:var(--steel-950);border-color:var(--chalk);font-weight:600}
.list{display:grid;gap:10px}
.row{display:grid;grid-template-columns:1fr auto;gap:6px 14px;align-items:center;text-align:left;width:100%;padding:16px;border-radius:var(--radius);border:1px solid var(--steel-700);background:var(--steel-850);cursor:pointer}
.row:hover{border-color:var(--steel-400)}
.row .t{font-weight:700;font-size:18px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .s{grid-column:1/-1;color:var(--steel-300);font-size:15px;line-height:1.35;min-width:0}
.row .m{font-family:var(--f-mono);font-size:12px;color:var(--steel-400)}
.job-report-row .m{font-size:15px;font-weight:700;color:var(--chalk)}
.job-report-row .t{white-space:normal;overflow-wrap:anywhere}
.job-report-day{display:grid;gap:6px}
.job-report-day h4{margin:4px 0 0;display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.pill{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border-radius:999px;font-size:13px;font-weight:700;letter-spacing:.02em;white-space:nowrap}
.pill::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}
.st-new{background:rgba(183,28,28,.18);color:#ff9a72}
.st-contacted,.st-interview{background:rgba(166,220,255,.12);color:var(--arc)}
.st-quoting{background:rgba(232,187,79,.14);color:var(--warn)}
.st-won,.st-hired{background:rgba(98,196,135,.15);color:var(--ok)}
.st-lost,.st-pass{background:rgba(125,138,150,.16);color:var(--steel-300)}
.panel{border:1px solid var(--steel-700);background:var(--steel-850);border-radius:var(--radius);padding:18px;display:grid;gap:12px}
.panel h3{font-size:26px;text-transform:uppercase}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:16px}
.kv dt{font-family:var(--f-mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--steel-400);padding-top:3px}
.kv dd{margin:0;min-width:0;word-break:break-word}
.actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}
.actions .btn{min-height:54px;font-size:19px}
.empty{padding:34px 18px;text-align:center;border:1px dashed var(--steel-600);border-radius:var(--radius);color:var(--steel-300)}
.empty b{display:block;color:var(--chalk);font-size:19px;margin-bottom:6px}
/* clock */
.clock{display:grid;gap:16px;justify-items:center;text-align:center;padding:26px 18px;border-radius:var(--radius);border:1px solid var(--steel-700);background:radial-gradient(80% 80% at 50% 0%,rgba(183,28,28,.14),transparent),var(--steel-850)}
.clock-time{font-family:var(--f-display);font-weight:900;font-size:76px;line-height:1;font-variant-numeric:tabular-nums}
.clock-btn{width:min(320px,100%);min-height:96px;border-radius:14px;border:0;font-family:var(--f-display);font-weight:900;font-size:36px;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;color:#fff}
.clock-btn.in{background:var(--ok);color:#0b1a10}
.clock-btn.out{background:var(--bad)}
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.stat{padding:14px 16px;border:1px solid var(--steel-700);border-radius:var(--radius);background:var(--steel-850)}
.stat .n{font-family:var(--f-display);font-weight:900;font-size:38px;line-height:1;font-variant-numeric:tabular-nums}
.stat .l{font-size:14px;color:var(--steel-400);margin-top:4px}
.table-wrap{overflow-x:auto;border:1px solid var(--steel-700);border-radius:var(--radius)}
table.hrs{width:100%;border-collapse:collapse;font-size:15px;font-variant-numeric:tabular-nums;min-width:560px}
table.hrs th,table.hrs td{padding:10px 12px;border-bottom:1px solid var(--steel-700);text-align:right}
table.hrs th:first-child,table.hrs td:first-child{text-align:left}
table.hrs thead th{font-family:var(--f-mono);font-size:12px;letter-spacing:.06em;color:var(--steel-400);background:var(--steel-900)}
table.hrs tfoot td{font-weight:700}
.bar{height:10px;border-radius:5px;background:var(--steel-700);overflow:hidden}
.bar i{display:block;height:100%;background:var(--primer)}
/* onboarding steps */
.step{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:16px;border:1px solid var(--steel-700);border-radius:var(--radius);background:var(--steel-850);cursor:pointer;width:100%;text-align:left}
.step .num{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-family:var(--f-display);font-weight:900;font-size:20px;border:2px solid var(--steel-500)}
.step.done .num{background:var(--ok);border-color:var(--ok);color:#0b1a10}
.step .t{font-weight:700;font-size:18px}
.step .s{font-size:14px;color:var(--steel-400)}
.doc{display:grid;grid-template-columns:64px 1fr auto;gap:12px;align-items:center;padding:10px;border:1px solid var(--steel-700);border-radius:var(--radius)}
.doc .thumb{width:64px;height:48px;border-radius:4px;background:var(--steel-700) center/cover;display:grid;place-items:center;font-size:11px;color:var(--steel-400)}
.exp-soon{color:var(--warn)}.exp-past{color:var(--bad)}
/* sheet */
.sheet-bg{position:fixed;inset:0;z-index:140;background:rgba(5,7,9,.7);display:flex;align-items:flex-end;justify-content:center}
.sheet{width:min(720px,100%);max-height:92%;overflow-y:auto;background:var(--steel-900);border:1px solid var(--steel-600);border-bottom:0;border-radius:16px 16px 0 0;padding:20px var(--gutter-r) calc(24px + env(safe-area-inset-bottom,0px)) var(--gutter-l);display:grid;gap:16px}
.sheet-top{display:flex;justify-content:space-between;align-items:start;gap:12px}
.sheet-top h3{font-size:32px;text-transform:uppercase}
.big-msg{padding:16px;border-radius:var(--radius);background:var(--steel-850);border:1px solid var(--steel-600);font-size:16px;white-space:pre-wrap;user-select:all}
.pin-big{font-family:var(--f-mono);font-size:44px;letter-spacing:.2em;text-align:center;padding:10px;border:2px dashed var(--primer);border-radius:var(--radius)}
/* login */
.login{max-width:440px;margin:0 auto;display:grid;gap:18px;padding-top:4vh}
.login h2{font-size:52px;text-transform:uppercase}
.pinpad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pinpad button{min-height:66px;border-radius:12px;border:1px solid var(--steel-600);background:var(--steel-850);font-family:var(--f-display);font-weight:800;font-size:30px;cursor:pointer}
.pinpad button:active{background:var(--steel-700)}
.pin-dots{display:flex;gap:14px;justify-content:center;min-height:24px}
.pin-dots i{width:18px;height:18px;border-radius:50%;border:2px solid var(--steel-400)}
.pin-dots i.on{background:var(--chalk);border-color:var(--chalk)}
.demo-note{font-size:14px;color:var(--warn);border:1px solid rgba(232,187,79,.4);border-radius:var(--radius);padding:10px 12px;background:rgba(232,187,79,.07)}
.ios-steps{display:grid;gap:10px;counter-reset:s}
.ios-steps li{list-style:none;display:grid;grid-template-columns:36px 1fr;gap:12px;align-items:center;font-size:17px}
.ios-steps li::before{counter-increment:s;content:counter(s);width:36px;height:36px;border-radius:50%;background:var(--primer);display:grid;place-items:center;font-weight:800;color:#fff}
.ios-steps svg{width:22px;height:22px;vertical-align:-5px;stroke:var(--arc);fill:none;stroke-width:2}

.p-brand{display:flex;align-items:center;gap:10px}.p-brand img{height:32px;width:auto;display:block}

/* ---------- v2: jobs, reports, photos, chat, groups ---------- */
.sheet.wide{width:min(860px,100%)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:520px){.row2{grid-template-columns:1fr}}
.back-link{display:inline-flex;align-items:center;gap:6px;justify-self:start;background:none;border:0;color:var(--steel-300);font-size:16px;font-weight:600;cursor:pointer;padding:6px 0;min-height:44px}
.back-link svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.4}
.group-head{display:flex;justify-content:space-between;align-items:center;padding:10px 2px 0;font-family:var(--f-mono);font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--steel-400)}
.st-role{background:rgba(125,138,150,.14);color:var(--steel-300)}
.st-role::before{display:none}
.score{display:inline-flex;align-items:baseline;gap:1px;font-family:var(--f-display);font-weight:900;font-size:26px;line-height:1;padding:4px 10px;border-radius:8px;font-variant-numeric:tabular-nums}
.score small{font-family:var(--f-body);font-weight:600;font-size:12px;opacity:.75}
.score.hi{background:rgba(98,196,135,.16);color:var(--ok)}
.score.mid{background:rgba(232,187,79,.14);color:var(--warn)}
.score.lo{background:rgba(125,138,150,.16);color:var(--steel-300)}
.qr-box{display:grid;place-items:center;padding:16px;background:#fff;border-radius:var(--radius);justify-self:center}
.qr-box img{display:block}
.sched{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--steel-700);border-radius:var(--radius);background:var(--steel-900)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{padding:6px 12px;border-radius:999px;border:1px solid var(--steel-600);font-size:15px}
.tbtns{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.tile-btn{display:grid;gap:4px;justify-items:start;text-align:left;padding:16px;min-height:104px;border-radius:12px;border:1px solid var(--steel-600);background:var(--steel-850);cursor:pointer;color:var(--chalk)}
.tile-btn svg{width:26px;height:26px;stroke:currentColor;fill:none;stroke-width:2}
.tile-btn span{font-weight:800;font-size:19px}
.tile-btn small{font-size:13px;color:var(--steel-400)}
.tile-btn.primary{background:var(--primer);border-color:var(--primer)}
.tile-btn.primary small{color:rgba(255,255,255,.8)}
.job-card{background:radial-gradient(80% 80% at 100% 0%,rgba(183,28,28,.16),transparent),var(--steel-850)}
details.panel summary{cursor:pointer;font-weight:700;font-size:17px}
details.panel[open] summary{margin-bottom:10px}
/* daily report */
.set-all{display:flex;gap:6px;align-items:center}
.rep-crew{display:grid;grid-template-columns:auto 1fr 74px auto;grid-template-areas:"tog nm hrs u" "note note note note";gap:8px 10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--steel-700)}
.rep-crew:has(.rep-remove){grid-template-columns:auto minmax(0,1fr) 66px auto;grid-template-areas:"tog nm hrs u" "note note note remove"}
.rep-crew .rep-remove{grid-area:remove}
.rep-crew:last-child{border-bottom:0}
.rep-crew .onsite{grid-area:tog}.rep-crew .nm{grid-area:nm;display:grid;min-width:0}.rep-crew .hrs-in{grid-area:hrs;text-align:center;font-size:20px;font-weight:700;padding-inline:6px}.rep-crew .note-in{grid-area:note;min-height:44px;font-size:15px}
.rep-crew .nm small{color:var(--steel-400);font-size:13px}
.onsite{min-width:86px;min-height:46px;border-radius:999px;border:1px solid var(--steel-600);background:none;color:var(--steel-300);font-weight:700;cursor:pointer}
.onsite.on{background:var(--ok);border-color:var(--ok);color:#0b1a10}
.line-row{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:8px;align-items:center}
.line-row.delay{grid-template-columns:1fr 1fr auto;grid-template-areas:"f t x" "r r r" "h h h";padding:10px 0;border-bottom:1px solid var(--steel-700)}
.line-row.delay [data-k=from]{grid-area:f}.line-row.delay [data-k=to]{grid-area:t}.line-row.delay [data-k=reason]{grid-area:r}.line-row.delay [data-k=on_hold]{grid-area:h}.line-row.delay .rm{grid-area:x}
.line-row .input{min-height:46px;font-size:16px}
.save-bar{position:sticky;bottom:-28px;padding:12px 0 18px;background:linear-gradient(180deg,transparent,var(--steel-950) 30%)}
.save-bar .btn{min-height:64px;font-size:22px}
/* photos */
.photo-btns .btn{display:inline-flex;gap:8px;align-items:center;justify-content:center;cursor:pointer}
.photo-btns svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:6px}
.ph{aspect-ratio:1;border-radius:6px;border:1px solid var(--steel-700);background:var(--steel-800) center/cover;cursor:pointer;padding:0}
/* chat */
.p-main:has(.chat){padding-bottom:0}
.p-inner:has(.chat){display:flex;flex-direction:column;height:100%}
.p-inner:has(.chat) > :not(.chat){flex-shrink:0}
.seg.chan button{max-width:220px;overflow:hidden;text-overflow:ellipsis}
.chat{flex:1;min-height:0;overflow-y:auto;display:grid;gap:10px;align-content:start}
.msg{display:grid;gap:3px;justify-items:start;max-width:85%}
.msg .who{font-size:12px;color:var(--steel-400)}
.msg .b{padding:10px 14px;border-radius:16px 16px 16px 4px;background:var(--steel-800);border:1px solid var(--steel-700);white-space:pre-wrap;word-break:break-word;font-size:17px}
.msg.me{justify-self:end;justify-items:end}
.msg.me .b{background:var(--primer);border-color:var(--primer);border-radius:16px 16px 4px 16px;color:#fff}
.composer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-bottom:12px}
.composer .input{min-width:0;min-height:52px;resize:none;font-size:17px}
.composer .btn{min-height:52px}
.chat + .p-sub{padding-bottom:12px}
/* LEM + time cards */
.payroll-controls,.payroll-summary{display:flex;align-items:end;justify-content:space-between;flex-wrap:wrap;gap:12px}
.payroll-controls .input{min-height:44px}
.payroll-summary{padding:14px;border:1px solid var(--steel-700);border-radius:var(--radius);background:var(--steel-850)}
.pay-period-totals{display:flex;gap:14px;font-variant-numeric:tabular-nums;font-weight:700}
.pay-job-hours summary{cursor:pointer;font-size:17px;font-weight:700}
.pay-job-hours summary .p-sub{padding-inline-start:8px;font-weight:400;white-space:nowrap}
.pay-job-hours[open]>summary{margin-bottom:10px}
.pay-report-list{display:grid;gap:6px;list-style:none;margin:0;padding:0}
.pay-report-list li{display:flex;align-items:start;justify-content:space-between;gap:12px;padding:9px 12px;border:1px solid var(--steel-700);border-radius:var(--radius)}
.pay-report-list li>div{min-width:0;overflow-wrap:anywhere}
.pay-report-list li>strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.pay-report-list .p-sub{display:block}
.pay-week{min-width:0;display:grid;gap:8px}
.pay-week h3 small{margin-inline-start:6px;color:var(--steel-300);font:inherit;font-size:.65em}
table.pay-grid{min-width:850px;border-collapse:separate;border-spacing:0}
table.pay-grid td,table.pay-grid th{padding:7px;text-align:center}
table.pay-grid th:first-child{position:sticky;left:0;z-index:1;min-width:110px;max-width:155px;text-align:left;background:var(--steel-900);overflow-wrap:anywhere}
.pay-day{display:grid;justify-items:center;gap:3px;width:100%;min-height:64px;padding:5px;border:1px solid var(--steel-700);border-radius:var(--radius);background:var(--steel-850);color:var(--steel-300);cursor:pointer;font-size:12px;line-height:1.2}
.pay-day.needs-review{border-color:var(--warn);color:var(--chalk)}
.pay-day-type{font-weight:700}
.pay-totals span{display:block;white-space:nowrap}
.pay-day-form{display:grid;gap:14px}
.pay-day-hours{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pay-day-form textarea.input{min-height:80px}
table.hrs td.ot{color:var(--warn);font-weight:700}
table.lem{min-width:640px}
.rate-row{display:grid;grid-template-columns:1fr 110px;gap:8px;margin-bottom:8px}
#portal .btn svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2;flex:none}
#portal label.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;cursor:pointer}
.photo-btns{grid-template-columns:1fr 1fr}
.photo-btns .btn{font-size:17px;min-height:56px;padding-inline:10px;line-height:1.1}
.save-bar{padding:10px 0 14px;background:linear-gradient(180deg,rgba(12,16,19,0),var(--steel-950) 40%)}

.pay-date-actions{display:flex;flex-wrap:wrap;gap:6px}
.pay-calendar{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(185px,100%),1fr));gap:10px}
.pay-calendar section{padding:10px;border:1px solid var(--steel-700);border-radius:var(--radius)}
.pay-calendar section>div{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
.pay-calendar .btn{padding:4px 7px;min-width:34px;min-height:40px}
.pay-calendar [aria-pressed=true]{border-color:var(--primer);background:var(--primer);color:#fff}
