
body.auth-locked .app{display:none!important}
#authGate{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(135deg,#101c2e 0%,#1c3656 55%,#2676e8 130%);font:14px Arial,sans-serif}
#authGate .auth-card{width:min(430px,100%);background:#fff;border-radius:18px;padding:30px;box-shadow:0 24px 80px #0005}
#authGate .auth-brand{font-size:20px;font-weight:800;color:#14243a;text-align:center;margin-bottom:7px}#authGate .auth-sub{color:#718096;text-align:center;margin-bottom:24px;font-size:12px}
#authGate .auth-tabs{display:flex;background:#f1f5f9;padding:4px;border-radius:10px;margin-bottom:20px;gap:4px}
#authGate .auth-tabs button{flex:1;border:0;padding:10px;border-radius:8px;background:transparent;color:#526176;font-weight:700;cursor:pointer}
#authGate .auth-tabs button.active{background:#2676e8;color:#fff}
#authGate label{display:block;color:#40516a;font-weight:700;font-size:12px;margin:12px 0 6px}
#authGate input{width:100%;padding:12px;border:1px solid #d8e1ed;border-radius:8px;font:14px Arial;outline:none}
#authGate input:focus{border-color:#2676e8;box-shadow:0 0 0 3px #2676e81a}
#authGate .auth-submit{width:100%;border:0;border-radius:8px;padding:13px;background:#2676e8;color:#fff;font-weight:700;margin-top:20px;cursor:pointer}
#authGate .auth-msg{font-size:12px;color:#d43d4d;min-height:18px;margin-top:10px}
#authGate .auth-note{font-size:11px;color:#7b8798;line-height:1.5;margin-top:16px;text-align:center}
.auth-project-name{font-size:10px;color:#64748b}.auth-profile-actions{display:flex;gap:5px;margin-top:3px}.auth-profile-actions button{font-size:9px;border:1px solid #dbe3ee;background:#fff;border-radius:5px;padding:3px 6px;cursor:pointer;color:#334155}.topright .userlabel{min-width:145px}

.field-photo-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px}
.field-photo-card{min-width:0;border:1px solid #dbe4ef;border-radius:9px;overflow:hidden;background:#fff}
.field-photo-thumb{height:112px;background:#edf2f7;position:relative;display:flex;align-items:center;justify-content:center}
.field-photo-thumb img{width:100%;height:100%;object-fit:cover}
.photo-project{position:absolute;left:5px;bottom:5px;background:#10243dcc;color:white;padding:2px 5px;border-radius:4px;font-size:10px}
.field-photo-meta{padding:7px;display:flex;flex-direction:column;gap:4px;font-size:11px}
.field-photo-meta b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.field-photo-meta span,.field-photo-meta small{color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.field-photo-meta .actions{gap:3px;flex-wrap:wrap}
.field-photo-meta .btn{font-size:10px;padding:4px 6px}
@media(max-width:1300px){.field-photo-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:950px){.field-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px){.field-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V53: polished responsive account header */
.topbar{
  height:auto!important;min-height:66px;padding:9px 18px!important;gap:14px!important;
  flex-wrap:wrap;align-items:center;box-sizing:border-box;
}
.topbar .topleft{flex:0 1 auto;min-width:220px;gap:10px;}
.topbar .topright{margin-left:auto;min-width:0;max-width:100%;gap:10px;display:flex;align-items:center;flex-wrap:nowrap;}
.topbar .search{width:clamp(150px,18vw,245px);min-width:130px;}
.topbar .avatar{width:38px;height:38px;min-width:38px;font-size:13px;box-shadow:0 0 0 3px #eff6ff;}
.topbar .userlabel{display:flex!important;flex-direction:column;justify-content:center;gap:2px;min-width:0!important;max-width:245px;line-height:1.25;padding:5px 0;}
.topbar .userlabel>b{font-size:13px;color:#172b4d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.topbar .userlabel .sub{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.topbar .userlabel .auth-project-name{color:#526782;font-weight:600;}
.topbar .auth-profile-actions{display:flex;gap:6px;margin-top:4px;flex-wrap:wrap;}
.topbar .auth-profile-actions button{font-size:10px;padding:4px 8px;border:1px solid #d7e1ef;border-radius:6px;background:#fff;color:#29466d;transition:background .15s,border-color .15s;}
.topbar .auth-profile-actions button:hover{background:#f2f7ff;border-color:#9bbce9;}
.topbar .topright>span{color:#71839b;font-size:14px;}
@media(max-width:1100px){
 .topbar{padding:9px 12px!important;}
 .topbar .topright{gap:8px;}
 .topbar .search{width:clamp(130px,22vw,200px);}
 .topbar .userlabel{max-width:190px;}
}
@media(max-width:760px){
 .topbar{align-items:stretch;gap:8px!important;padding:9px 10px!important;}
 .topbar .topleft{width:100%;min-width:0;}
 .topbar .topright{width:100%;margin-left:0;display:grid;grid-template-columns:minmax(0,1fr) auto 38px minmax(120px,1fr);gap:7px;}
 .topbar .search{grid-column:1;width:100%;min-width:0;box-sizing:border-box;}
 .topbar .topright>span{grid-column:2;justify-self:center;}
 .topbar .avatar{grid-column:3;grid-row:1;width:34px;height:34px;min-width:34px;}
 .topbar .userlabel{grid-column:4;grid-row:1;max-width:none;}
 .topbar .userlabel>b{font-size:12px;}
 .topbar .userlabel .sub{font-size:9px;}
 .topbar .auth-profile-actions button{font-size:9px;padding:3px 6px;}
}
@media(max-width:420px){
 .topbar .topright{grid-template-columns:minmax(0,1fr) 32px 34px minmax(95px,.9fr);}
 .topbar .userlabel{max-width:125px;}
 .topbar .auth-profile-actions{gap:4px;}
 .topbar .auth-profile-actions button{font-size:8px;padding:3px 5px;}
}


.ref-site-photo-panel .ref-photogrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;align-content:start}
.ref-site-photo-panel .ref-photo{display:block;width:100%;min-width:0;text-align:left;padding:0;border:0;background:#fff;color:var(--ink);border-radius:6px;overflow:hidden;cursor:pointer}
.ref-site-photo-panel .ref-photo:hover{background:#f7faff;outline:1px solid #c9dcf8}
.ref-site-photo-panel .ref-photo img{width:100%;height:82px;display:block;object-fit:cover;background:#edf2f7;border-radius:5px}
.ref-site-photo-panel .ref-photo b{display:block;font-size:10px;line-height:1.25;margin:4px 2px 1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ref-site-photo-panel .ref-photo small{display:block;font-size:8px;color:var(--muted);margin:0 2px 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ref-photo-empty{grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:9px;color:var(--muted);padding:18px}
.ref-photo-empty b{color:var(--ink);font-size:12px}.ref-photo-empty span{max-width:260px;font-size:10px}
@media(max-width:1100px){.ref-site-photo-panel .ref-photogrid{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-site-photo-panel .ref-photo img{height:72px}}
@media(max-width:760px){.ref-site-photo-panel .ref-photogrid{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-site-photo-panel .ref-photo img{height:90px}}

.contract-party-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}.contract-party-card{min-height:155px}.contract-file-list{display:grid;gap:7px}.contract-file-row{display:flex;align-items:center;gap:8px;padding:7px 0;border-top:1px solid #edf0f5}.contract-file-row>div{min-width:0;flex:1}.contract-file-row b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}.contract-file-row small{display:block;color:var(--muted);font-size:9px}.contract-file-icon{font-size:8px;font-weight:800;color:#c2414b;background:#fff0f1;padding:5px;border-radius:4px}@media(max-width:900px){.contract-party-grid{grid-template-columns:1fr}}
