
/* V161: stage tab stability + visible secure gate. Desktop large-card look retained. */
body.stage-flow-v161 #quizRulesSection{display:none!important;}
body.stage-flow-v161 #secureSessionWidgetV81{display:none!important;}
.stage-secure-banner-v161,
.stage-secure-inline-v161{
  width:100%; box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 18px; margin:14px 0; border-radius:24px;
  background:linear-gradient(135deg, rgba(20,31,52,.92), rgba(10,18,34,.78));
  border:1px solid rgba(170,208,255,.22); box-shadow:0 18px 42px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.stage-secure-banner-v161{margin:16px 0 18px; position:relative; z-index:4;}
.stage-secure-banner-v161.is-ready,.stage-secure-inline-v161.is-ready{border-color:rgba(81,245,178,.36); background:linear-gradient(135deg, rgba(17,54,50,.88), rgba(12,24,39,.72));}
.stage-secure-icon-v161{width:48px;height:48px;flex:0 0 auto;border-radius:18px;display:grid;place-items:center;font-weight:950;font-size:24px;background:rgba(255,212,121,.16);border:1px solid rgba(255,212,121,.35);color:#ffd479;}
.is-ready>.stage-secure-icon-v161{background:rgba(81,245,178,.16);border-color:rgba(81,245,178,.35);color:#80ffd0;}
.stage-secure-copy-v161{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px;}
.stage-secure-copy-v161 strong{font-size:18px;line-height:1.15;color:#fff;letter-spacing:-.02em;}
.stage-secure-copy-v161 span{font-size:14px;line-height:1.35;color:rgba(239,246,255,.76);}
.stage-secure-btn-v161{appearance:none;border:1px solid rgba(255,255,255,.18);border-radius:18px;padding:13px 18px;font-weight:900;color:#06101d;background:linear-gradient(135deg,#dcd4ff,#88edff);box-shadow:0 14px 32px rgba(99,154,255,.22);white-space:nowrap;cursor:pointer;}
.is-ready .stage-secure-btn-v161{color:#dfffee;background:rgba(255,255,255,.08);box-shadow:none;}
.stage-secure-gate-card-v161{max-width:980px;margin:0 auto;padding:30px!important;}
.stage-secure-gate-top-v161{display:flex;gap:18px;align-items:flex-start;margin-bottom:18px;}
.stage-secure-gate-icon-v161{width:64px;height:64px;border-radius:24px;display:grid;place-items:center;background:rgba(255,73,73,.16);border:1px solid rgba(255,112,112,.38);font-size:32px;font-weight:950;color:#ff9c9c;}
.stage-secure-gate-top-v161 h3{font-size:clamp(30px,4vw,54px);line-height:.96;margin:4px 0 10px;letter-spacing:-.06em;}
.stage-secure-gate-top-v161 p{font-size:18px;line-height:1.45;color:rgba(239,246,255,.78);max-width:760px;}
.stage-secure-warning-grid-v161{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0 20px;}
.stage-secure-warning-grid-v161 span{border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.06);border-radius:18px;padding:14px 12px;text-align:center;font-weight:900;color:#fff;}
.stage-secure-actions-v161{display:flex;gap:12px;align-items:center;flex-wrap:wrap;}
body.stage-flow-v161 .nav-item.stage-locked{opacity:.62;}
body.stage-flow-v161 .nav-item.stage-done::after{content:'✓';margin-left:8px;color:#83ffd4;}
body.stage-flow-v161 .nav-item.stage-next{box-shadow:inset 0 0 0 1px rgba(158,139,255,.28);}
@media (max-width: 760px){
  .stage-secure-banner-v161,.stage-secure-inline-v161{flex-direction:column;align-items:stretch;text-align:left;border-radius:22px;padding:14px;margin:12px 0;}
  .stage-secure-icon-v161{width:44px;height:44px;border-radius:16px;font-size:22px;}
  .stage-secure-copy-v161 strong{font-size:17px;}
  .stage-secure-copy-v161 span{font-size:13px;}
  .stage-secure-btn-v161{width:100%;padding:14px 16px;text-align:center;}
  .stage-secure-gate-card-v161{padding:20px!important;max-width:100%;}
  .stage-secure-gate-top-v161{flex-direction:column;gap:12px;}
  .stage-secure-gate-top-v161 h3{font-size:34px;}
  .stage-secure-gate-top-v161 p{font-size:15px;}
  .stage-secure-warning-grid-v161{grid-template-columns:1fr 1fr;}
  .stage-secure-warning-grid-v161 span{font-size:13px;padding:12px 10px;}
}

/* V162 production stage timing + login copy polish */
.stage-time-pill-v162{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:9px 14px;border-radius:999px;border:1px solid rgba(95,245,171,.28);background:linear-gradient(135deg,rgba(50,222,140,.18),rgba(255,255,255,.06));color:#caffdf;font-weight:950;font-size:12px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.stage-time-pill-v162.amber{border-color:rgba(255,197,94,.34);background:linear-gradient(135deg,rgba(255,176,58,.18),rgba(255,255,255,.055));color:#ffe0a8}
.v159-status-chip.red{border-color:rgba(255,107,130,.32)!important;background:rgba(255,84,112,.12)!important;color:#ffd5dd!important}
body.stage-flow-v162 .dev-tools-v158,
body.stage-flow-v162 #devEmployeeSelector{display:none!important}
body.stage-flow-v162 .portal-brand small::after{content:''!important}
body.stage-flow-v162 .login-rules-card .rules-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.stage-flow-v162 .rules-scroll li span{line-height:1.48!important}
body.stage-flow-v162 .stage-secure-banner-v161{position:relative;z-index:2}
@media(max-width:760px){
  body.stage-flow-v162 .login-rules-card .rules-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .stage-time-pill-v162{width:100%;white-space:normal;text-align:center}
  body.stage-flow-v162 .ai-lab-top-v158{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;align-items:start!important}
}


/* V176 secure camera widget polish: prevents raw bottom-left video/text layout. */
#secureSessionWidgetV81.secure-session-widget-v81{
  position:fixed!important;right:max(18px,env(safe-area-inset-right))!important;bottom:max(18px,env(safe-area-inset-bottom))!important;
  width:min(440px,calc(100vw - 36px))!important;min-height:74px!important;display:grid!important;grid-template-columns:74px minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;
  padding:10px 12px!important;border-radius:24px!important;border:1px solid rgba(180,210,255,.22)!important;background:linear-gradient(135deg,rgba(10,18,34,.92),rgba(17,34,56,.86))!important;box-shadow:0 24px 70px rgba(0,0,0,.44),inset 0 1px 0 rgba(255,255,255,.09)!important;backdrop-filter:blur(18px)!important;color:#fff!important;z-index:90!important;overflow:hidden!important;
}
#secureSessionWidgetV81 .secure-preview{width:64px!important;height:48px!important;border-radius:16px!important;overflow:hidden!important;background:rgba(255,255,255,.08)!important;display:grid!important;place-items:center!important;border:1px solid rgba(255,255,255,.12)!important;}
#secureSessionWidgetV81 .secure-preview video{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;}
#secureSessionWidgetV81 .secure-copy{min-width:0!important;display:flex!important;flex-direction:column!important;gap:2px!important;}
#secureSessionWidgetV81 .secure-copy strong{font-size:15px!important;line-height:1.12!important;font-weight:950!important;letter-spacing:-.02em!important;color:#fff!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
#secureSessionWidgetV81 .secure-copy span{font-size:12px!important;line-height:1.25!important;color:rgba(235,244,255,.76)!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;}
#secureSessionWidgetV81 button{border:0!important;border-radius:999px!important;min-height:38px!important;padding:0 16px!important;font-weight:950!important;background:linear-gradient(135deg,#edf4ff,#8ff3ff)!important;color:#08101d!important;box-shadow:0 12px 30px rgba(0,163,224,.16)!important;}
@media(max-width:640px){
  #secureSessionWidgetV81.secure-session-widget-v81{grid-template-columns:54px minmax(0,1fr)!important;bottom:max(12px,env(safe-area-inset-bottom))!important;right:10px!important;left:10px!important;width:auto!important;padding:9px!important;border-radius:20px!important;}
  #secureSessionWidgetV81 .secure-preview{width:48px!important;height:38px!important;border-radius:13px!important;}
  #secureSessionWidgetV81 button{grid-column:1/-1!important;width:100%!important;min-height:34px!important;}
}
