/* Personnel portal top profile: premium dark information hierarchy. */
body.theme-pro #app-screen #page-personnel-portal .personnel-portal-top-card {
  color: #f7fbff !important;
  border: 2px solid rgba(102, 164, 216, 0.48) !important;
  background: linear-gradient(155deg, #192b45 0%, #101d31 100%) !important;
  box-shadow: 0 7px 0 #07131f, 0 20px 34px rgba(2, 9, 20, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.11) !important;
}

/* Full-screen portal entrance adapted from the supplied Orb Explosion logo. */
body.theme-pro .personnel-portal-orb-transition {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(91,255,207,.09), transparent 30%),
    #010304;
  opacity: 1;
  contain: strict;
  transform: translateZ(0);
  will-change: opacity, transform, filter, clip-path;
}

body.theme-pro .personnel-portal-orb-transition.leave {
  pointer-events: none;
  animation: personnelPortalCinematicExit 1s cubic-bezier(.35,0,.2,1) forwards;
}

body.theme-pro .personnel-portal-orb-transition.leave .personnel-portal-orb-wordmark {
  animation: personnelPortalWordmarkExit .78s cubic-bezier(.3,0,.25,1) forwards;
}

@keyframes personnelPortalCinematicExit {
  0% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateZ(0) scale(1);
    clip-path: circle(150% at 50% 50%);
  }
  28% {
    opacity: 1;
    filter: blur(0) brightness(1.16);
    transform: translateZ(0) scale(1.006);
  }
  68% {
    opacity: .68;
    filter: blur(3px) brightness(1.08);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    filter: blur(14px) brightness(.82);
    transform: translateZ(0) scale(1.035);
    clip-path: circle(0 at 50% 50%);
  }
}

@keyframes personnelPortalWordmarkExit {
  0% { opacity: 1; filter: blur(0); transform: translate(-50%,-50%) scale(1); }
  32% { opacity: 1; filter: blur(0); transform: translate(-50%,-50%) scale(1.055); text-shadow: 0 0 34px rgba(105,255,211,.62); }
  100% { opacity: 0; filter: blur(10px); transform: translate(-50%,-50%) scale(1.13); }
}

/* Never expose stale/loading portal markup behind the entrance transition. */
body.theme-pro #page-personnel-portal.personnel-portal-intro-pending {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.theme-pro #page-personnel-portal:not(.personnel-portal-intro-pending) {
  visibility: visible;
  opacity: 1;
  animation: personnelPortalReveal .85s cubic-bezier(.2,.75,.25,1);
}

@keyframes personnelPortalReveal {
  from { opacity: 0; transform: translateY(8px) scale(.992); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Keep the mobile request bar attached to the viewport, never the portal document. */
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .personnel-portal-floating-menu {
  position: fixed !important;
  left: max(10px, env(safe-area-inset-left, 0px)) !important;
  right: max(10px, env(safe-area-inset-right, 0px)) !important;
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 5200 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  isolation: isolate;
  transform: translateZ(0);
}

body.theme-pro .personnel-portal-orb-logo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

body.theme-pro .personnel-portal-orb-logo canvas,
body.theme-pro .personnel-portal-orb-flash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translateZ(0);
}

body.theme-pro .personnel-portal-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(45vw, 300px);
  aspect-ratio: 1;
  border: 1px solid rgba(220, 255, 245, 0.28);
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 30% 24%, #fff 0 4%, rgba(220,255,245,.9) 5% 10%, transparent 11%),
    radial-gradient(circle at 68% 70%, rgba(224,187,92,.22), transparent 25%),
    radial-gradient(circle, #8affdf 0 8%, #42d3aa 20%, #126e58 43%, #052b22 63%, #010504 82%);
  box-shadow: inset -30px -35px 60px rgba(0,0,0,.6), inset 18px 15px 35px rgba(255,255,255,.08), 0 0 35px rgba(105,255,211,.5), 0 0 100px rgba(105,255,211,.2);
  transform: translate(-50%, -50%) scale(.15);
  transform-origin: center;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  animation: personnelOrbIn .45s cubic-bezier(.18,.82,.24,1) forwards, personnelOrbCharge .42s .5s ease-in forwards;
}

body.theme-pro .personnel-portal-orb.burst {
  animation: personnelOrbExplode .2s ease-out forwards;
}

body.theme-pro .personnel-portal-orb-flash {
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(205,255,240,.9) 0, rgba(105,255,211,.25) 12%, transparent 34%);
}

body.theme-pro .personnel-portal-orb-flash.go {
  animation: personnelOrbFlash .45s ease-out;
}

