body.secure-loading .topbar,
body.secure-loading .shell,
body.auth-required .topbar,
body.auth-required .shell{
  visibility:hidden;
  pointer-events:none;
}

.secure-bootstrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:32px 20px;
  background:linear-gradient(180deg,#f7f9fc 0%,#eef3f8 100%);
}

.secure-bootstrap[hidden]{display:none;}

.secure-loading-copy{
  font-weight:700;
  color:#0b1f3a;
  letter-spacing:.01em;
}

.auth-card{
  width:min(100%,460px);
  background:#fff;
  border:1px solid #dfe6ef;
  border-radius:22px;
  padding:30px;
  box-shadow:0 18px 50px rgba(11,31,58,.10);
}

.auth-card h1{
  margin:.25rem 0 .55rem;
  color:#0b1f3a;
  font-size:clamp(1.7rem,4vw,2.2rem);
}

.auth-intro{
  margin:0 0 22px;
  color:#526071;
  line-height:1.55;
}

.auth-form{
  display:grid;
  gap:14px;
}

.auth-form label{
  display:grid;
  gap:7px;
  color:#22344a;
  font-size:.9rem;
  font-weight:700;
}

.auth-form input{
  width:100%;
  box-sizing:border-box;
  border:1px solid #cdd7e3;
  border-radius:12px;
  padding:12px 13px;
  font:inherit;
  color:#122238;
  background:#fff;
}

.auth-form input:focus{
  outline:3px solid rgba(31,108,181,.14);
  border-color:#1f6cb5;
}

.auth-form .btn{margin-top:3px;}

.auth-link{
  border:0;
  background:transparent;
  color:#1f5f9f;
  font:inherit;
  font-weight:700;
  padding:8px 0 0;
  cursor:pointer;
}

.auth-message{
  min-height:1.35em;
  margin:12px 0 2px;
  font-size:.9rem;
  color:#526071;
}

.auth-message.error{color:#9b2c2c;}
.auth-message.success{color:#276749;}

.auth-security-note{
  margin:18px 0 0;
  padding-top:16px;
  border-top:1px solid #e8edf3;
  color:#68778a;
  font-size:.8rem;
  line-height:1.45;
}

/* Build 03B authenticated header */
.topbar .tagline{
  display:block;
  margin-left:auto;
  color:#cbd7e6;
  font-size:.78rem;
  white-space:nowrap;
}

.topbar .tagline strong{color:#fff;}

.topbar .top-actions{
  margin-left:0;
  align-items:center;
  gap:8px;
}

.topbar .top-actions .btn{
  min-height:40px;
  height:40px;
  border-radius:11px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-size:.81rem;
  line-height:1;
  box-shadow:none;
}

.topbar #googleButton{
  background:#fff;
  color:#102744;
  border:1px solid rgba(255,255,255,.92);
}

.topbar #googleButton.account-connected{
  background:#edf9f2;
  color:#087a42;
  border-color:#c9ead7;
}

.topbar #newCaptureTop{
  min-width:98px;
  background:var(--green);
  color:#052814;
}

.sync-state{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#b8d9c7;
  font-size:.73rem;
  font-weight:800;
  white-space:nowrap;
}

.sync-state::before{
  content:'';
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c979;
  box-shadow:0 0 0 3px rgba(34,201,121,.12);
}

.sync-state.sync-error{color:#f2c1c1;}
.sync-state.sync-error::before{background:#ef6b6b;box-shadow:0 0 0 3px rgba(239,107,107,.12);}

.account-menu-wrap{position:relative;}

.topbar .account-button{
  min-width:82px;
  white-space:nowrap;
  background:transparent;
  color:#fff;
  border:1px solid rgba(255,255,255,.34);
}

.topbar .account-button:hover{background:rgba(255,255,255,.08);}

.account-menu{
  position:absolute;
  z-index:30;
  top:calc(100% + 9px);
  right:0;
  width:220px;
  overflow:hidden;
  background:#fff;
  border:1px solid #dce4ed;
  border-radius:14px;
  box-shadow:0 16px 38px rgba(6,25,48,.18);
}

.account-menu[hidden]{display:none;}

.account-menu-identity{
  display:grid;
  gap:3px;
  padding:14px 15px 12px;
  color:#132741;
}

.account-menu-identity strong{font-size:.9rem;}
.account-menu-identity span{font-size:.76rem;color:#6b7888;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.account-menu-action{
  width:100%;
  border:0;
  border-top:1px solid #edf1f5;
  background:#fff;
  color:#17304e;
  padding:12px 15px;
  text-align:left;
  font:inherit;
  font-size:.86rem;
  font-weight:700;
  cursor:pointer;
}

.account-menu-action:hover,
.account-menu-action:focus-visible{background:#f4f7fa;outline:none;}

/* Task photo capture */
.capture-actions .capture-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
}

#photoButton.photo-active{
  background:#eefaf3;
  border-color:#9fdab9;
  color:#087a42;
}

.photo-preview{
  margin-top:10px;
  display:grid;
  grid-template-columns:58px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:9px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:13px;
  background:rgba(255,255,255,.08);
}

.photo-preview[hidden]{display:none;}

.photo-preview img{
  width:58px;
  height:58px;
  display:block;
  object-fit:cover;
  border-radius:10px;
  background:#dfe7ef;
}

.photo-preview-no-image img{visibility:hidden;}
.photo-preview-no-image::before{
  content:'Photo';
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  grid-column:1;
  grid-row:1;
  border-radius:10px;
  background:#e7edf4;
  color:#536579;
  font-size:.68rem;
  font-weight:800;
}

.photo-preview-copy{min-width:0;display:grid;gap:3px;}
.photo-preview-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.82rem;color:#fff;}
.photo-preview-copy span{font-size:.7rem;color:#bfcddd;}

.photo-preview-actions{display:flex;align-items:center;gap:5px;}
.photo-text-action{
  border:0;
  border-radius:8px;
  background:rgba(255,255,255,.10);
  color:#fff;
  padding:7px 9px;
  font:inherit;
  font-size:.7rem;
  font-weight:800;
  cursor:pointer;
}
.photo-text-action:hover{background:rgba(255,255,255,.17);}
.photo-text-action.photo-remove{color:#ffd0d0;}

@media (max-width:1050px){
  .topbar .tagline{display:none;}
}

@media (max-width:900px){
  .sync-state{display:none;}
}

@media (max-width:600px){
  .secure-bootstrap{padding:20px 14px;}
  .auth-card{padding:24px 20px;border-radius:18px;}
  .topbar .top-actions{gap:6px;}
  .topbar .top-actions .btn{height:38px;min-height:38px;padding:0 10px;font-size:.72rem;}
  .topbar #newCaptureTop{min-width:auto;}
  .account-button{font-size:.75rem;}
  .account-menu{width:min(220px,calc(100vw - 28px));}
  .capture-actions{display:grid;grid-template-columns:1fr 1fr;}
  .capture-actions #sendButton{grid-column:1/-1;}
  .photo-preview{grid-template-columns:52px minmax(0,1fr);}
  .photo-preview img,.photo-preview-no-image::before{width:52px;height:52px;}
  .photo-preview-actions{grid-column:1/-1;justify-content:flex-end;margin-top:-3px;}
}
