*{box-sizing:border-box}body{margin:0;color:#202020;background:#f4f4f1;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}header{padding:24px 5%;display:flex;align-items:center;gap:30px;border-bottom:1px solid #ddd;background:white}header img{width:155px;height:36px;object-fit:contain}header small{margin-left:auto;color:#666}main{max-width:1240px;margin:auto;padding:28px 30px}.notice{color:#666;font-size:13px;padding:10px 0 24px}nav{display:flex;gap:8px;margin-bottom:32px}button{border:1px solid #ccc;border-radius:7px;background:white;padding:10px 16px;font:inherit;cursor:pointer}button.primary,button.active{background:#222;color:white;border-color:#222}button:hover{opacity:.8}button:disabled{opacity:.45;cursor:default}h1{font-size:32px;font-weight:500;letter-spacing:-1px;margin:0}h2{font-size:20px;font-weight:500}p.muted,.muted{color:#777}.top{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:24px}.panel{background:white;border:1px solid #e0e0db;border-radius:12px;padding:24px;margin-bottom:20px}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}label{display:block;color:#666;font-size:13px}input,select,textarea{width:100%;padding:11px;border:1px solid #ccc;border-radius:6px;background:white;color:#222;font:inherit;margin:6px 0 16px}input[type=checkbox]{width:auto;margin:0 8px 0 0}.stages{display:flex;gap:18px;flex-wrap:wrap;padding:10px 0 20px}.stages label{color:#222}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:20px 0}.stat{background:#ecece7;padding:16px;border-radius:8px}.stat strong{display:block;font-size:26px;font-weight:500}.badge{display:inline-block;border:1px solid #ddd;padding:3px 8px;border-radius:5px;font-size:12px;background:#f5f5f0}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{text-align:left;padding:14px 10px;border-bottom:1px solid #eee}th{font-size:12px;color:#777;font-weight:500}td button{padding:6px 10px}.actions{display:flex;gap:8px;flex-wrap:wrap}.error{color:#9b351f}.detail{background:#f8f8f4;padding:18px;border-radius:8px;margin:16px 0}footer{font-size:12px;color:#777;margin-top:24px}@media(max-width:760px){main{padding:18px 14px}header{gap:12px;padding:16px}header span{display:none}header small{font-size:10px}.grid{grid-template-columns:1fr}.stats{gap:8px}.stat{padding:10px}.stat strong{font-size:18px}.top{align-items:flex-start;flex-direction:column}.panel{padding:16px}h1{font-size:26px}nav button{padding:8px 10px}}

.agency-row{padding:16px;margin-top:14px}.agency-row button{margin-left:12px}.proofName{display:inline-block;overflow-wrap:anywhere}input[type=file]{font-size:13px}

.proofOverlay{position:fixed;inset:0;z-index:20;background:#0008;padding:4vh 5vw;overflow:auto}.proofBox{background:white;padding:24px;border-radius:12px;max-width:1000px;margin:auto}.proofBox pre{white-space:pre-wrap;overflow-wrap:anywhere;padding:20px;background:#f4f4f1}.proofBox img{display:block;max-width:100%;max-height:65vh;margin:20px auto}.proofBox iframe{display:block;width:100%;height:65vh;border:0;margin:20px 0}.proofBox a{display:block;color:#222;margin-top:18px}

.project-card{background:#fafaf7;margin:18px 0}.project-stages{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.stage-choice,.stage-result{padding:16px;border:1px solid #ddd;border-radius:9px;color:#222;display:flex;gap:10px;align-items:flex-start}.stage-choice input{margin-top:4px}.stage-choice span,.stage-result{display:flex;flex-direction:column;gap:8px}.stage-choice small,.stage-result small{color:#777}.stage-choice strong,.stage-result strong{font-size:18px}.stage-result.claimed{background:#e9eee8;border-color:#a6b4a5}.project-result h2{margin:0}.project-result p{margin:8px 0}.project-card h3{font-size:16px;font-weight:500}@media(max-width:900px){.project-stages{grid-template-columns:repeat(2,1fr)}}@media(max-width:500px){.project-stages{grid-template-columns:1fr}}

.department-grid{display:grid;grid-template-columns:1fr;gap:18px}.department h2{margin-top:0}.graphic-bar{display:grid;grid-template-columns:240px 1fr 120px;align-items:center;gap:12px;margin:14px 0}.graphic-bar>div{height:14px;background:#eee;border-radius:3px;overflow:hidden}.graphic-bar i{display:block;height:100%;background:#353535}.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px}.stage-chip{display:inline-block;padding:7px;border-radius:5px;background:#eee;font-size:12px}.stage-chip.claimed,.legend .claimed{background:#e6e9ed}.stage-chip.checking,.legend .checking{background:#f4e6c6}.stage-chip.approved,.legend .approved{background:#dcebdc}@media(max-width:760px){.graphic-bar{grid-template-columns:1fr 100px}.graphic-bar>span{grid-column:1/-1}}

/* Desktop containment: only the wide matrix scrolls, not the page. */
main,.panel,.department-grid,.department,.department .detail{min-width:0;max-width:100%}.department-grid>*{min-width:0}.tablewrap{width:100%;max-width:100%;min-width:0;overflow-x:auto}.graphic-bar{width:100%;max-width:100%;min-width:0;grid-template-columns:minmax(140px,230px) minmax(0,1fr) 130px}.graphic-bar>span{min-width:0;overflow-wrap:anywhere}.graphic-bar>div{min-width:0;max-width:100%}.graphic-bar>strong{white-space:nowrap;text-align:right;font-size:14px}@media(max-width:760px){.graphic-bar{grid-template-columns:minmax(0,1fr) 130px}.graphic-bar>span{grid-column:1/-1}}

.project-stages.two-stages{grid-template-columns:repeat(2,minmax(0,1fr))}

.grid>label{min-width:0;display:flex;flex-direction:column;align-items:stretch}.grid>label input[type=checkbox]{align-self:flex-start}.grid>label>input:not([type=checkbox]),.grid>label>select{margin-top:6px}.project-card>small{display:block;margin-top:-10px;margin-bottom:16px}

.visits-inline{display:flex;align-items:center;gap:16px;margin:10px 0 16px}.visits-inline label{width:100px;flex:0 0 100px}.visits-inline input{width:100px;margin-bottom:0}.visits-inline small{color:#777;max-width:240px}

/* PAYROLL V1: the existing calm monochrome workspace. */
.login{max-width:430px;margin:6vh auto}.login h1{margin-bottom:18px}.message{padding:12px 16px;margin-bottom:20px;border:1px solid #b7c5b1;border-radius:8px;background:#f1f5ee}.message.error{background:#fff4f0;border-color:#d9a693}.compact{margin-bottom:6px}.line-card{border:1px solid #e0e0db;border-radius:10px;padding:18px;margin:14px 0;background:#fff}.line-heading{display:flex;justify-content:space-between;gap:15px;align-items:start}.line-heading h3{margin:0;font-size:16px}.line-heading strong{white-space:nowrap;font-size:20px;font-weight:500}.line-meta{font-size:13px;color:#666;margin:8px 0}.form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:end}.toolbar label{min-width:150px}.toolbar input,.toolbar select{margin-bottom:0}.toolbar button{height:46px}.checkline{display:flex;align-items:center;gap:10px;color:#222}.checkline input{flex:none}.package-total{font-size:32px;font-weight:500}.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.summary-grid .stat strong{font-size:22px}.reason{border-left:3px solid #aaa;padding:8px 12px;background:#f7f7f4}.status-route{font-size:12px;color:#777;overflow-wrap:anywhere}.inline-link{color:#222;text-decoration:underline}.details-body{padding-top:12px}details>summary{cursor:pointer;font-weight:500}.empty{padding:20px 0;color:#777}pre.audit{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.form-hint{font-size:12px;color:#777;margin-top:-12px;margin-bottom:14px}.wide{grid-column:1/-1}.row-actions{margin-top:12px}button.danger{border-color:#ab7267;color:#963d2b}nav{flex-wrap:wrap;margin-bottom:24px}#identity{display:flex;align-items:center;gap:10px}#identity button{font-size:12px;padding:6px 10px}.login input{margin-bottom:18px}textarea{min-height:75px}a{overflow-wrap:anywhere}@media(max-width:760px){.form-row{grid-template-columns:1fr;gap:0}.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.line-heading strong{font-size:17px}.toolbar{align-items:stretch}.toolbar label{flex:1}.toolbar button{width:100%}.line-card{padding:14px}.actions button{flex-grow:1}header small{font-size:11px;flex-wrap:wrap}.package-total{font-size:27px}.line-heading{flex-wrap:wrap}.checkline{align-items:start}table{font-size:13px}input,select,textarea{font-size:16px}}

@media(max-width:760px){header #identity span{display:inline;font-size:11px}header #identity{justify-content:flex-end;text-align:right}}

.comparison-attention{display:block;padding:12px;margin-top:10px;border-left:3px solid #a78039;background:#fff7e7;color:#70581f;font-weight:500}

.package-approved{border-left:3px solid #273b2a;padding-left:14px}.package-excluded{border-left:3px solid #8b5d43;padding-left:14px;margin-top:24px}.package-excluded>h3{color:#6f3f2f}