body.theme-pro .personnel-portal-orb-wordmark {
  position: absolute;
  left: 50%;
  top: 50%;
  color: #f2fff9 !important;
  -webkit-text-fill-color: #f2fff9 !important;
  font-size: clamp(38px, 9vw, 86px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .13em;
  opacity: 0;
  text-shadow: 0 0 18px rgba(105,255,211,.22);
  transform: translate(-50%, -50%) scale(.55);
  transform-origin: center;
  white-space: nowrap;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

body.theme-pro .personnel-portal-orb-wordmark span {
  color: #69ffd3 !important;
  -webkit-text-fill-color: #69ffd3 !important;
}

body.theme-pro .personnel-portal-orb-wordmark.show {
  animation: personnelOrbWordmark .48s cubic-bezier(.15,.9,.25,1) forwards;
}

@keyframes personnelOrbIn { to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes personnelOrbCharge {
  0% { filter: brightness(1); transform: translate(-50%,-50%) scale(1); }
  70% { filter: brightness(2.1); transform: translate(-50%,-50%) scale(.9); }
  100% { filter: brightness(4); transform: translate(-50%,-50%) scale(1.12); }
}
@keyframes personnelOrbExplode {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(1.12); }
  45% { opacity: 1; filter: brightness(6); transform: translate(-50%,-50%) scale(1.35); }
  100% { opacity: 0; filter: brightness(8); transform: translate(-50%,-50%) scale(1.7); }
}
@keyframes personnelOrbFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes personnelOrbWordmark {
  0% { opacity: 0; filter: blur(12px); transform: translate(-50%,-50%) scale(.55); }
  65% { opacity: 1; filter: blur(0); transform: translate(-50%,-50%) scale(1.08); }
  100% { opacity: 1; filter: blur(0); transform: translate(-50%,-50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-pro .personnel-portal-orb { display: none; }
  body.theme-pro .personnel-portal-orb-wordmark.show {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

body.theme-pro #app-screen #page-personnel-portal .staff-hero h3 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
  letter-spacing: 0.01em !important;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55) !important;
}

/* Luxury mechanical personnel-score counter beside the staff name. */
body.theme-pro #app-screen #page-personnel-portal .personnel-score-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-name-row h3 {
  min-width: 0;
  margin: 0;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip {
  position: relative;
  flex: 0 0 104px;
  width: 104px;
  min-height: 66px;
  margin: -8px 0 -6px auto;
  padding: 8px 9px 9px;
  overflow: hidden;
  border: 1px solid rgba(225,190,106,.58);
  border-radius: 14px;
  background: linear-gradient(150deg, #273047 0%, #111827 44%, #05080f 100%);
  box-shadow: 0 12px 24px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.08), 0 0 18px rgba(215,181,109,.1);
  transform-origin: right center;
  opacity: 0;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip.is-opening {
  animation: personnelScoreFlipOpen .55s cubic-bezier(.18,.85,.22,1) forwards;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip.is-closing {
  animation: personnelScoreFlipClose .48s cubic-bezier(.4,0,.8,.2) forwards;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-label {
  display: block;
  color: #d8bc75 !important;
  -webkit-text-fill-color: #d8bc75 !important;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .13em;
  text-align: center;
  white-space: nowrap;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-window {
  position: relative;
  display: grid;
  place-items: center;
  height: 39px;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid rgba(215,181,109,.25);
  border-radius: 8px;
  background: linear-gradient(#090d16 0 49%, #05070c 50% 100%);
  box-shadow: inset 0 5px 12px #000, inset 0 -3px 8px rgba(255,255,255,.025);
  perspective: 160px;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-value {
  color: #fff0bd !important;
  -webkit-text-fill-color: #fff0bd !important;
  font: 800 25px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -.05em;
  text-shadow: 0 0 14px rgba(236,199,110,.32);
  transform-origin: center bottom;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-value.flip-tick {
  animation: personnelScoreDigitFlip .12s ease-out;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #000;
  box-shadow: 0 1px rgba(255,255,255,.035);
}

body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip-glint {
  position: absolute;
  inset: -20% auto -20% -35%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(255,244,203,.2), transparent);
  transform: skewX(-18deg);
  animation: personnelScoreFlipGlint 6.6s ease-in-out infinite;
}

@keyframes personnelScoreFlipOpen {
  from { opacity: 0; transform: perspective(300px) rotateY(72deg) scale(.82); filter: blur(3px); }
  to { opacity: 1; transform: perspective(300px) rotateY(0) scale(1); filter: blur(0); }
}

@keyframes personnelScoreFlipClose {
  from { opacity: 1; transform: perspective(300px) rotateY(0) scale(1); }
  to { opacity: 0; transform: perspective(300px) rotateY(-60deg) scale(.88); }
}

@keyframes personnelScoreDigitFlip {
  0% { transform: rotateX(-72deg); opacity: .25; }
  100% { transform: rotateX(0); opacity: 1; }
}

@keyframes personnelScoreFlipGlint {
  0%, 28% { left: -35%; opacity: 0; }
  38% { opacity: 1; }
  55%, 100% { left: 120%; opacity: 0; }
}

@media (max-width: 430px) {
  body.theme-pro #app-screen #page-personnel-portal .personnel-score-name-row { gap: 5px; }
  body.theme-pro #app-screen #page-personnel-portal .personnel-score-flip {
    flex-basis: 92px;
    width: 92px;
    min-height: 61px;
    padding-inline: 7px;
    margin-right: -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-pro #app-screen #page-personnel-portal :is(.personnel-score-flip, .personnel-score-flip-value, .personnel-score-flip-glint) {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* Premium animated vector globe in the Personnel Portal region card. */
body.theme-pro #app-screen #page-personnel-portal .personnel-portal-region-mini {
  position: relative;
  min-height: 104px;
  padding: 14px 142px 14px 16px !important;
  overflow: hidden;
  isolation: isolate;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-region-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
  min-height: 74px;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-cosmos {
  position: absolute;
  z-index: 1;
  right: 12px;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translateY(-50%);
  pointer-events: none;
  filter: drop-shadow(0 9px 16px rgba(0,0,0,.25));
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-globe {
  position: absolute;
  inset: 14px;
  width: 92px;
  height: 92px;
  overflow: visible;
  transform: translateZ(0);
  animation: personnelRegionFloat 4.8s ease-in-out infinite;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-world-spin {
  transform-origin: 60px 60px;
  animation: personnelRegionWorld 8s linear infinite;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-orbit {
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(181, 151, 255, .42);
  border-radius: 50%;
  transform: rotate(-19deg) scaleY(.44);
  box-shadow: 0 0 12px rgba(159,124,255,.18);
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-orbit-b {
  inset: 18px 5px;
  border-color: rgba(105,255,211,.3);
  transform: rotate(58deg) scaleY(.5);
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-star {
  position: absolute;
  z-index: 3;
  color: #fff4b8 !important;
  -webkit-text-fill-color: #fff4b8 !important;
  line-height: 1;
  text-shadow: 0 0 8px #fff1a6, 0 0 16px rgba(105,255,211,.8);
  animation: personnelRegionTwinkle 1.8s ease-in-out infinite;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-region-star.star-a { top: 12px; right: 21px; font-size: 13px; }
body.theme-pro #app-screen #page-personnel-portal .personnel-region-star.star-b { left: 3px; top: 47px; font-size: 11px; animation-delay: -.7s; }
body.theme-pro #app-screen #page-personnel-portal .personnel-region-star.star-c { right: 6px; bottom: 22px; font-size: 15px; animation-delay: -1.2s; }

@keyframes personnelRegionWorld {
  from { transform: translateX(0); }
  to { transform: translateX(-120px); }
}

@keyframes personnelRegionFloat {
  0%, 100% { transform: translateY(1px) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(1deg); }
}

@keyframes personnelRegionTwinkle {
  0%, 100% { opacity: .28; transform: scale(.72) rotate(0); }
  50% { opacity: 1; transform: scale(1.2) rotate(22deg); }
}

@media (max-width: 430px) {
  body.theme-pro #app-screen #page-personnel-portal .personnel-portal-region-mini {
    min-height: 94px;
    padding: 11px 112px 11px 12px !important;
  }

  body.theme-pro #app-screen #page-personnel-portal .personnel-portal-region-copy { min-height: 70px; }
  body.theme-pro #app-screen #page-personnel-portal .personnel-region-cosmos {
    right: 2px;
    width: 104px;
    height: 104px;
  }
  body.theme-pro #app-screen #page-personnel-portal .personnel-region-globe {
    inset: 13px;
    width: 78px;
    height: 78px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-pro #app-screen #page-personnel-portal :is(.personnel-region-globe, .personnel-region-world-spin, .personnel-region-star) {
    animation: none !important;
  }
}

body.theme-pro #app-screen #page-personnel-portal .staff-hero .muted {
  color: #c2d0df !important;
  -webkit-text-fill-color: #c2d0df !important;
  opacity: 1 !important;
}

body.theme-pro #app-screen #page-personnel-portal .staff-hero-photo {
  border: 2px solid #d7b56d !important;
  box-shadow: 0 5px 0 #07131f, 0 12px 22px rgba(1, 7, 16, 0.5) !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-current-target {
  border: 1px solid rgba(224, 190, 116, 0.58) !important;
  background: linear-gradient(145deg, rgba(215, 181, 109, 0.18), rgba(20, 38, 61, 0.74)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-current-target small {
  color: #d8c89f !important;
  -webkit-text-fill-color: #d8c89f !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-current-target strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-compact-grid > .personnel-portal-primary-stat {
  color: #ffffff !important;
  border: 2px solid rgba(112, 177, 228, 0.56) !important;
  background: linear-gradient(150deg, #213b5a 0%, #172e49 100%) !important;
  box-shadow: 0 5px 0 #081725, 0 12px 21px rgba(2, 9, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-primary-stat small {
  color: #bdd1e6 !important;
  -webkit-text-fill-color: #bdd1e6 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  opacity: 1 !important;
}

body.theme-pro #app-screen #page-personnel-portal .personnel-portal-primary-stat strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
  opacity: 1 !important;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.52) !important;
}

@media (max-width: 760px) {
  body.theme-pro #app-screen #page-personnel-portal .personnel-portal-compact-grid > .personnel-portal-primary-stat {
    box-shadow: 0 3px 0 #081725, 0 8px 14px rgba(2, 9, 20, 0.38) !important;
  }
}

/* Restore the original readable mobile forms menu. The trial theme's broad
   popup text selector was turning the text on these light buttons white. */
body.theme-pro.nv-shell-dark #app-screen .personnel-forms-popover .personnel-forms-item,
body.theme-pro.nv-shell-dark #app-screen .personnel-forms-popover .personnel-forms-item :is(strong, span, small, p, label, .muted) {
  color: #0b2f5b !important;
  -webkit-text-fill-color: #0b2f5b !important;
  opacity: 1 !important;
}

body.theme-pro.nv-shell-dark #app-screen .personnel-forms-popover .personnel-forms-item {
  background:
    radial-gradient(circle at 18% 16%, rgba(141, 203, 255, 0.16) 0%, rgba(141, 203, 255, 0) 30%),
    linear-gradient(165deg, #f3f9ff 0%, #e1eefb 100%) !important;
}

/* Preserve the reference's large dark cards in a two-row horizontal lane. */
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .personnel-portal-tiles-shell {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  scroll-snap-type: x proximity !important;
  padding: 10px !important;
  background: linear-gradient(165deg, #0a2d56 0%, #124779 56%, #1a5c97 100%) !important;
  border: 1px solid rgba(84, 130, 172, 0.45) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .profile360-grid.personnel-portal-tiles-grid {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-template-columns: none !important;
  grid-template-rows: repeat(2, 112px) !important;
  grid-auto-columns: clamp(140px, 43dvw, 170px) !important;
  width: max-content !important;
  min-width: 100% !important;
  gap: 10px !important;
  padding-bottom: 4px !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .profile360-card {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 112px !important;
  padding: 9px 8px !important;
  scroll-snap-align: start !important;
  background: linear-gradient(160deg, #1b2c47 0%, #17304e 100%) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .profile360-card summary {
  min-height: 82px !important;
  align-content: center !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .profile360-card summary strong {
  font-size: clamp(0.76rem, 3.5vw, 0.86rem) !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal,
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal .profile360-card summary .muted {
  font-size: clamp(0.64rem, 3vw, 0.74rem) !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

/* The quick navigation is sticky/fixed across different phone shells. Reserve
   its full height so the portal hero always begins below it. */
body.ui-scale-phone #app-screen #page-personnel-portal {
  padding-top: 58px !important;
  scroll-padding-top: 58px !important;
}

/* The trial desktop theme gives the topbar sticky positioning with !important.
   Reassert the phone drawer states so the Settings button can open it. */
body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen .topbar {
  position: fixed !important;
  transform: translateX(calc(100% + 28px)) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar {
  top: calc(env(safe-area-inset-top, 0px) + 66px) !important;
  right: 10px !important;
  left: 10px !important;
  width: auto !important;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 82px) !important;
  transform: translateX(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 4002 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  padding: 14px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: linear-gradient(165deg, #101b2e 0%, #15243b 100%) !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar > #nv-hamb {
  display: none !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar > div:first-of-type {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px 10px !important;
  width: 100% !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar .nextviro-brand-top {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar #company-title {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar #company-title::before {
  display: none !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar .top-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 9px !important;
  width: 100% !important;
  margin: 0 !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar .top-actions > *,
body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar :is(.branch-selector, .device-scale-selector, .mobile-nav-controls, select, input, button) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #mobile-topbar-overlay {
  display: block !important;
  pointer-events: auto !important;
  z-index: 4001 !important;
}

/* PWA-safe quick navigation: keep it in document flow so it never covers the
   first fields of portal or form pages on short/narrow phones. */
body.ui-scale-phone #app-screen #mobile-quick-nav {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1300 !important;
  width: auto !important;
  max-width: calc(100% - 12px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 4px 6px 10px !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  transform: none !important;
}

body.ui-scale-phone.pwa-standalone #app-screen #mobile-quick-nav {
  top: auto !important;
  margin-top: max(52px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
}

@media (display-mode: standalone) {
  body.ui-scale-phone #app-screen #mobile-quick-nav {
    margin-top: max(52px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
  }
}

body.ui-scale-phone #app-screen #mobile-quick-nav {
  isolation: isolate !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

body.ui-scale-phone #app-screen #mobile-quick-nav > button {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(25, 87, 137, 0.16) !important;
}

body.ui-scale-phone #app-screen #mobile-quick-nav > button {
  width: calc((100% - 15px) / 4) !important;
  max-width: calc((100% - 15px) / 4) !important;
  min-width: 0 !important;
  height: clamp(40px, 11vw, 46px) !important;
  min-height: clamp(40px, 11vw, 46px) !important;
  padding: 3px 2px !important;
  gap: 3px !important;
  overflow: hidden !important;
  flex: 0 0 calc((100% - 15px) / 4) !important;
}

body.ui-scale-phone #app-screen #mobile-quick-nav :is(.personnel-fab-label, .fixed-home-btn-text) {
  min-width: 0 !important;
  font-size: clamp(0.48rem, 2.25vw, 0.58rem) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.ui-scale-phone #app-screen .layout,
body.ui-scale-phone #app-screen .content,
body.ui-scale-phone #app-screen .page {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* The bar now occupies normal flow; portal no longer needs a synthetic gap. */
body.ui-scale-phone #app-screen #page-personnel-portal {
  padding-top: 8px !important;
  scroll-padding-top: calc(54px + env(safe-area-inset-top, 0px)) !important;
}

/* Notification/forms sheets always start below the PWA quick navigation. */
body.ui-scale-phone #app-screen :is(.personnel-notify-popover, .personnel-forms-popover) {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
  right: 8px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  left: 8px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  z-index: 3500 !important;
  box-sizing: border-box !important;
}

body.ui-scale-phone #app-screen :is(.personnel-notify-list, .personnel-forms-list) {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.ui-scale-phone #app-screen #page-personnel-portal-notifications {
  padding-top: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Mobile notifications: distinct opaque 3D cards with guaranteed contrast. */
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .personnel-portal-head-note,
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card {
  color: #f7fbff !important;
  background: linear-gradient(155deg, #213957 0%, #172a44 58%, #122238 100%) !important;
  border: 2px solid rgba(105, 164, 214, 0.58) !important;
  box-shadow: 0 5px 0 #07131f, 0 13px 22px rgba(2, 9, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  opacity: 1 !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card {
  margin-bottom: 14px !important;
  padding: 13px !important;
  border-radius: 16px !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card.is-read {
  border-color: rgba(111, 151, 190, 0.48) !important;
  background: linear-gradient(155deg, #1c314c 0%, #14263e 100%) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card:is(.notice-approved, [data-notice-status="completed"]) {
  border-color: rgba(72, 201, 151, 0.7) !important;
  box-shadow: 0 5px 0 #08271e, 0 13px 22px rgba(2, 18, 14, 0.42), inset 0 1px 0 rgba(194, 255, 231, 0.13) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card :is(h1, h2, h3, h4, strong, b, p, span, label, summary, div),
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card .portal-notice-summary {
  color: #f7fbff !important;
  -webkit-text-fill-color: #f7fbff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card :is(small, .muted),
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-head > small {
  color: #bfd0e4 !important;
  -webkit-text-fill-color: #bfd0e4 !important;
  opacity: 1 !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .staff-broadcast-html-collapsed-card {
  color: #f7fbff !important;
  background: linear-gradient(155deg, #294667 0%, #203955 100%) !important;
  border: 1px solid rgba(132, 183, 225, 0.62) !important;
  box-shadow: 0 3px 0 #0b1a2b, inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .staff-broadcast-html-collapsed-card :is(strong, span) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .staff-broadcast-html-collapsed-card small {
  color: #c5d6e8 !important;
  -webkit-text-fill-color: #c5d6e8 !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card :is(.secondary-btn, .primary-btn) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(150deg, #28517a 0%, #1d3f63 100%) !important;
  border: 1px solid rgba(137, 187, 226, 0.58) !important;
}

/* Final iOS/native-shell guard: some wrappers expose neither standalone flag
   nor safe-area values. All phone layouts therefore reserve status-bar room. */
body.ui-scale-phone #app-screen #mobile-quick-nav {
  position: relative !important;
  top: auto !important;
  margin-top: max(52px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
  pointer-events: auto !important;
  z-index: 5000 !important;
}

body.ui-scale-phone #app-screen #mobile-quick-nav > button {
  pointer-events: auto !important;
  z-index: 2 !important;
}

/* Permanent mobile header architecture: one fixed bar + one measured spacer.
   JS updates the real bar height through ResizeObserver. */
body.ui-scale-phone {
  --mobile-quick-nav-height: 46px;
  --mobile-native-safe-top: 0px;
  --mobile-safe-top: max(env(safe-area-inset-top, 0px), var(--mobile-native-safe-top));
  --mobile-header-offset: calc(var(--mobile-safe-top) + var(--mobile-quick-nav-height) + 10px);
}

body.ui-scale-phone #app-screen {
  padding-top: var(--mobile-header-offset) !important;
  box-sizing: border-box !important;
}

body.ui-scale-phone #app-screen #mobile-quick-nav {
  position: fixed !important;
  top: var(--mobile-safe-top) !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(430px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  z-index: 5000 !important;
  pointer-events: auto !important;
}

body.ui-scale-phone #app-screen :is(.personnel-notify-popover, .personnel-forms-popover) {
  top: var(--mobile-header-offset) !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark.mobile-topbar-open #app-screen .topbar {
  top: var(--mobile-header-offset) !important;
  max-height: calc(100dvh - var(--mobile-header-offset) - 8px) !important;
}

body.ui-scale-phone #app-screen :is(.page, #page-personnel-portal, #page-personnel-portal-notifications) {
  padding-top: 8px !important;
  scroll-padding-top: var(--mobile-header-offset) !important;
}

/* Keep the mobile notifications popup fully opaque and readable over pages. */
body.ui-scale-phone #app-screen .personnel-notify-popover {
  background: #101c30 !important;
  opacity: 1 !important;
}

body.ui-scale-phone #app-screen .personnel-notify-popover .personnel-notify-item {
  background: #1a2941 !important;
  opacity: 1 !important;
}

body.ui-scale-phone #app-screen .personnel-notify-popover .personnel-notify-item :is(strong, span) {
  color: #f7fbff !important;
  -webkit-text-fill-color: #f7fbff !important;
}

body.ui-scale-phone #app-screen .personnel-notify-popover .personnel-notify-item :is(small, .muted) {
  color: #bfd0e4 !important;
  -webkit-text-fill-color: #bfd0e4 !important;
}

/* Task Definition mobile cards: retain useful width and scroll horizontally
   instead of crushing three desktop columns into the phone viewport. */
body.ui-scale-phone #app-screen #page-task-definition-form .task-top-grid,
body.ui-scale-phone #app-screen #page-task-definition-form .task-premium-metrics {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-template-columns: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  scroll-snap-type: x proximity !important;
  gap: 10px !important;
  padding: 2px 2px 10px !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form .task-top-grid {
  grid-auto-columns: min(78vw, 290px) !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form .task-premium-metrics {
  grid-auto-columns: min(68vw, 240px) !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form :is(.task-top-section-card, .task-premium-metric) {
  width: 100% !important;
  min-width: 0 !important;
  scroll-snap-align: start !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form .task-top-section-card {
  grid-template-columns: 40px minmax(0, 1fr) 22px !important;
  min-height: 112px !important;
  padding: 14px !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form :is(.task-top-card-copy, .task-premium-metric-head) {
  min-width: 0 !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form :is(
  .task-top-card-copy strong,
  .task-top-card-copy small,
  .task-premium-metric small,
  .task-premium-metric-detail,
  .task-premium-metric-subtitle
) {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form .task-top-card-copy strong {
  font-size: 1.05rem !important;
  line-height: 1.15 !important;
}

body.ui-scale-phone #app-screen #page-task-definition-form .task-premium-workspace,
body.ui-scale-phone #app-screen #page-task-definition-form .panel-lite {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Global mobile modal viewport standard.
   Every overlay lives below the measured fixed header and above the bottom
   safe area. Long content scrolls inside that available region. */
body.ui-scale-phone :is(
  .dashboard-card-modal-overlay,
  .staff-modal-backdrop,
  .staff-actions-modal,
  .assignment-popup-backdrop,
  .assignment-reports-popup,
  .asset-department-modal,
  .leave-setup-modal,
  .tip-payout-overlay,
  .personnel-quiz-invite-overlay,
  .staff-broadcast-overlay,
  .lodging-assign-overlay,
  .lodging-detail-overlay,
  .portal-feedback-modal-backdrop,
  .personnel-task-bucket-modal,
  .personnel-portal-form-backdrop,
  .operational-reminder-modal,
  .emirates-edit-modal,
  .branch-action-modal,
  .expense-detail-modal,
  .monthly-report-modal,
  .make-form-modal,
  .make-show-modal,
  .tech-detail-modal,
  .daily-meeting-modal
) {
  position: fixed !important;
  top: var(--mobile-header-offset) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: auto !important;
  max-height: none !important;
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  box-sizing: border-box !important;
  z-index: 4500 !important;
}

body.ui-scale-phone :is(
  .dashboard-card-modal,
  .staff-modal,
  .staff-modal-card,
  .staff-actions-modal-card,
  .assignment-popup-card,
  .asset-department-modal-card,
  .leave-setup-modal-card,
  .tip-payout-card,
  .personnel-quiz-invite-card,
  .staff-broadcast-card,
  .lodging-assign-card,
  .lodging-detailed-card,
  .lodging-detail-card,
  .portal-feedback-modal-card,
  .personnel-task-bucket-modal-card,
  .operational-reminder-modal-card,
  .emirates-edit-modal-card,
  .branch-action-modal-card,
  .expense-detail-modal-card,
  .monthly-report-modal-card
) {
  width: min(100%, 760px) !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: calc(100dvh - var(--mobile-header-offset) - env(safe-area-inset-bottom, 0px) - 16px) !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  box-sizing: border-box !important;
}

/* Staff messages that contain an HTML/performance report are documents, not
   regular cards. Keep their viewer full-height on installed PWAs. This must
   follow the generic mobile modal sizing above so the iframe does not collapse
   to its browser-default height and leave a large empty area underneath. */
body.ui-scale-phone .staff-broadcast-overlay.has-html {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: block !important;
  z-index: 10003 !important;
}

body.ui-scale-phone .staff-broadcast-overlay.has-html .staff-broadcast-card.has-html {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px)) !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

body.ui-scale-phone .staff-broadcast-overlay.has-html .staff-broadcast-popup-html {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.ui-scale-phone .dashboard-card-modal.is-fullscreen {
  width: 100% !important;
  height: calc(100dvh - var(--mobile-header-offset) - env(safe-area-inset-bottom, 0px) - 16px) !important;
  max-height: calc(100dvh - var(--mobile-header-offset) - env(safe-area-inset-bottom, 0px) - 16px) !important;
  border-radius: 14px !important;
}

body.ui-scale-phone #mobile-quick-nav {
  z-index: 5000 !important;
}

/* Dashboard detail modal: fixed shell, fixed header, independently scrolling
   body. This prevents header/body collision and background show-through. */
body.ui-scale-phone .dashboard-card-modal-overlay {
  display: flex !important;
  align-items: stretch !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
}

body.ui-scale-phone .dashboard-card-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  background: rgba(3, 9, 18, 0.88) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

body.ui-scale-phone .dashboard-card-modal {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(100%, 760px) !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  background: #111d31 !important;
  background-image: linear-gradient(165deg, #14243b 0%, #0e1a2c 100%) !important;
  border: 1px solid rgba(119, 174, 218, 0.46) !important;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.ui-scale-phone .dashboard-card-modal-head {
  position: relative !important;
  top: auto !important;
  z-index: 3 !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  background: #123654 !important;
  background-image: linear-gradient(165deg, #16466c 0%, #103552 100%) !important;
  border-bottom: 1px solid rgba(144, 196, 235, 0.42) !important;
}

body.ui-scale-phone .dashboard-card-modal-head :is(h1, h2, h3, h4, strong, span) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

body.ui-scale-phone .dashboard-card-modal .dashboard-card-detail {
  position: relative !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

body.ui-scale-phone .dashboard-card-modal.is-fullscreen {
  height: 100% !important;
  max-height: 100% !important;
}

body.ui-scale-phone .dashboard-card-modal.is-fullscreen .dashboard-card-detail {
  height: auto !important;
  max-height: none !important;
}

/* Personnel portal requests must sit above the fixed mobile action bar.
   Otherwise the last form action (notably "Send for Approval") is covered. */
body.ui-scale-phone #app-screen .personnel-portal-form-backdrop {
  position: fixed !important;
  top: var(--mobile-header-offset) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 5300 !important;
  pointer-events: auto !important;
}

body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open {
  position: fixed !important;
  top: calc(var(--mobile-header-offset) + 8px) !important;
  right: 8px !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  left: 8px !important;
  z-index: 5400 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: calc(100dvh - var(--mobile-header-offset) - env(safe-area-inset-bottom, 0px) - 16px) !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 10px !important;
  transform: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  border-radius: 16px !important;
  background: #103356 !important;
  background-image: linear-gradient(170deg, #123f6a 0%, #0f3356 100%) !important;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Leave enough scroll runway below request forms for the fixed action bar.
   The submit button can be pulled comfortably into the middle of the screen. */
body.ui-scale-phone #app-screen #page-personnel-portal #portal-section-new-request.portal-modal-open {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-top: 56px !important;
  scroll-padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
}

body.ui-scale-phone #app-screen #page-personnel-portal #portal-section-new-request.portal-modal-open .personnel-request-form {
  padding-bottom: 8px;
}

body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open .personnel-portal-modal-head {
  position: sticky !important;
  top: -10px !important;
  z-index: 3 !important;
  margin: -10px -10px 10px !important;
}

body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open.hidden,
body.ui-scale-phone #app-screen .personnel-portal-form-backdrop.hidden {
  display: none !important;
}

/* Keep portal sheets inside the centered phone preview on desktop browsers. */
@media (min-width: 761px) {
  body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open {
    left: 50vw !important;
    right: auto !important;
    width: min(var(--phone-preview-width, 430px), calc(100vw - 32px)) !important;
    max-width: min(var(--phone-preview-width, 430px), calc(100vw - 32px)) !important;
    min-width: 0 !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open,
  body.ui-scale-phone #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Animated portal ancestors must not become containing blocks for fixed sheets. */
body.personnel-portal-modal-active #app-screen #page-personnel-portal,
body.personnel-portal-modal-active #app-screen #page-personnel-portal > .stack,
body.personnel-portal-modal-active #app-screen #page-personnel-portal > .stack > *:not(.portal-modal-open) {
  transform: none !important;
  filter: none !important;
  animation: none !important;
}

body.personnel-portal-modal-active:not(.ui-scale-phone) #app-screen #page-personnel-portal .personnel-portal-section.portal-modal-open {
  left: 50vw !important;
  right: auto !important;
  width: min(760px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  transform: translate(-50%, -50%) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Make Form mobile sheets: fully opaque surfaces. The generic dark theme uses
   translucent content cards, which lets the report grid show through these
   fixed entry/report sheets and makes their controls unreadable. */
body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen #page-make-form .make-form-mobile-popup {
  top: calc(var(--mobile-header-offset, 120px) + 8px) !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  padding: 12px !important;
  opacity: 1 !important;
  background: #101a2f !important;
  background-image: none !important;
  border-color: #385170 !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.78) !important;
  isolation: isolate;
}

body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen #page-make-form .make-form-mobile-popup::before {
  background: rgba(2, 7, 16, 0.9) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  backdrop-filter: blur(5px) !important;
  opacity: 1 !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen #page-make-form .make-form-mobile-popup-head {
  background: #13233d !important;
  background-image: none !important;
  border-bottom-color: #385170 !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen #page-make-form .make-form-mobile-popup :is(
  .panel-lite,
  .make-form-selected-logic,
  .make-form-entry-checklist,
  .make-form-checklist-row,
  .make-form-report-card-btn,
  .make-form-entry-accordion
) {
  opacity: 1 !important;
  background: #18243b !important;
  background-image: none !important;
  border-color: #3b4e6b !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark #app-screen #page-make-form .make-form-mobile-popup :is(input, select, textarea) {
  opacity: 1 !important;
  background: #0b1425 !important;
  color: #f4f7fb !important;
  border-color: #60728e !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark .make-form-filter-overlay {
  z-index: 10030 !important;
  padding: calc(var(--mobile-header-offset, 120px) + 8px) 8px calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  align-items: flex-start !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark .make-form-filter-backdrop {
  background: rgba(2, 7, 16, 0.9) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  backdrop-filter: blur(5px) !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark .make-form-filter-modal {
  max-height: calc(100dvh - var(--mobile-header-offset, 120px) - env(safe-area-inset-bottom, 0px) - 16px) !important;
  opacity: 1 !important;
  background: #101a2f !important;
  background-image: none !important;
  border-color: #385170 !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.78) !important;
}

body.ui-scale-phone.theme-pro.nv-shell-dark .make-form-filter-modal :is(input, select, textarea) {
  opacity: 1 !important;
  background: #0b1425 !important;
  color: #f4f7fb !important;
  border-color: #60728e !important;
}

/* AI message cards keep the approved orb treatment above the generic mobile
   notification-card theme. */
body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card.is-ai-voice-notice {
  overflow: hidden !important;
  border-color: rgba(89, 205, 255, 0.62) !important;
  background: linear-gradient(155deg, #102a48 0%, #0b1e36 54%, #11182f 100%) !important;
  box-shadow: 0 5px 0 #050d18, 0 18px 38px rgba(0, 7, 22, 0.55), inset 0 1px 0 rgba(222, 248, 255, 0.12) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card.is-ai-voice-notice .personnel-ai-notice-kicker {
  color: #6cdcff !important;
  -webkit-text-fill-color: #6cdcff !important;
  text-shadow: 0 0 14px rgba(69, 207, 255, 0.35) !important;
}

body.ui-scale-phone.theme-pro #app-screen #page-personnel-portal-notifications .portal-notice-card.is-ai-voice-notice .personnel-ai-notice-orb {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
