:root{
  --ms-navy:#102a43;
  --ms-navy-2:#173f5f;
  --ms-green:#2f6b5b;
  --ms-green-dark:#245548;
  --ms-green-soft:#eaf4f0;
  --ms-blue:#3c6e91;
  --ms-blue-soft:#edf5fa;
  --ms-bg:#f4f7f8;
  --ms-surface:#ffffff;
  --ms-surface-2:#f8fafb;
  --ms-border:#dce5e8;
  --ms-text:#172b35;
  --ms-muted:#667b85;
  --ms-success:#287a55;
  --ms-success-soft:#e9f6ef;
  --ms-warning:#a66a13;
  --ms-warning-soft:#fff5df;
  --ms-danger:#a23d48;
  --ms-danger-soft:#fcecef;
  --ms-shadow:0 10px 35px rgba(16,42,67,.07);
  --ms-shadow-hover:0 16px 42px rgba(16,42,67,.11);
  --ms-radius:18px;
}

html{
  background:var(--ms-bg);
}

body{
  margin:0;
  color:var(--ms-text);
  background:
    radial-gradient(circle at 5% 0%,rgba(47,107,91,.08),transparent 30%),
    radial-gradient(circle at 95% 5%,rgba(60,110,145,.07),transparent 27%),
    var(--ms-bg);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

body::before{
  content:"";
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:4px;
  background:linear-gradient(90deg,var(--ms-green),var(--ms-blue),var(--ms-navy));
  z-index:9000;
}

main{
  width:100%;
  max-width:1180px;
  margin:0 auto;
  padding:30px 24px 60px;
}

.card{
  position:relative;
  background:rgba(255,255,255,.97);
  border:1px solid var(--ms-border);
  border-radius:var(--ms-radius);
  padding:26px;
  margin:18px 0;
  box-shadow:var(--ms-shadow);
  overflow:hidden;
}

.card.brand{
  border-top:0;
}

.card.brand::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  background:linear-gradient(180deg,var(--ms-green),var(--ms-blue));
}

h1,h2,h3{
  color:var(--ms-navy);
  letter-spacing:-.025em;
}

h1{
  margin:10px 0 8px;
  font-size:clamp(1.8rem,4vw,2.6rem);
  line-height:1.08;
  font-weight:780;
}

h2{
  margin:4px 0 16px;
  font-size:1.35rem;
  font-weight:750;
}

h3{
  font-size:1.05rem;
  font-weight:730;
}

p{
  line-height:1.6;
}

.muted{
  color:var(--ms-muted);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:28px;
  padding:6px 11px;
  border-radius:999px;
  background:var(--ms-green-soft);
  color:var(--ms-green-dark);
  border:1px solid rgba(47,107,91,.12);
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.tile{
  position:relative;
  min-height:145px;
  padding:20px;
  background:linear-gradient(145deg,#fff,var(--ms-surface-2));
  border:1px solid var(--ms-border);
  border-radius:15px;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

.tile:hover{
  transform:translateY(-2px);
  border-color:#c6d5da;
  box-shadow:var(--ms-shadow-hover);
}

button{
  appearance:none;
  min-height:44px;
  padding:11px 17px;
  margin:4px 4px 4px 0;
  border:1px solid transparent;
  border-radius:11px;
  background:linear-gradient(135deg,var(--ms-green),var(--ms-green-dark));
  color:#fff;
  font:inherit;
  font-size:.91rem;
  font-weight:750;
  letter-spacing:.005em;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(36,85,72,.13);
  transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;
}

button:hover{
  transform:translateY(-1px);
  box-shadow:0 7px 18px rgba(36,85,72,.18);
}

button:active{
  transform:translateY(0);
}

button:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

button.secondary{
  background:#fff;
  color:var(--ms-navy);
  border-color:#cfdce1;
  box-shadow:none;
}

button.secondary:hover{
  background:#f7fafb;
}

button.danger{
  background:var(--ms-danger);
}

button.approve{
  background:var(--ms-success);
}

label{
  display:block;
  margin-top:7px;
  color:#334d58;
  font-size:.86rem;
  font-weight:720;
}

input,select,textarea{
  width:100%;
  min-height:46px;
  margin:7px 0 15px;
  padding:11px 13px;
  border:1px solid #ccd9de;
  border-radius:11px;
  outline:none;
  background:#fff;
  color:var(--ms-text);
  font:inherit;
  transition:border-color .15s ease,box-shadow .15s ease;
}

textarea{
  min-height:105px;
  resize:vertical;
}

input:focus,select:focus,textarea:focus{
  border-color:#6b9c8c;
  box-shadow:0 0 0 4px rgba(47,107,91,.10);
}

.status{
  margin:12px 0;
  padding:16px 18px;
  border:1px solid transparent;
  border-radius:13px;
}

.status.approved,.approved{
  background:var(--ms-success-soft);
  border-color:#cde8d8;
}

.status.pending,.pending{
  background:var(--ms-warning-soft);
  border-color:#eedba9;
}

.status.denied,.denied{
  background:var(--ms-danger-soft);
  border-color:#efcbd0;
}

.row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}

.item{
  padding:16px 0;
  border-top:1px solid #e5ecef;
}

.big{
  margin-top:3px;
  color:var(--ms-navy);
  font-size:1.42rem;
  line-height:1.25;
  font-weight:780;
}

table{
  background:#fff;
  border-radius:12px;
}

th{
  color:var(--ms-navy);
  background:#f4f8f9;
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.05em;
}

th,td{
  padding:12px !important;
}

.ms-enter{
  background:linear-gradient(135deg,var(--ms-green),var(--ms-navy-2)) !important;
}

.ms-enter:hover{
  box-shadow:0 12px 28px rgba(36,85,72,.24) !important;
}

.ms-splash-title{
  color:var(--ms-navy) !important;
}

.ms-splash{
  background:
    radial-gradient(circle at 50% 18%,rgba(255,255,255,.95),transparent 34%),
    linear-gradient(145deg,#f2f8f5 0%,#e4f0eb 52%,#d5e5df 100%) !important;
}

/* Enterprise utility components for upcoming screens */

.ms-eyebrow{
  color:var(--ms-green);
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.ms-page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}

.ms-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:18px 0;
}

.ms-kpi{
  padding:18px;
  border:1px solid var(--ms-border);
  border-radius:15px;
  background:#fff;
}

.ms-kpi-value{
  color:var(--ms-navy);
  font-size:1.8rem;
  font-weight:820;
}

.ms-kpi-label{
  margin-top:3px;
  color:var(--ms-muted);
  font-size:.78rem;
  font-weight:700;
}

.ms-level{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  margin:8px 0;
  border:1px solid var(--ms-border);
  border-radius:13px;
  background:#fff;
}

.ms-level-code{
  min-width:62px;
  color:var(--ms-navy);
  font-weight:850;
}

.ms-level-name{
  flex:1;
  font-weight:720;
}

.ms-level-detail{
  color:var(--ms-muted);
  font-size:.82rem;
}

.ms-profile-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.ms-profile-stat{
  padding:16px;
  border:1px solid var(--ms-border);
  border-radius:13px;
  background:var(--ms-surface-2);
}

.ms-profile-stat small{
  display:block;
  margin-bottom:5px;
  color:var(--ms-muted);
  font-weight:700;
}

.ms-profile-stat strong{
  color:var(--ms-navy);
  font-size:1.15rem;
}

@media(max-width:850px){
  .ms-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:600px){
  main{
    padding:14px 11px 40px;
  }

  .card{
    padding:18px;
    margin:12px 0;
    border-radius:15px;
  }

  .grid,.ms-profile-grid,.ms-kpi-grid{
    grid-template-columns:1fr;
  }

  .row,.ms-page-header{
    flex-direction:column;
    align-items:stretch;
  }

  .tile{
    min-height:0;
  }

  button{
    width:100%;
    margin:4px 0;
  }

  h1{
    font-size:1.75rem;
  }
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto !important;
    transition:none !important;
    animation:none !important;
  }
}

/* =========================================================
   MOBILITY SAFE — ANIMATED LAUNCH EXPERIENCE
   ========================================================= */

.ms-launch {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%,
      rgba(112,170,145,.18),
      transparent 38%),
    linear-gradient(145deg,#10261f 0%,#173c30 50%,#0b1e19 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity .65s ease,
    visibility .65s ease;
}

.ms-launch.ms-launch-exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ms-launch-content {
  position: relative;
  z-index: 3;
  width: min(90vw,560px);
  text-align: center;
  transform: translateY(12px);
  opacity: 0;
  animation: msLaunchContent .7s ease .15s forwards;
}

.ms-launch-signal {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-launch-signal > span {
  position: absolute;
  border: 1px solid rgba(181,225,205,.38);
  border-radius: 50%;
  opacity: 0;
  animation: msNfcPulse 2.2s ease-out infinite;
}

.ms-launch-signal > span:nth-child(1) {
  width: 100px;
  height: 100px;
}

.ms-launch-signal > span:nth-child(2) {
  width: 135px;
  height: 135px;
  animation-delay: .45s;
}

.ms-launch-signal > span:nth-child(3) {
  width: 170px;
  height: 170px;
  animation-delay: .9s;
}

.ms-launch-logo {
  position: relative;
  z-index: 4;
  width: 94px;
  height: 94px;
  padding: 9px;
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow:
    0 18px 55px rgba(0,0,0,.28),
    0 0 45px rgba(129,203,168,.18);
  animation: msLogoFloat 2.5s ease-in-out infinite;
}

.ms-launch-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 17px;
}

.ms-launch-kicker {
  margin-bottom: 10px;
  color: #9bcdb6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
}

.ms-launch-brand h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px,7vw,54px);
  font-weight: 800;
  letter-spacing: .055em;
  line-height: 1;
}

.ms-launch-line {
  width: 0;
  height: 2px;
  margin: 19px auto 17px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    transparent,
    #a9d9c3,
    transparent
  );
  animation: msLaunchLine 1s ease .55s forwards;
}

.ms-launch-brand p {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 17px;
  letter-spacing: .025em;
  opacity: 0;
  animation: msLaunchText .7s ease .75s forwards;
}

.ms-launch-status {
  margin-top: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.52);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  opacity: 0;
  animation: msLaunchText .6s ease 1.05s forwards;
}

.ms-launch-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9dd4ba;
  box-shadow: 0 0 12px rgba(157,212,186,.8);
  animation: msStatusPulse 1.1s ease-in-out infinite;
}

.ms-launch-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}

.ms-launch-glow-one {
  width: 330px;
  height: 330px;
  background: #76b99b;
  top: -100px;
  right: -100px;
  animation: msGlowMove 5s ease-in-out infinite alternate;
}

.ms-launch-glow-two {
  width: 300px;
  height: 300px;
  background: #7fae9a;
  bottom: -120px;
  left: -90px;
  animation: msGlowMove 6s ease-in-out infinite alternate-reverse;
}

@keyframes msLaunchContent {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes msNfcPulse {
  0% {
    transform: scale(.68);
    opacity: 0;
  }
  22% {
    opacity: .7;
  }
  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

@keyframes msLogoFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.025); }
}

@keyframes msLaunchLine {
  to { width: 180px; }
}

@keyframes msLaunchText {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes msStatusPulse {
  0%,100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes msGlowMove {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(35px,25px,0); }
}

@media (prefers-reduced-motion: reduce) {
  .ms-launch *,
  .ms-launch *::before,
  .ms-launch *::after {
    animation: none !important;
  }

  .ms-launch-content,
  .ms-launch-brand p,
  .ms-launch-status {
    opacity: 1;
    transform: none;
  }

  .ms-launch-line {
    width: 180px;
  }
}



/* =========================================================
   MOBILITY SAFE — CLINICAL GREEN NAVIGATION HIERARCHY
   ========================================================= */

.ms-welcome-card{
  min-height:min(720px,82vh);
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 50% 12%,
      rgba(255,255,255,.95),
      transparent 34%),
    linear-gradient(145deg,
      #edf7f2 0%,
      #dfeee7 48%,
      #cfe3d9 100%) !important;
  border:1px solid rgba(54,103,84,.18) !important;
}

.ms-welcome-inner{
  width:min(720px,100%);
  margin:auto;
  text-align:center;
  padding:34px 18px;
}

.ms-welcome-title{
  font-size:clamp(2.6rem,8vw,4.8rem);
  margin:8px 0 4px;
}

.ms-welcome-copy{
  font-size:1.2rem;
  font-weight:800;
  color:var(--ms-green,#426d5d);
  margin:0 0 12px;
}

.ms-welcome-description{
  max-width:620px;
  margin:0 auto 28px;
  font-size:1rem;
}

.ms-primary-login{
  width:min(420px,100%);
  min-height:58px;
  font-size:1.05rem;
  margin:12px auto;
  background:
    linear-gradient(
      135deg,
      var(--ms-green,#426d5d),
      #315849
    ) !important;
}

.ms-welcome-secondary{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:12px;
}

.ms-welcome-footer{
  text-align:center;
  color:#60756c;
  font-size:.78rem;
  padding:10px 0 28px;
}

/* Stronger clinical grouping without overwhelming the screen */
.card:not(.brand){
  border-top:3px solid rgba(66,109,93,.20);
}

.card h2,
.card h3{
  position:relative;
}

.card h2::after{
  content:"";
  display:block;
  width:44px;
  height:3px;
  margin-top:7px;
  border-radius:999px;
  background:rgba(66,109,93,.45);
}

label{
  color:#315849;
  font-weight:750;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#426d5d !important;
  box-shadow:0 0 0 3px rgba(66,109,93,.12) !important;
}

.item{
  border-left:3px solid rgba(66,109,93,.18);
}

.item:hover{
  border-left-color:#426d5d;
}

.status.approved{
  border-left:5px solid #426d5d;
}

@media(max-width:700px){
  .ms-welcome-card{
    min-height:74vh;
  }

  .ms-welcome-secondary{
    display:grid;
    grid-template-columns:1fr;
  }
}



/* =========================================================
   MOBILITY SAFE — EMERGENCY ALERT SYSTEM
   ========================================================= */

.ms-emergency-home {
  border: 2px solid #b42318 !important;
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fff4f2 100%
    ) !important;
}

.ms-emergency-home h3 {
  color: #8f1d16;
}

.ms-emergency-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.ms-emergency-send {
  background: #b42318 !important;
  border-color: #b42318 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

.ms-emergency-card {
  border-top: 6px solid #b42318 !important;
}

.ms-emergency-warning {
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  background: #fff3f2;
  border: 1px solid #f3b8b2;
  color: #7a1b15;
}

.ms-active-emergency {
  border: 3px solid #b42318 !important;
  background: #fff8f7 !important;
}

.ms-all-clear {
  border: 3px solid #2f6f55 !important;
  background: #f2faf6 !important;
}

.ms-emergency-ack {
  background: #8f1d16 !important;
  color: #ffffff !important;
}

.ms-all-clear-button {
  border: 2px solid #2f6f55 !important;
  color: #245c46 !important;
  font-weight: 800 !important;
}

.ms-emergency-list-item {
  border-left: 6px solid #b42318 !important;
}

/* Stronger green separation for normal Mobility Safe fields */

.card label {
  color: #245c46;
  font-weight: 700;
}

.card input,
.card select,
.card textarea {
  border-color: #9fc9b5;
}

.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: #2f6f55;
  box-shadow: 0 0 0 3px rgba(47,111,85,.12);
}

@media (max-width:700px) {

  .ms-emergency-send,
  .ms-emergency-ack,
  .ms-all-clear-button {
    width: 100%;
    min-height: 54px;
    font-size: 1rem;
  }

}


/* =========================================================
   MOBILITY SAFE — IMPULSE ENTRY
   ========================================================= */

.ms-impulse-screen{
  position:relative;
  min-height:calc(100vh - 20px);
  width:100%;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(71,133,104,.26),
      transparent 28%
    ),
    linear-gradient(
      135deg,
      #183f32 0%,
      #0d2e25 100%
    );
  border-radius:0;
}

.ms-impulse-glow{
  position:absolute;
  width:420px;
  height:420px;
  border-radius:50%;
  background:
    radial-gradient(
      circle,
      rgba(84,164,126,.16),
      transparent 68%
    );
  animation:
    msImpulseGlow 3.6s ease-in-out infinite;
}

.ms-impulse-center{
  position:relative;
  z-index:2;
  text-align:center;
  width:min(640px,90%);
  color:white;
}

.ms-impulse-icon img{
  width:82px;
  height:82px;
  object-fit:contain;
  border-radius:20px;
  padding:10px;
  background:white;
  box-shadow:
    0 12px 35px rgba(0,0,0,.18);
}

.ms-impulse-eyebrow{
  margin-top:38px;
  font-size:.72rem;
  letter-spacing:.3em;
  font-weight:800;
  color:#9fcdb8;
}

.ms-impulse-center h1{
  margin:14px 0 8px;
  color:white;
  font-size:clamp(
    2.6rem,
    7vw,
    4rem
  );
  letter-spacing:.08em;
}

.ms-impulse-line{
  width:72px;
  height:2px;
  margin:16px auto;
  background:
    rgba(159,205,184,.6);
}

.ms-impulse-center p{
  color:#aac5b8;
  font-size:1rem;
}

.ms-impulse-access{
  margin-top:32px;
  min-width:280px;
  max-width:420px;
  width:70%;
  min-height:56px;
  border:1px solid
    rgba(255,255,255,.2) !important;
  background:
    linear-gradient(
      135deg,
      #3d8067,
      #174e3e
    ) !important;
  color:white !important;
  font-weight:850 !important;
  letter-spacing:.05em;
}

@keyframes msImpulseGlow{
  0%,100%{
    transform:scale(.92);
    opacity:.65;
  }

  50%{
    transform:scale(1.08);
    opacity:1;
  }
}

@media(max-width:700px){

  .ms-impulse-screen{
    min-height:100vh;
  }

  .ms-impulse-icon img{
    width:72px;
    height:72px;
  }

  .ms-impulse-access{
    width:100%;
  }

}


/* =========================================================
   MOBILITY SAFE — COMPACT PHONE / TABLET HOME
   Desktop enterprise UI remains unchanged.
   ========================================================= */

.ms-mobile-shell{
  display:none;
}

@media(max-width:1024px){

  body{
    padding-bottom:
      env(safe-area-inset-bottom);
  }

  .ms-mobile-shell{
    display:block;
    width:100%;
    max-width:760px;
    margin:0 auto;
    padding:
      20px
      18px
      calc(100px + env(safe-area-inset-bottom));
  }

  .ms-mobile-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
  }

  .ms-mobile-eyebrow{
    font-size:.7rem;
    font-weight:850;
    letter-spacing:.18em;
    color:#39745c;
  }

  .ms-mobile-header h1{
    margin:4px 0 0;
    font-size:1.65rem;
  }

  .ms-mobile-header p{
    margin:3px 0 0;
    color:#68766f;
  }

  .ms-mobile-header-actions{
    display:flex;
    align-items:center;
  }

  .ms-mobile-status{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 16px;
    margin-bottom:24px;
    border:1px solid #b9d7c8;
    border-radius:16px;
    background:#f1f8f4;
  }

  .ms-mobile-status-dot{
    flex:0 0 auto;
    width:11px;
    height:11px;
    border-radius:50%;
    background:#32815e;
    box-shadow:
      0 0 0 5px rgba(50,129,94,.12);
  }

  .ms-mobile-status strong,
  .ms-mobile-status span{
    display:block;
  }

  .ms-mobile-status span{
    margin-top:2px;
    font-size:.78rem;
    color:#607168;
  }

  .ms-mobile-section{
    margin-bottom:26px;
  }

  .ms-mobile-section-title{
    margin:
      0
      0
      10px
      2px;
    font-size:.74rem;
    font-weight:850;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:#557166;
  }

  .ms-mobile-primary-action,
  .ms-mobile-list-action{
    width:100%;
    min-height:76px;
    display:flex;
    align-items:center;
    gap:14px;
    text-align:left;
    padding:15px 16px !important;
    border:1px solid #b8d4c7 !important;
    border-radius:18px !important;
    background:#fff !important;
    color:#173c30 !important;
    box-shadow:
      0 7px 22px rgba(21,60,47,.06);
  }

  .ms-mobile-primary-action > span:nth-child(2),
  .ms-mobile-list-action > span:first-child{
    flex:1;
  }

  .ms-mobile-primary-action strong,
  .ms-mobile-primary-action small,
  .ms-mobile-list-action strong,
  .ms-mobile-list-action small{
    display:block;
  }

  .ms-mobile-primary-action small,
  .ms-mobile-list-action small{
    margin-top:4px;
    color:#728079;
    font-weight:500;
  }

  .ms-mobile-action-grid{
    display:grid;
    grid-template-columns:
      repeat(2,minmax(0,1fr));
    gap:12px;
  }

  .ms-mobile-action-card{
    min-height:142px;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:flex-start;
    text-align:left;
    padding:17px !important;
    border:1px solid #bfd8cc !important;
    border-radius:18px !important;
    background:#fff !important;
    color:#173c30 !important;
    box-shadow:
      0 6px 20px rgba(21,60,47,.055);
  }

  .ms-mobile-action-card strong{
    margin-top:13px;
    line-height:1.15;
  }

  .ms-mobile-action-card small{
    display:block;
    margin-top:6px;
    color:#748079;
    line-height:1.3;
  }

  .ms-mobile-action-icon{
    width:38px;
    height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:#e7f3ed;
    color:#245f49;
    font-size:1.15rem;
    font-weight:900;
  }

  .ms-mobile-emergency{
    border-color:#e3b0aa !important;
    background:#fff8f7 !important;
  }

  .ms-mobile-emergency
  .ms-mobile-action-icon{
    background:#fbe3e0;
    color:#9b2c22;
  }

  .ms-mobile-chevron{
    flex:0 0 auto !important;
    font-size:2rem;
    font-weight:300;
    color:#769084;
  }

  .ms-mobile-safe-space{
    height:25px;
  }

  .ms-mobile-bottom-nav{
    position:fixed;
    z-index:90;
    left:0;
    right:0;
    bottom:0;
    min-height:72px;
    display:grid;
    grid-template-columns:
      repeat(4,1fr);
    padding:
      8px
      max(8px,env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      max(8px,env(safe-area-inset-left));
    border-top:1px solid #d4e1db;
    background:
      rgba(255,255,255,.96);
    backdrop-filter:blur(16px);
    box-shadow:
      0 -8px 25px rgba(19,58,44,.07);
  }

  .ms-mobile-bottom-nav button{
    min-width:0;
    min-height:52px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:5px !important;
    border:0 !important;
    background:transparent !important;
    color:#708078 !important;
    box-shadow:none !important;
    font-size:.68rem;
    font-weight:750;
  }

  .ms-mobile-bottom-nav button span{
    display:block;
    font-size:1.25rem;
  }

  .ms-mobile-bottom-nav button.active{
    color:#245f49 !important;
  }

}


/* Phone refinement */

@media(max-width:520px){

  .ms-mobile-shell{
    padding-left:14px;
    padding-right:14px;
  }

  .ms-mobile-action-card{
    min-height:135px;
    padding:15px !important;
  }

  .ms-mobile-header h1{
    font-size:1.45rem;
  }

}


/* iPad refinement */

@media(
  min-width:700px
) and (
  max-width:1024px
){

  .ms-mobile-shell{
    padding-top:30px;
  }

  .ms-mobile-action-grid{
    gap:16px;
  }

  .ms-mobile-action-card{
    min-height:155px;
  }

}


/* =========================================================
   MOBILITY SAFE — FACILITY KEY ACCESS
   ========================================================= */

.ms-facility-access-screen{
  max-width:720px;
  margin:30px auto;
  overflow:hidden;
  border-radius:24px;
  background:#fff;
  box-shadow:
    0 20px 55px rgba(11,54,43,.12);
  border:1px solid rgba(22,95,73,.12);
}

.ms-facility-access-top{
  padding:54px 48px 46px;
  text-align:center;
  color:#fff;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(72,180,125,.22),
      transparent 48%
    ),
    linear-gradient(
      145deg,
      #073c2e,
      #0b503b
    );
}

.ms-facility-access-icon{
  width:82px;
  height:82px;
  margin:0 auto 24px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:22px;
  background:#fff;
  box-shadow:
    0 12px 28px rgba(0,0,0,.18);
}

.ms-facility-access-icon img{
  width:58px;
  height:58px;
}

.ms-facility-access-top .ms-eyebrow{
  color:#75d29e;
  font-weight:800;
  letter-spacing:.2em;
  font-size:.78rem;
}

.ms-facility-access-top h1{
  margin:12px 0 10px;
  color:#fff;
  font-size:2rem;
}

.ms-facility-access-top p{
  max-width:440px;
  margin:0 auto;
  color:rgba(255,255,255,.78);
  line-height:1.6;
}

.ms-facility-access-form{
  padding:42px 48px 46px;
}

.ms-facility-access-form label{
  display:block;
  margin-bottom:9px;
  color:#102d27;
  font-weight:800;
}

.ms-facility-access-form input{
  width:100%;
  box-sizing:border-box;
  min-height:58px;
  padding:0 18px;
  margin-bottom:18px;
  border:2px solid rgba(30,111,81,.20);
  border-radius:12px;
  background:#f8fbf9;
  font-size:1rem;
}

.ms-facility-access-form input:focus{
  outline:none;
  border-color:#2d8a64;
  box-shadow:
    0 0 0 4px rgba(45,138,100,.12);
}

.ms-facility-access-form #combinedLoginBtn{
  width:100%;
  min-height:58px;
  font-weight:900;
  letter-spacing:.04em;
  background:
    linear-gradient(
      90deg,
      #29935f,
      #08704c
    );
}

.ms-facility-help{
  margin-top:22px;
  text-align:center;
}

@media(max-width:700px){

  .ms-facility-access-screen{
    margin:0;
    max-width:none;
    min-height:100vh;
    border:0;
    border-radius:0;
  }

  .ms-facility-access-top{
    padding:
      max(48px,8vh)
      24px
      42px;
  }

  .ms-facility-access-form{
    padding:34px 24px;
  }

}


/* =========================================================
   MOBILITY SAFE — AUTO INTRO TRANSITION
   ========================================================= */

.ms-auto-entry-status{
  margin-top:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:rgba(255,255,255,.76);
  font-size:.86rem;
  font-weight:700;
  letter-spacing:.04em;
}

.ms-auto-entry-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#78d7a2;
  box-shadow:0 0 0 0 rgba(120,215,162,.55);
  animation:msAutoEntryPulse 1.5s infinite;
}

@keyframes msAutoEntryPulse{
  0%{
    box-shadow:0 0 0 0 rgba(120,215,162,.55);
  }

  70%{
    box-shadow:0 0 0 9px rgba(120,215,162,0);
  }

  100%{
    box-shadow:0 0 0 0 rgba(120,215,162,0);
  }
}



/* =========================================================
   MOBILITY SAFE — B7 BAND LOCATOR
   ========================================================= */

@media(max-width:1024px){

  .ms-locator-shell{
    padding-bottom:105px;
  }

  .ms-locator-search-card,
  .ms-locator-result-card{
    margin:0 0 18px;
    padding:20px;
    border:1px solid #d7e4de;
    border-radius:22px;
    background:#ffffff;
    box-shadow:0 10px 28px rgba(19,58,44,.07);
  }

  .ms-locator-search-card h2,
  .ms-locator-result-card h2{
    margin:5px 0 7px;
    color:#163d30;
  }

  .ms-locator-description{
    margin:0 0 18px;
    color:#708078;
    line-height:1.5;
  }

  .ms-locator-search-card label{
    display:block;
    margin:14px 0 7px;
    color:#365b4c;
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.04em;
  }

  .ms-locator-search-card input{
    width:100%;
    min-height:52px;
    box-sizing:border-box;
    border:1px solid #cadbd3;
    border-radius:14px;
    background:#f9fcfa;
  }

  .ms-locator-find-button{
    width:100%;
    min-height:54px;
    margin-top:18px;
    border-radius:15px !important;
    font-weight:850 !important;
  }

  .ms-locator-find-button span{
    margin-right:7px;
    font-size:1.15rem;
  }

  .ms-locator-message{
    min-height:20px;
    margin:12px 0 0;
    font-size:.84rem;
    line-height:1.4;
  }

  .ms-locator-message.error{
    color:#9b2c22;
  }

  .ms-locator-message.ready{
    color:#245f49;
  }

  .ms-locator-result-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
  }

  .ms-locator-status{
    flex:0 0 auto;
    padding:7px 9px;
    border-radius:999px;
    font-size:.62rem;
    font-weight:900;
    letter-spacing:.05em;
  }

  .ms-locator-status.pending{
    background:#fff3d8;
    color:#846016;
  }

  .ms-locator-radar{
    position:relative;
    width:210px;
    height:210px;
    margin:22px auto;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .ms-locator-ring{
    position:absolute;
    border:1px solid rgba(36,95,73,.18);
    border-radius:50%;
  }

  .ms-locator-ring.ring-3{
    width:200px;
    height:200px;
  }

  .ms-locator-ring.ring-2{
    width:140px;
    height:140px;
  }

  .ms-locator-ring.ring-1{
    width:80px;
    height:80px;
  }

  .ms-locator-band-dot{
    position:relative;
    z-index:2;
    width:56px;
    height:56px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#e6f3ed;
    color:#245f49;
    font-size:1.55rem;
    box-shadow:0 8px 20px rgba(36,95,73,.14);
  }

  .ms-locator-stats{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
  }

  .ms-locator-stats div{
    padding:13px;
    border:1px solid #deebe5;
    border-radius:14px;
    background:#f8fbf9;
  }

  .ms-locator-stats span,
  .ms-locator-stats strong{
    display:block;
  }

  .ms-locator-stats span{
    margin-bottom:5px;
    color:#75847d;
    font-size:.7rem;
    font-weight:750;
  }

  .ms-locator-stats strong{
    color:#173e31;
    font-size:.95rem;
  }

  .ms-locator-note{
    margin-top:14px;
    padding:14px;
    border-radius:14px;
    background:#f2f7f4;
  }

  .ms-locator-note strong,
  .ms-locator-note span{
    display:block;
  }

  .ms-locator-note strong{
    margin-bottom:4px;
    color:#245f49;
    font-size:.82rem;
  }

  .ms-locator-note span{
    color:#6f7e77;
    font-size:.76rem;
    line-height:1.45;
  }

}

@media(max-width:520px){

  .ms-locator-search-card,
  .ms-locator-result-card{
    padding:17px;
    border-radius:19px;
  }

  .ms-locator-radar{
    width:180px;
    height:180px;
  }

  .ms-locator-ring.ring-3{
    width:170px;
    height:170px;
  }

  .ms-locator-ring.ring-2{
    width:118px;
    height:118px;
  }

  .ms-locator-ring.ring-1{
    width:70px;
    height:70px;
  }

}



/* =========================================================
   MOBILITY SAFE — UNIFIED SAFETY ALERT CENTER
   ========================================================= */

@media(max-width:1024px){

  .ms-safety-shell{
    padding-bottom:105px;
  }

  .ms-safety-status-card{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:22px;
    padding:15px;
    border:1px solid #d7e4de;
    border-radius:18px;
    background:#fff;
    box-shadow:0 8px 22px rgba(19,58,44,.06);
  }

  .ms-safety-status-icon{
    width:38px;
    height:38px;
    flex:0 0 38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#e6f3ed;
    color:#245f49;
    font-weight:900;
  }

  .ms-safety-status-card div:nth-child(2){
    min-width:0;
    flex:1;
  }

  .ms-safety-status-card strong,
  .ms-safety-status-card span{
    display:block;
  }

  .ms-safety-status-card strong{
    color:#173e31;
  }

  .ms-safety-status-card div:nth-child(2) span{
    margin-top:2px;
    color:#78877f;
    font-size:.72rem;
  }

  .ms-safety-hardware{
    flex:0 0 auto;
    padding:6px 8px;
    border-radius:999px;
    background:#fff3d8;
    color:#846016 !important;
    font-size:.58rem !important;
    font-weight:900;
  }

  .ms-safety-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
  }

  .ms-safety-card{
    position:relative;
    min-height:150px;
    display:flex !important;
    flex-direction:column;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    padding:17px !important;
    border-radius:18px !important;
    text-align:left !important;
    box-shadow:none !important;
  }

  .ms-safety-card strong,
  .ms-safety-card small{
    display:block;
  }

  .ms-safety-card strong{
    margin-top:13px;
    font-size:.95rem;
  }

  .ms-safety-card small{
    margin-top:5px;
    line-height:1.35;
    opacity:.78;
  }

  .ms-safety-sos{
    border:1px solid #efc8c3 !important;
    background:#fff8f7 !important;
    color:#8d2920 !important;
  }

  .ms-safety-fall{
    border:1px solid #ead8ae !important;
    background:#fffbf2 !important;
    color:#755719 !important;
  }

  .ms-safety-icon{
    min-width:42px;
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 7px;
    border-radius:12px;
    background:rgba(255,255,255,.75);
    font-size:.8rem;
    font-weight:950;
  }

  .ms-safety-test-label{
    position:absolute;
    top:12px;
    right:12px;
    padding:4px 6px;
    border-radius:999px;
    background:rgba(255,255,255,.85);
    font-size:.52rem;
    font-weight:950;
    letter-spacing:.05em;
  }

  .ms-safety-test-panel,
  .ms-safety-live-card{
    margin:18px 0;
    padding:20px;
    border:1px solid #d7e4de;
    border-radius:20px;
    background:#fff;
    box-shadow:0 10px 28px rgba(19,58,44,.07);
  }

  .ms-safety-test-panel[hidden],
  .ms-safety-live-card[hidden]{
    display:none !important;
  }

  .ms-safety-test-panel h2{
    margin:5px 0 15px;
    color:#173e31;
  }

  .ms-safety-test-panel label{
    display:block;
    margin:13px 0 6px;
    color:#365b4c;
    font-size:.76rem;
    font-weight:800;
  }

  .ms-safety-test-panel input{
    width:100%;
    min-height:50px;
    box-sizing:border-box;
    border:1px solid #cadbd3;
    border-radius:13px;
    background:#f9fcfa;
  }

  .ms-safety-simulation-warning{
    margin:15px 0;
    padding:11px;
    border-radius:11px;
    background:#f3f6f4;
    color:#68776f;
    font-size:.72rem;
    line-height:1.4;
  }

  .ms-safety-live-card.sos{
    border-color:#e7b4ae;
    background:#fffafa;
  }

  .ms-safety-live-card.fall{
    border-color:#e4cf9d;
    background:#fffdf8;
  }

  .ms-safety-live-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
  }

  .ms-safety-live-label{
    font-size:.66rem;
    font-weight:950;
    letter-spacing:.08em;
  }

  .ms-safety-live-top h2{
    margin:5px 0 0;
    color:#273f35;
  }

  .ms-safety-live-status{
    padding:6px 8px;
    border-radius:999px;
    background:#f5dedb;
    color:#8d2920;
    font-size:.58rem;
    font-weight:950;
  }

  .ms-safety-live-status.responded{
    background:#e1f0e8;
    color:#245f49;
  }

  .ms-safety-event-details{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:9px;
    margin:18px 0 12px;
  }

  .ms-safety-event-details div{
    padding:11px;
    border:1px solid rgba(34,76,59,.1);
    border-radius:12px;
    background:rgba(255,255,255,.7);
  }

  .ms-safety-event-details span,
  .ms-safety-event-details strong{
    display:block;
  }

  .ms-safety-event-details span{
    margin-bottom:4px;
    color:#7a8781;
    font-size:.65rem;
  }

  .ms-safety-event-details strong{
    color:#263f35;
    font-size:.85rem;
  }

  .ms-safety-source{
    margin-bottom:13px;
    color:#68776f;
    font-size:.7rem;
  }

  .ms-safety-respond{
    width:100%;
  }

  .ms-safety-simulation-only{
    margin:10px 0 0;
    text-align:center;
    color:#8a7774;
    font-size:.62rem;
    font-weight:800;
  }

  .ms-safety-emergency-link{
    border-color:#edc8c3 !important;
    background:#fff9f8 !important;
  }

  .ms-safety-disclaimer{
    margin:20px 0;
    padding:14px;
    border-radius:14px;
    background:#f4f7f5;
  }

  .ms-safety-disclaimer strong,
  .ms-safety-disclaimer span{
    display:block;
  }

  .ms-safety-disclaimer strong{
    margin-bottom:4px;
    color:#405b50;
    font-size:.74rem;
  }

  .ms-safety-disclaimer span{
    color:#74817b;
    font-size:.68rem;
    line-height:1.45;
  }

}

@media(max-width:520px){

  .ms-safety-card{
    min-height:142px;
    padding:15px !important;
  }

  .ms-safety-test-panel,
  .ms-safety-live-card{
    padding:17px;
  }

}



/* =========================================================
   MOBILITY SAFE — PASS 3
   MOBILE APP VISUAL ALIGNMENT
   Approved app-style visual language
   ========================================================= */

@media(max-width:1024px){

  /* ---------- APP CANVAS ---------- */

  body{
    background:#f3f7f5;
  }

  #app{
    background:#f3f7f5;
  }

  .ms-mobile-shell{
    width:100%;
    max-width:760px;
    min-height:100vh;
    margin:0 auto;
    box-sizing:border-box;
    padding:
      22px
      18px
      calc(104px + env(safe-area-inset-bottom));
    background:
      linear-gradient(
        180deg,
        #f8fbf9 0%,
        #f3f7f5 42%,
        #f1f6f3 100%
      );
  }


  /* ---------- HEADER ---------- */

  .ms-mobile-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin:0 0 22px;
    padding:2px 2px 0;
  }

  .ms-mobile-eyebrow{
    margin-bottom:5px;
    color:#2f7a5d;
    font-size:.67rem;
    font-weight:900;
    letter-spacing:.14em;
  }

  .ms-mobile-header h1{
    margin:0;
    color:#173d30;
    font-size:1.58rem;
    line-height:1.12;
    letter-spacing:-.025em;
  }

  .ms-mobile-header p{
    margin:6px 0 0;
    color:#77867f;
    font-size:.77rem;
    line-height:1.35;
  }

  .ms-mobile-header-actions{
    flex:0 0 auto;
  }


  /* ---------- SECTION LABELS ---------- */

  .ms-mobile-section{
    margin:0 0 22px;
  }

  .ms-mobile-section-title{
    margin:0 0 9px 3px;
    color:#668078;
    font-size:.64rem;
    font-weight:900;
    letter-spacing:.11em;
  }


  /* ---------- PRIMARY ACTION CARDS ---------- */

  .ms-mobile-action-grid{
    gap:12px;
  }

  .ms-mobile-action-card{
    min-height:142px;
    box-sizing:border-box;
    padding:16px !important;
    border:1px solid #dbe6e1 !important;
    border-radius:19px !important;
    background:#ffffff !important;
    box-shadow:
      0 7px 20px rgba(23,61,48,.055) !important;
  }

  .ms-mobile-action-card:active{
    transform:scale(.985);
  }

  .ms-mobile-action-icon{
    width:43px;
    height:43px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:13px;
    background:#e6f2ec;
    color:#286b51;
    font-size:1.15rem;
  }

  .ms-mobile-action-card strong{
    margin-top:13px;
    color:#213f34;
    font-size:.92rem;
    line-height:1.2;
  }

  .ms-mobile-action-card small{
    margin-top:5px;
    color:#78877f;
    font-size:.69rem;
    line-height:1.4;
  }


  /* ---------- LIST ROWS ---------- */

  .ms-mobile-list-action{
    width:100%;
    min-height:70px;
    margin:0 0 9px;
    box-sizing:border-box;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px;
    padding:14px 15px !important;
    border:1px solid #dce6e1 !important;
    border-radius:16px !important;
    background:#fff !important;
    color:#244338 !important;
    text-align:left !important;
    box-shadow:
      0 5px 15px rgba(23,61,48,.04) !important;
  }

  .ms-mobile-list-action > span:first-child{
    min-width:0;
    flex:1;
  }

  .ms-mobile-list-action strong{
    display:block;
    color:#29483c;
    font-size:.83rem;
  }

  .ms-mobile-list-action small{
    display:block;
    margin-top:3px;
    color:#7d8b85;
    font-size:.67rem;
    line-height:1.35;
  }

  .ms-mobile-chevron{
    color:#8ba099;
    font-size:1.65rem;
    line-height:1;
  }


  /* ---------- FIND BAND ---------- */

  .ms-b7-locator-card,
  .ms-band-locator-card,
  .ms-locator-card{
    border:1px solid #d9e5df !important;
    border-radius:21px !important;
    background:#fff !important;
    box-shadow:
      0 8px 24px rgba(23,61,48,.055) !important;
  }

  .ms-b7-radar,
  .ms-band-radar,
  .ms-locator-radar{
    border-color:#d8e9e1 !important;
    background:
      radial-gradient(
        circle,
        rgba(54,132,98,.09) 0%,
        rgba(54,132,98,.04) 45%,
        rgba(255,255,255,.8) 72%
      ) !important;
  }

  .ms-b7-status-grid > *,
  .ms-locator-status-grid > *{
    border:1px solid #dfe8e4 !important;
    border-radius:13px !important;
    background:#f8fbf9 !important;
  }


  /* ---------- SAFETY STATUS ---------- */

  .ms-safety-status-card{
    margin-bottom:19px;
    padding:13px 14px;
    border:1px solid #dbe6e1;
    border-radius:17px;
    background:#fff;
    box-shadow:
      0 6px 18px rgba(23,61,48,.045);
  }

  .ms-safety-status-icon{
    width:38px;
    height:38px;
    flex-basis:38px;
    background:#e5f2eb;
    color:#286b51;
  }

  .ms-safety-hardware{
    padding:6px 9px;
    border:1px solid #efdfb6;
    background:#fff8e7;
    color:#85631c !important;
  }


  /* ---------- SOS + FALL CARDS ---------- */

  .ms-safety-grid{
    gap:11px;
  }

  .ms-safety-card{
    min-height:139px;
    padding:15px !important;
    border-radius:18px !important;
    box-shadow:
      0 5px 15px rgba(23,61,48,.035) !important;
  }

  .ms-safety-sos{
    border:1px solid #efd4d0 !important;
    background:#fffafa !important;
    color:#8e3027 !important;
  }

  .ms-safety-fall{
    border:1px solid #eadfbd !important;
    background:#fffdf7 !important;
    color:#765b20 !important;
  }

  .ms-safety-icon{
    min-width:41px;
    height:41px;
    border-radius:12px;
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,.025);
  }

  .ms-safety-sos .ms-safety-icon{
    background:#f9e8e5;
  }

  .ms-safety-fall .ms-safety-icon{
    background:#f7efd8;
  }

  .ms-safety-test-label{
    top:11px;
    right:11px;
    padding:4px 7px;
    border:1px solid rgba(0,0,0,.05);
    background:#fff;
  }


  /* ---------- FACILITY EMERGENCY ---------- */

  .ms-safety-emergency-link{
    border-color:#efd7d3 !important;
    background:#fffafa !important;
  }

  .ms-safety-emergency-link strong{
    color:#7e342d !important;
  }


  /* ---------- SAFETY DISCLAIMER ---------- */

  .ms-safety-disclaimer{
    margin:18px 0 4px;
    padding:13px 14px;
    border:1px solid #e0e8e4;
    border-radius:14px;
    background:#f8faf9;
  }


  /* ---------- TEST / LIVE ALERT ---------- */

  .ms-safety-test-panel,
  .ms-safety-live-card{
    border-radius:19px;
    box-shadow:
      0 8px 22px rgba(23,61,48,.055);
  }

  .ms-safety-live-card.sos{
    border:1px solid #eccac5;
    background:#fffafa;
  }

  .ms-safety-live-card.fall{
    border:1px solid #e6d7ad;
    background:#fffdf7;
  }

  .ms-safety-event-details div{
    border-color:#e1e9e5;
    background:rgba(255,255,255,.88);
  }


  /* ---------- STANDARD BUTTONS ---------- */

  .ms-mobile-shell button:not(.ms-mobile-bottom-nav button){
    transition:
      transform .12s ease,
      box-shadow .12s ease,
      background .12s ease;
  }


  /* =======================================================
     BOTTOM NAVIGATION — APPROVED APP STYLE
     ======================================================= */

  .ms-mobile-bottom-nav{
    position:fixed;
    z-index:100;
    left:50%;
    right:auto;
    bottom:0;
    width:min(100%,760px);
    min-height:76px;
    box-sizing:border-box;
    transform:translateX(-50%);
    grid-template-columns:repeat(4,1fr);
    gap:3px;
    padding:
      8px
      10px
      calc(8px + env(safe-area-inset-bottom));
    border-top:1px solid #d9e4df;
    background:rgba(255,255,255,.97);
    box-shadow:
      0 -7px 22px rgba(18,52,40,.055);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
  }

  .ms-mobile-bottom-nav button{
    min-height:55px;
    position:relative;
    gap:3px;
    margin:0 !important;
    padding:6px 4px !important;
    border:0 !important;
    border-radius:15px !important;
    background:transparent !important;
    color:#77877f !important;
    box-shadow:none !important;
    font-size:.64rem;
    font-weight:800;
    transition:
      background .15s ease,
      color .15s ease,
      transform .12s ease;
  }

  .ms-mobile-bottom-nav button span{
    min-width:30px;
    height:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto;
    border-radius:10px;
    font-size:1.12rem;
    line-height:1;
  }

  .ms-mobile-bottom-nav button.active{
    background:#e8f3ed !important;
    color:#245f49 !important;
  }

  .ms-mobile-bottom-nav button.active span{
    background:#d7eadf;
    color:#1f6248;
  }

  .ms-mobile-bottom-nav button:active{
    transform:scale(.96);
  }

}


/* =========================================================
   PHONE REFINEMENT
   ========================================================= */

@media(max-width:520px){

  .ms-mobile-shell{
    padding:
      18px
      14px
      calc(100px + env(safe-area-inset-bottom));
  }

  .ms-mobile-header{
    margin-bottom:19px;
  }

  .ms-mobile-header h1{
    font-size:1.48rem;
  }

  .ms-mobile-header p{
    font-size:.72rem;
  }

  .ms-mobile-action-grid,
  .ms-safety-grid{
    gap:10px;
  }

  .ms-mobile-action-card{
    min-height:132px;
    padding:14px !important;
  }

  .ms-safety-card{
    min-height:132px;
    padding:14px !important;
  }

  .ms-mobile-bottom-nav{
    min-height:73px;
    padding-top:7px;
  }

}


/* =========================================================
   TABLET REFINEMENT
   ========================================================= */

@media(min-width:700px) and (max-width:1024px){

  .ms-mobile-shell{
    padding:
      30px
      28px
      calc(112px + env(safe-area-inset-bottom));
  }

  .ms-mobile-header h1{
    font-size:1.72rem;
  }

  .ms-mobile-action-grid,
  .ms-safety-grid{
    gap:15px;
  }

}


/* =========================================================
   MOBILITY SAFE — PASS 3B
   MOBILE COMPACT POLISH
   Visual-only refinement
   ========================================================= */

@media(max-width:1024px){

  /* ---------- FIND BAND: COMPACT LOCATOR ---------- */

  .ms-b7-locator-card,
  .ms-band-locator-card,
  .ms-locator-card{
    padding-top:16px !important;
    padding-bottom:16px !important;
  }

  .ms-b7-radar,
  .ms-band-radar,
  .ms-locator-radar{
    width:150px !important;
    height:150px !important;
    min-height:150px !important;
    margin:14px auto 18px !important;
  }

  .ms-b7-status-grid,
  .ms-locator-status-grid{
    gap:8px !important;
  }

  .ms-b7-status-grid > *,
  .ms-locator-status-grid > *{
    min-height:48px !important;
    padding:9px 11px !important;
  }

  /* Reduce large blank areas between locator sections */

  .ms-b7-locator-card + *,
  .ms-band-locator-card + *,
  .ms-locator-card + *{
    margin-top:12px !important;
  }


  /* ---------- FIND BAND STATUS ---------- */

  .ms-b7-connection-note,
  .ms-locator-connection-note{
    margin-top:9px !important;
    padding:11px 12px !important;
    border-radius:13px !important;
  }


  /* ---------- SAFETY CARDS ---------- */

  .ms-safety-card{
    min-height:120px !important;
    padding:13px !important;
  }

  .ms-safety-grid{
    margin-bottom:16px !important;
  }

  .ms-safety-card strong{
    margin-top:8px !important;
  }

  .ms-safety-card small{
    margin-top:3px !important;
  }


  /* ---------- ACTIVE SOS / FALL RESPONSE ---------- */

  .ms-safety-test-panel,
  .ms-safety-live-card{
    padding:14px !important;
    margin-top:12px !important;
    margin-bottom:15px !important;
  }

  .ms-safety-event-details{
    gap:7px !important;
    margin-top:10px !important;
    margin-bottom:10px !important;
  }

  .ms-safety-event-details div{
    min-height:45px !important;
    padding:8px 10px !important;
    border-radius:11px !important;
  }

  .ms-safety-test-panel button,
  .ms-safety-live-card button{
    min-height:44px !important;
    margin-top:8px !important;
  }


  /* ---------- FACILITY SAFETY ---------- */

  .ms-safety-list{
    gap:8px !important;
  }

  .ms-safety-list .ms-mobile-list-action{
    min-height:63px !important;
    padding:11px 13px !important;
  }


  /* ---------- BOTTOM NAV ICON CONSISTENCY ---------- */

  .ms-mobile-bottom-nav button{
    min-height:54px !important;
  }

  .ms-mobile-bottom-nav button span{
    width:31px !important;
    height:27px !important;
    font-size:1rem !important;
    line-height:1 !important;
  }

  .ms-mobile-bottom-nav button.active span{
    width:34px !important;
  }


  /* ---------- KEEP CONTENT ABOVE NAV ---------- */

  .ms-mobile-safe-space{
    height:12px !important;
  }

}


/* PHONE-SPECIFIC COMPACTION */

@media(max-width:520px){

  .ms-b7-radar,
  .ms-band-radar,
  .ms-locator-radar{
    width:138px !important;
    height:138px !important;
    min-height:138px !important;
    margin:12px auto 15px !important;
  }

  .ms-safety-card{
    min-height:116px !important;
  }

  .ms-safety-test-panel,
  .ms-safety-live-card{
    padding:13px !important;
  }

}


/* =========================================================
   END PASS 3B
   ========================================================= */



/* =========================================================
   MOBILITY SAFE — PASS 4
   MOBILE HOME APP ALIGNMENT
   Visual-only mobile/tablet refinement
   ========================================================= */

@media(max-width:1024px){


  /* ---------- HOME HEADER ---------- */

  .ms-home-shell{
    background:
      linear-gradient(
        180deg,
        #f8fbf9 0%,
        #f3f7f5 45%,
        #f1f6f3 100%
      );
  }


  .ms-home-header{
    margin-bottom:17px !important;
  }



  /* ---------- CONNECTION STATUS ---------- */

  .ms-home-status{
    width:100%;
    min-height:68px;
    box-sizing:border-box;

    display:flex;
    align-items:center;

    gap:11px;

    margin:0 0 22px;

    padding:12px 13px;

    border:
      1px solid #d6e5dd;

    border-radius:17px;

    background:#ffffff;

    box-shadow:
      0 6px 18px
      rgba(23,61,48,.045);
  }


  .ms-home-status-icon{
    width:38px;
    height:38px;

    flex:0 0 38px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    background:#e4f2ea;

    color:#267052;

    font-weight:900;
    font-size:1rem;
  }


  .ms-home-status-copy{
    flex:1;
    min-width:0;
  }


  .ms-home-status-copy strong,
  .ms-home-status-copy span{
    display:block;
  }


  .ms-home-status-copy strong{
    color:#234538;

    font-size:.84rem;

    font-weight:850;
  }


  .ms-home-status-copy span{
    margin-top:3px;

    color:#7a8982;

    font-size:.67rem;

    line-height:1.3;
  }


  .ms-home-online-pill{
    flex:0 0 auto;

    padding:5px 8px;

    border:
      1px solid #d4e7dd;

    border-radius:999px;

    background:#edf7f1;

    color:#347258;

    font-size:.56rem;

    font-weight:900;

    letter-spacing:.08em;
  }



  /* ---------- OPEN PROFILE ---------- */

  .ms-home-profile-card{
    width:100%;

    min-height:78px;

    box-sizing:border-box;

    display:flex !important;

    align-items:center !important;

    gap:13px;

    padding:14px 15px !important;

    border:
      1px solid #d8e5df !important;

    border-radius:18px !important;

    background:#ffffff !important;

    color:#244338 !important;

    text-align:left !important;

    box-shadow:
      0 6px 18px
      rgba(23,61,48,.05) !important;
  }


  .ms-home-profile-icon{
    width:42px;
    height:42px;

    flex:0 0 42px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:13px;

    background:#e5f2eb;

    color:#286b51;

    font-size:1.2rem;

    font-weight:900;
  }


  .ms-home-profile-copy{
    flex:1;

    min-width:0;
  }


  .ms-home-profile-copy strong,
  .ms-home-profile-copy small{
    display:block;
  }


  .ms-home-profile-copy strong{
    color:#234438;

    font-size:.88rem;

    font-weight:850;
  }


  .ms-home-profile-copy small{
    margin-top:4px;

    color:#7b8983;

    font-size:.68rem;

    line-height:1.35;
  }



  /* ---------- QUICK ACTION GRID ---------- */

  .ms-home-action-grid{
    display:grid;

    grid-template-columns:
      repeat(2,minmax(0,1fr));

    gap:10px;
  }


  .ms-home-action-card{
    min-height:124px;

    box-sizing:border-box;

    display:flex !important;

    flex-direction:column;

    align-items:flex-start !important;

    justify-content:flex-start !important;

    padding:14px !important;

    border:
      1px solid #dbe6e1 !important;

    border-radius:18px !important;

    background:#ffffff !important;

    color:#244338 !important;

    text-align:left !important;

    box-shadow:
      0 5px 16px
      rgba(23,61,48,.04) !important;

    transition:
      transform .12s ease,
      box-shadow .12s ease;
  }


  .ms-home-action-card:active{
    transform:scale(.98);
  }


  .ms-home-action-icon{
    width:39px;
    height:39px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:12px;

    background:#e6f2ec;

    color:#286b51;

    font-size:1.1rem;

    font-weight:900;
  }


  .ms-home-action-card strong{
    display:block;

    margin-top:11px;

    color:#28483c;

    font-size:.82rem;

    line-height:1.2;
  }


  .ms-home-action-card small{
    display:block;

    margin-top:4px;

    color:#7d8a84;

    font-size:.65rem;

    line-height:1.35;
  }



  /* ---------- EMERGENCY ACTION ---------- */

  .ms-home-alert-card{
    border-color:#ecd6d2 !important;

    background:#fffafa !important;
  }


  .ms-home-alert-card strong{
    color:#7f352e;
  }


  .ms-home-alert-icon{
    background:#f8e8e5;

    color:#9a3329;
  }



  /* ---------- SYSTEM STATUS ---------- */

  .ms-home-system-card{
    width:100%;

    min-height:62px;

    box-sizing:border-box;

    display:flex;

    align-items:center;

    gap:11px;

    padding:12px 14px;

    border:
      1px solid #dce7e2;

    border-radius:16px;

    background:#f9fbfa;
  }


  .ms-home-system-indicator{
    width:9px;
    height:9px;

    flex:0 0 9px;

    border-radius:50%;

    background:#3b8a67;

    box-shadow:
      0 0 0 5px
      rgba(59,138,103,.10);
  }


  .ms-home-system-card strong,
  .ms-home-system-card small{
    display:block;
  }


  .ms-home-system-card strong{
    color:#315346;

    font-size:.76rem;
  }


  .ms-home-system-card small{
    margin-top:3px;

    color:#819089;

    font-size:.64rem;
  }

}


/* ---------- PHONE ---------- */

@media(max-width:520px){

  .ms-home-status{
    min-height:64px;

    margin-bottom:19px;

    padding:11px 12px;
  }


  .ms-home-action-grid{
    gap:9px;
  }


  .ms-home-action-card{
    min-height:116px;

    padding:13px !important;
  }


  .ms-home-profile-card{
    min-height:72px;

    padding:12px 13px !important;
  }

}


/* =========================================================
   END PASS 4
   ========================================================= */



/* =========================================================
   MOBILITY SAFE — PASS 4C
   MOBILE COLOR SYSTEM
   Visual-only refinement
   ========================================================= */

@media(max-width:900px){

  /* ---------------------------------------
     MOBILITY SAFE CORE COLORS
     --------------------------------------- */

  .ms-mobile-shell{
    --ms-green:#2f755b;
    --ms-green-dark:#215a45;
    --ms-green-soft:#e5f3ec;

    --ms-red:#b84238;
    --ms-red-dark:#873229;
    --ms-red-soft:#fbe9e7;

    --ms-amber:#a97920;
    --ms-amber-dark:#755316;
    --ms-amber-soft:#fbf1d9;

    --ms-text:#193d31;
    --ms-muted:#718078;
  }


  /* ---------------------------------------
     HOME HEADER
     --------------------------------------- */

  .ms-mobile-eyebrow{
    color:var(--ms-green) !important;
    letter-spacing:.18em !important;
  }

  .ms-mobile-header h1{
    color:#173f32 !important;
  }


  /* ---------------------------------------
     HOME — SYSTEM READY
     --------------------------------------- */

  .ms-home-status{
    border-color:#cfe4da !important;
    background:
      linear-gradient(
        135deg,
        #ffffff 0%,
        #f8fcfa 100%
      ) !important;
  }

  .ms-home-status-icon{
    background:var(--ms-green-soft) !important;
    color:var(--ms-green) !important;
  }

  .ms-home-status-copy strong{
    color:var(--ms-green-dark) !important;
  }

  .ms-home-online-pill{
    border-color:#cce4d8 !important;
    background:#edf8f2 !important;
    color:var(--ms-green-dark) !important;
  }


  /* ---------------------------------------
     HOME — OPEN MOBILITY PROFILE
     --------------------------------------- */

  .ms-home-profile-card{
    border-color:#cfe3d9 !important;
    background:#ffffff !important;
  }

  .ms-home-profile-card .ms-home-action-icon,
  .ms-home-profile-card .ms-mobile-action-icon{
    background:var(--ms-green-soft) !important;
    color:var(--ms-green-dark) !important;
  }


  /* ---------------------------------------
     HOME — STANDARD QUICK ACTIONS
     --------------------------------------- */

  .ms-home-action-card{
    border-color:#d8e6df !important;
    background:#ffffff !important;
  }

  .ms-home-action-icon{
    background:var(--ms-green-soft) !important;
    color:var(--ms-green-dark) !important;
  }

  .ms-home-action-card strong{
    color:#24493b !important;
  }


  /* ---------------------------------------
     HOME — EMERGENCY CARD
     --------------------------------------- */

  .ms-home-alert-card{
    border-color:#edcfca !important;

    background:
      linear-gradient(
        135deg,
        #fffdfd 0%,
        #fff6f5 100%
      ) !important;
  }

  .ms-home-alert-card .ms-home-action-icon{
    background:var(--ms-red-soft) !important;
    color:var(--ms-red) !important;
  }

  .ms-home-alert-card strong{
    color:var(--ms-red-dark) !important;
  }


  /* ---------------------------------------
     ALERTS — SOS
     --------------------------------------- */

  .ms-safety-sos{
    border-color:#edc8c3 !important;

    background:
      linear-gradient(
        135deg,
        #fffdfd,
        #fff6f5
      ) !important;
  }

  .ms-safety-sos .ms-safety-icon{
    background:var(--ms-red-soft) !important;
    color:var(--ms-red-dark) !important;
  }

  .ms-safety-sos strong{
    color:var(--ms-red-dark) !important;
  }


  /* ---------------------------------------
     ALERTS — POSSIBLE FALL
     --------------------------------------- */

  .ms-safety-fall{
    border-color:#ead7a6 !important;

    background:
      linear-gradient(
        135deg,
        #fffefa,
        #fffaf0
      ) !important;
  }

  .ms-safety-fall .ms-safety-icon{
    background:var(--ms-amber-soft) !important;
    color:var(--ms-amber-dark) !important;
  }

  .ms-safety-fall strong{
    color:var(--ms-amber-dark) !important;
  }


  /* ---------------------------------------
     ACTIVE SOS
     --------------------------------------- */

  .ms-safety-live-card.sos,
  .ms-safety-test-panel.sos{
    border-color:#e8bdb7 !important;
    background:#fff8f7 !important;
  }


  /* ---------------------------------------
     ACTIVE FALL
     --------------------------------------- */

  .ms-safety-live-card.fall,
  .ms-safety-test-panel.fall{
    border-color:#e5d19b !important;
    background:#fffaf0 !important;
  }


  /* ---------------------------------------
     FACILITY EMERGENCY
     --------------------------------------- */

  .ms-safety-emergency-link{
    border-color:#edcec9 !important;
    background:#fff8f7 !important;
  }

  .ms-safety-emergency-link strong{
    color:var(--ms-red-dark) !important;
  }


  /* ---------------------------------------
     RESPONSE BUTTON
     --------------------------------------- */

  .ms-safety-live-card button,
  .ms-safety-test-panel button{
    background:var(--ms-green) !important;
    border-color:var(--ms-green) !important;
    color:#ffffff !important;
  }


  /* ---------------------------------------
     BOTTOM NAV — DEFAULT
     --------------------------------------- */

  .ms-mobile-bottom-nav button{
    color:#77867f !important;
    transition:
      background .15s ease,
      color .15s ease,
      transform .12s ease !important;
  }

  .ms-mobile-bottom-nav button.active{
    background:var(--ms-green-soft) !important;
    color:var(--ms-green-dark) !important;
  }


  /* ---------------------------------------
     ALERTS TAB — RED SELECTED STATE
     Supports current Alerts screen
     --------------------------------------- */

  .ms-mobile-shell.ms-alerts-screen
  .ms-mobile-bottom-nav button.active,

  .ms-mobile-shell.alerts-screen
  .ms-mobile-bottom-nav button.active,

  body.ms-alerts-screen
  .ms-mobile-bottom-nav button.active{
    background:var(--ms-red-soft) !important;
    color:var(--ms-red-dark) !important;
  }


  /* ---------------------------------------
     FIND BAND — GREEN SELECTED STATE
     --------------------------------------- */

  .ms-mobile-shell.ms-band-screen
  .ms-mobile-bottom-nav button.active,

  .ms-mobile-shell.band-screen
  .ms-mobile-bottom-nav button.active{
    background:var(--ms-green-soft) !important;
    color:var(--ms-green-dark) !important;
  }


  /* ---------------------------------------
     SECTION LABELS
     --------------------------------------- */

  .ms-mobile-section-title,
  .ms-home-section-title{
    color:#527668 !important;
    letter-spacing:.15em !important;
  }


  /* ---------------------------------------
     SAFE BOTTOM SPACING
     --------------------------------------- */

  .ms-mobile-safe-space{
    height:84px !important;
  }

}


/* =========================================================
   END PASS 4C
   ========================================================= */


/* =========================================================
   MOBILITY SAFE — PASS 4D
   GREEN MOBILE / TABLET APP EXPERIENCE
   ========================================================= */

@media(max-width:1024px){

  /* =====================================
     STRONGER MOBILITY SAFE GREEN
     ===================================== */

  .ms-mobile-shell{
    --ms-app-green:#087a46;
    --ms-app-green-dark:#056537;
    --ms-app-green-deep:#045a32;
    --ms-app-green-bright:#159653;
    --ms-app-green-soft:#e7f5ed;

    --ms-app-red:#d83b35;
    --ms-app-red-soft:#fde9e7;

    --ms-app-amber:#a87718;
    --ms-app-amber-soft:#fbf1d8;
  }


  .ms-mobile-eyebrow,
  .ms-mobile-section-title{
    color:var(--ms-app-green-dark) !important;
  }


  /* =====================================
     READY / ONLINE
     ===================================== */

  .ms-home-status,
  .ms-safety-status-card{
    border-color:#c8e3d3 !important;
  }


  .ms-home-status-icon,
  .ms-safety-status-icon{
    background:#daf1e4 !important;
    color:var(--ms-app-green) !important;
  }


  .ms-home-online-pill{
    background:#e3f5eb !important;
    color:var(--ms-app-green-dark) !important;
    border-color:#c6e7d4 !important;
  }


  /* =====================================
     HOME ICONS
     ===================================== */

  .ms-home-profile-icon,
  .ms-home-action-icon,
  .ms-mobile-action-icon{
    background:#dff2e7 !important;
    color:var(--ms-app-green-dark) !important;
  }


  .ms-home-action-card,
  .ms-home-profile-card{
    border-color:#d2e6da !important;
  }


  /* Emergency remains red */

  .ms-home-alert-card{
    border-color:#efcfcb !important;
    background:#fffafa !important;
  }

  .ms-home-alert-card .ms-home-action-icon{
    background:var(--ms-app-red-soft) !important;
    color:var(--ms-app-red) !important;
  }

  .ms-home-alert-card strong{
    color:#a42e29 !important;
  }


  /* =====================================
     FIND BAND
     ===================================== */

  .ms-locator-search-card,
  .ms-locator-result-card{
    border-color:#cfe4d8 !important;
  }


  .ms-locator-band-dot{
    background:#d9f0e3 !important;
    color:var(--ms-app-green-dark) !important;
    box-shadow:
      0 7px 20px rgba(8,122,70,.16) !important;
  }


  .ms-locator-ring{
    border-color:rgba(8,122,70,.20) !important;
  }


  .ms-locator-stats div{
    border-color:#d9e8df !important;
    background:#f8fcfa !important;
  }


  .ms-locator-stats strong{
    color:#075d36 !important;
  }


  .ms-locator-note{
    background:#eef7f2 !important;
  }


  .ms-locator-note strong{
    color:#087647 !important;
  }


  .ms-locator-find-button{
    background:
      linear-gradient(
        135deg,
        #119458,
        #06713f
      ) !important;

    border-color:#087747 !important;

    color:#fff !important;

    box-shadow:
      0 8px 18px rgba(8,122,70,.18) !important;
  }


  /* =====================================
     SOS / POSSIBLE FALL
     ===================================== */

  .ms-safety-sos{
    border-color:#efc8c3 !important;
    background:#fff9f8 !important;
  }


  .ms-safety-sos .ms-safety-icon{
    background:var(--ms-app-red-soft) !important;
    color:var(--ms-app-red) !important;
  }


  .ms-safety-fall{
    border-color:#e8d59e !important;
    background:#fffdf6 !important;
  }


  .ms-safety-fall .ms-safety-icon{
    background:var(--ms-app-amber-soft) !important;
    color:var(--ms-app-amber) !important;
  }


  .ms-safety-respond{
    background:
      linear-gradient(
        135deg,
        #109054,
        #087445
      ) !important;

    color:#fff !important;
  }


  /* =====================================
     GREEN APP BOTTOM NAV
     ===================================== */

  .ms-mobile-bottom-nav{
    min-height:82px !important;

    padding:
      8px
      10px
      calc(8px + env(safe-area-inset-bottom))
      10px !important;

    border-top:0 !important;

    background:
      linear-gradient(
        135deg,
        #087a46 0%,
        #056b3d 55%,
        #045d35 100%
      ) !important;

    box-shadow:
      0 -8px 24px rgba(4,83,47,.18) !important;

    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }


  /* All unselected items white */

  .ms-mobile-bottom-nav button{
    min-height:58px !important;

    margin:0 2px !important;

    padding:6px 3px !important;

    border-radius:13px !important;

    background:transparent !important;

    color:#ffffff !important;

    opacity:.94;

    font-weight:800 !important;
  }


  .ms-mobile-bottom-nav button span{
    color:#ffffff !important;
    background:transparent !important;

    font-size:1.08rem !important;
  }


  /* =====================================
     SELECTED TAB = WHITE TILE
     ===================================== */

  .ms-mobile-bottom-nav button.active{
    background:#ffffff !important;

    color:var(--ms-app-green-dark) !important;

    opacity:1;

    box-shadow:
      0 4px 14px rgba(0,0,0,.14) !important;
  }


  .ms-mobile-bottom-nav button.active span{
    background:transparent !important;

    color:var(--ms-app-green) !important;
  }


  /* =====================================
     ALERTS SELECTED TAB

     Keep the white selected tile.
     The alert icon itself can remain red.
     ===================================== */

  .ms-safety-shell
  .ms-mobile-bottom-nav button.active{
    background:#ffffff !important;
    color:var(--ms-app-green-dark) !important;
  }


  .ms-safety-shell
  .ms-mobile-bottom-nav button.active span{
    color:var(--ms-app-red) !important;
  }


  /* =====================================
     HOME SELECTED ICON
     ===================================== */

  .ms-home-shell
  .ms-mobile-bottom-nav button.active span{
    color:var(--ms-app-green) !important;
  }


  /* =====================================
     FIND BAND SELECTED ICON
     ===================================== */

  .ms-locator-shell
  .ms-mobile-bottom-nav button.active span{
    color:var(--ms-app-green) !important;
  }


  /* =====================================
     EXTRA SPACE ABOVE GREEN NAV
     ===================================== */

  .ms-mobile-safe-space{
    height:74px !important;
  }

}


/* PHONE */

@media(max-width:520px){

  .ms-mobile-bottom-nav{
    min-height:78px !important;
  }

  .ms-mobile-bottom-nav button{
    min-height:55px !important;
    font-size:.63rem !important;
  }

}


/* =========================================================
   END PASS 4D
   ========================================================= */



/* =========================================================
   MOBILITY SAFE — FINAL VISUAL PASS
   CIRCLES + DESKTOP EXPERIENCE
   ========================================================= */


/* =========================================================
   MOBILE / TABLET CIRCLE DECORATION
   ========================================================= */

@media(max-width:1024px){

  .ms-circle-screen,
  .ms-home-shell,
  .ms-safety-shell,
  .ms-locator-shell{
    position:relative;
    overflow:hidden;
    isolation:isolate;
  }


  .ms-circle-screen > *,
  .ms-home-shell > *,
  .ms-safety-shell > *,
  .ms-locator-shell > *{
    position:relative;
    z-index:2;
  }


  .ms-circle-screen::before,
  .ms-home-shell::before,
  .ms-safety-shell::before,
  .ms-locator-shell::before{
    content:"";

    position:absolute;

    z-index:0;

    width:270px;
    height:270px;

    top:-155px;
    right:-125px;

    border-radius:50%;

    border:28px solid
      rgba(8,122,70,.11);

    box-shadow:
      0 0 0 38px rgba(8,122,70,.055),
      0 0 0 72px rgba(37,123,181,.035);

    pointer-events:none;
  }


  .ms-circle-screen::after,
  .ms-home-shell::after,
  .ms-safety-shell::after,
  .ms-locator-shell::after{
    content:"";

    position:absolute;

    z-index:0;

    width:175px;
    height:175px;

    left:-115px;
    bottom:125px;

    border-radius:50%;

    border:22px solid
      rgba(40,126,183,.055);

    box-shadow:
      0 0 0 30px rgba(8,122,70,.035);

    pointer-events:none;
  }


  .ms-deco-circle{
    display:none;
  }


  /* ---------------------------------------
     NFC VERIFICATION
     --------------------------------------- */

  .ms-nfc-status{
    display:flex;

    align-items:center;

    gap:9px;

    margin-top:12px;

    padding:10px 11px;

    border:
      1px solid #dbe6e1;

    border-radius:12px;

    background:#f8fbf9;

    color:#74837c;

    font-size:.7rem;
  }


  .ms-nfc-status-dot{
    width:8px;
    height:8px;

    flex:0 0 8px;

    border-radius:50%;

    background:#9aa8a1;
  }


  .ms-nfc-status.ready
  .ms-nfc-status-dot{
    background:#158453;
  }


  .ms-nfc-status.scanning
  .ms-nfc-status-dot{
    background:#178b57;

    box-shadow:
      0 0 0 0
      rgba(23,139,87,.35);

    animation:
      msNfcPulse
      1.25s
      infinite;
  }


  .ms-nfc-status.verified{
    border-color:#bfe0ce;
    background:#eef8f2;
    color:#12683f;
  }


  .ms-nfc-status.verified
  .ms-nfc-status-dot{
    background:#087a46;
  }


  @keyframes msNfcPulse{

    0%{
      box-shadow:
        0 0 0 0
        rgba(23,139,87,.4);
    }

    70%{
      box-shadow:
        0 0 0 9px
        rgba(23,139,87,0);
    }

    100%{
      box-shadow:
        0 0 0 0
        rgba(23,139,87,0);
    }

  }


  .ms-locator-status.verified{
    background:#e2f4e9;
    color:#087243;
  }


  .ms-locator-note.verified{
    background:#edf8f2 !important;
    border:
      1px solid #cbe5d6;
  }


  .ms-locator-note.verified strong{
    color:#087243 !important;
  }

}


/* =========================================================
   DESKTOP MOBILITY SAFE EXPERIENCE
   ========================================================= */

@media(min-width:1025px){

  .ms-desktop-shell{
    position:relative;

    max-width:1180px;

    margin:22px auto 44px;

    padding:30px;

    box-sizing:border-box;

    overflow:hidden;

    border:
      1px solid #d8e5de;

    border-radius:28px;

    background:
      linear-gradient(
        145deg,
        #ffffff 0%,
        #f7fbf9 48%,
        #f1f7f4 100%
      );

    box-shadow:
      0 20px 55px
      rgba(17,63,46,.09);
  }


  .ms-desktop-shell > *{
    position:relative;
    z-index:2;
  }


  .ms-desktop-circle-one{
    position:absolute;

    z-index:0;

    width:470px;
    height:470px;

    top:-290px;
    right:-180px;

    border-radius:50%;

    border:
      46px solid
      rgba(8,122,70,.10);

    box-shadow:
      0 0 0 65px
        rgba(8,122,70,.045),
      0 0 0 120px
        rgba(46,126,181,.025);

    pointer-events:none;
  }


  .ms-desktop-circle-two{
    position:absolute;

    z-index:0;

    width:330px;
    height:330px;

    left:-245px;
    bottom:-105px;

    border-radius:50%;

    border:
      38px solid
      rgba(42,125,181,.045);

    box-shadow:
      0 0 0 52px
        rgba(8,122,70,.03);

    pointer-events:none;
  }


  .ms-desktop-hero{
    display:flex;

    align-items:flex-start;

    justify-content:space-between;

    gap:20px;

    margin-bottom:22px;
  }


  .ms-desktop-eyebrow{
    margin-bottom:7px;

    color:#087747;

    font-size:.72rem;

    font-weight:950;

    letter-spacing:.20em;
  }


  .ms-desktop-hero h1{
    margin:0;

    color:#143e30;

    font-size:2rem;

    letter-spacing:-.025em;
  }


  .ms-desktop-hero p{
    margin:6px 0 0;

    color:#72837b;
  }


  .ms-desktop-hero-actions{
    display:flex;

    align-items:center;

    gap:9px;
  }


  .ms-desktop-ready{
    display:flex;

    align-items:center;

    gap:12px;

    margin-bottom:28px;

    padding:14px 16px;

    border:
      1px solid #cbe3d6;

    border-radius:17px;

    background:
      rgba(255,255,255,.88);

    box-shadow:
      0 7px 20px
      rgba(20,65,49,.045);
  }


  .ms-desktop-ready-icon{
    width:39px;
    height:39px;

    flex:0 0 39px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:50%;

    background:#def2e7;

    color:#087847;

    font-weight:950;
  }


  .ms-desktop-ready > span:nth-child(2){
    flex:1;
  }


  .ms-desktop-ready strong,
  .ms-desktop-ready small{
    display:block;
  }


  .ms-desktop-ready strong{
    color:#20523e;
  }


  .ms-desktop-ready small{
    margin-top:3px;

    color:#78877f;
  }


  .ms-desktop-online{
    padding:6px 10px;

    border-radius:999px;

    background:#e4f5eb;

    color:#086a40;

    font-size:.64rem;

    font-weight:950;

    letter-spacing:.08em;
  }


  .ms-desktop-section-title{
    margin:
      0
      0
      10px
      2px;

    color:#3d715e;

    font-size:.7rem;

    font-weight:950;

    letter-spacing:.16em;
  }


  .ms-desktop-grid{
    display:grid;

    grid-template-columns:
      repeat(
        3,
        minmax(0,1fr)
      );

    gap:15px;
  }


  .ms-desktop-action-card{
    min-height:235px;

    box-sizing:border-box;

    padding:20px;

    border:
      1px solid #d7e5dd;

    border-radius:21px;

    background:
      rgba(255,255,255,.92);

    box-shadow:
      0 8px 24px
      rgba(20,61,47,.045);
  }


  .ms-desktop-action-icon{
    width:45px;
    height:45px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:14px;

    background:#e1f2e8;

    color:#087646;

    font-size:1.15rem;

    font-weight:950;
  }


  .ms-desktop-action-card h3{
    margin:15px 0 7px;

    color:#214737;

    font-size:1.02rem;
  }


  .ms-desktop-action-card p{
    min-height:55px;

    margin:0 0 16px;

    color:#74837c;

    font-size:.8rem;

    line-height:1.55;
  }


  .ms-desktop-action-card button{
    margin-right:6px;
  }


  .ms-desktop-alert-card{
    border-color:#ecd0cc;

    background:
      linear-gradient(
        145deg,
        #ffffff,
        #fff8f7
      );
  }


  .ms-desktop-alert-icon{
    background:#fbe7e4;
    color:#bd3e34;
  }


  .ms-desktop-alert-card h3{
    color:#8d332c;
  }


  .ms-desktop-footer-status{
    display:flex;

    align-items:center;

    gap:9px;

    margin-top:18px;

    padding:11px 14px;

    border-radius:14px;

    background:
      rgba(246,250,248,.92);

    color:#658077;

    font-size:.75rem;
  }


  .ms-desktop-status-dot{
    width:8px;
    height:8px;

    border-radius:50%;

    background:#0a804b;

    box-shadow:
      0 0 0 4px
      rgba(10,128,75,.1);
  }

}


@media(
  min-width:1025px
) and (
  max-width:1180px
){

  .ms-desktop-grid{
    grid-template-columns:
      repeat(
        2,
        minmax(0,1fr)
      );
  }

}


/* =========================================================
   END FINAL VISUAL PASS
   ========================================================= */


/* =========================================================
   MOBILITY SAFE — FINAL FIND BAND WORKFLOW
   ========================================================= */

@media(max-width:1024px){

  .ms-locator-verify-card{
    margin-top:14px !important;
  }

  .ms-locator-verify-button{
    width:100% !important;
    min-height:48px !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;

    margin-top:14px !important;

    border:1px solid #bcd9cb !important;
    border-radius:13px !important;

    background:
      linear-gradient(
        135deg,
        #edf7f2,
        #e2f1e9
      ) !important;

    color:#075f39 !important;
    font-weight:900 !important;
    box-shadow:none !important;
  }

  .ms-locator-verify-button:active{
    transform:scale(.985);
  }

  .ms-locator-find-button{
    min-height:49px !important;
    font-weight:900 !important;
  }

}

/* END FINAL FIND BAND WORKFLOW */


/* =========================================================
   MOBILITY SAFE — FIXED MOBILE BOTTOM NAVIGATION
   Keep navigation anchored to viewport while content scrolls.
   ========================================================= */

@media (max-width: 900px) {

    /* Leave room so scrolling content is never hidden by nav */
    body {
        padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
    }

    /* Mobility Safe mobile bottom navigation */
    .ms-mobile-bottom-nav {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;

        z-index: 9999 !important;

        min-height: 88px !important;
        padding:
            8px
            12px
            calc(8px + env(safe-area-inset-bottom))
            12px !important;

        box-sizing: border-box !important;
    }

    .ms-mobile-bottom-nav,
    .ms-mobile-bottom-nav * {
        box-sizing: border-box !important;
    }

    /* Keep the four controls evenly distributed */
    .ms-mobile-bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: stretch !important;
    }

    .ms-mobile-bottom-nav button,
    .ms-mobile-bottom-nav a {
        min-width: 0 !important;
        min-height: 68px !important;
        margin: 0 !important;
    }
}


/* =========================================================
   MOBILITY SAFE — FINAL FULL-WIDTH FIXED MOBILE NAV
   Fix legacy 50% centering transform clipping left half.
   ========================================================= */

@media (max-width: 900px) {

    .ms-mobile-bottom-nav {
        position: fixed !important;

        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100vw !important;
        max-width: 100vw !important;

        margin: 0 !important;

        /* CRITICAL:
           old mobile rules centered this bar with translateX.
           Remove that so Home + Find Band are not offscreen.
        */
        transform: none !important;
        translate: none !important;

        display: grid !important;
        grid-template-columns:
            repeat(4, minmax(0, 1fr)) !important;

        align-items: stretch !important;

        min-height: 88px !important;

        padding:
            8px
            10px
            calc(8px + env(safe-area-inset-bottom))
            10px !important;

        background:
            linear-gradient(
                135deg,
                #078443,
                #006b38
            ) !important;

        z-index: 99999 !important;

        box-sizing: border-box !important;

        overflow: visible !important;
    }

    .ms-mobile-bottom-nav button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;

        min-height: 68px !important;

        margin: 0 !important;
        padding: 8px 4px !important;

        transform: none !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        gap: 5px !important;

        box-sizing: border-box !important;
    }

    .ms-mobile-bottom-nav button span {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        min-height: 25px !important;

        font-size: 1.15rem !important;
    }

    .ms-mobile-bottom-nav button {
        font-size: .72rem !important;
        font-weight: 800 !important;
    }

    /* Selected tab = white app-style tile */
    .ms-mobile-bottom-nav button.active {
        background: #ffffff !important;
        border-radius: 18px !important;
    }

    .ms-mobile-bottom-nav button.active,
    .ms-mobile-bottom-nav button.active span {
        color: #087a43 !important;
    }

    /* Other tabs stay white on green */
    .ms-mobile-bottom-nav button:not(.active),
    .ms-mobile-bottom-nav button:not(.active) span {
        color: #ffffff !important;
    }

    /* Space for fixed bar while page content scrolls */
    .ms-mobile-shell,
    .ms-home-shell,
    .ms-locator-shell {
        padding-bottom:
            calc(110px + env(safe-area-inset-bottom)) !important;
    }
}

/* =========================================================
   MOBILITY SAFE — NATIVE IOS SAFE AREA
   Keeps browser/PWA layout unchanged while respecting
   iPhone status bar, Dynamic Island, and home indicator.
   ========================================================= */

@media(max-width:1024px){

  body{
    min-height:100dvh;
  }

  .ms-mobile-shell{
    min-height:100dvh;
    padding-top:
      calc(22px + env(safe-area-inset-top));
  }

  .ms-impulse-screen,
  .ms-facility-access-screen{
    min-height:100dvh;
    box-sizing:border-box;
    padding-top:env(safe-area-inset-top);
    padding-bottom:env(safe-area-inset-bottom);
  }

}



/* =========================================================
   MOBILITY SAFE — FINAL RESPONSIVE APP CANVAS
   2026-09-21

   Goals:
   - Keep the top of every screen visible.
   - Respect iPhone/iPad safe areas.
   - Center application content horizontally.
   - Prevent horizontal movement/overflow.
   - Preserve normal vertical scrolling for long screens.
   - Preserve fixed mobile bottom navigation.
   ========================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#msApp {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

#app {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Keep direct app screens centered instead of drifting
   toward either side of the viewport. */
#app > .card {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Any screen that already has its own shell keeps its
   internal design while remaining centered. */
#app > .ms-mobile-shell,
#app > .ms-home-shell,
#app > .ms-locator-shell,
#app > .ms-facility-access-screen,
#app > .ms-impulse-screen {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}


/* ---------------- PHONE + TABLET ---------------- */

@media (max-width: 1024px) {

    html,
    body {
        min-height: 100%;
        min-height: 100dvh;
    }

    body {
        margin: 0;
        overflow-x: hidden;
    }

    #msApp {
        width: 100%;
        max-width: 820px;

        /*
         * Safe-area belongs to the application canvas.
         * This protects ordinary screens that do not use
         * .ms-mobile-shell.
         */
        padding-top:
            calc(env(safe-area-inset-top) + 14px);

        padding-right:
            max(14px, env(safe-area-inset-right));

        padding-left:
            max(14px, env(safe-area-inset-left));

        padding-bottom:
            calc(116px + env(safe-area-inset-bottom));

        margin: 0 auto;
        box-sizing: border-box;
    }

    #app {
        width: 100%;
        max-width: 760px;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
    }

    /*
     * #msApp now owns the top safe-area spacing.
     * Do not apply the notch inset a second time to
     * these inner application shells.
     */
    #app > .ms-mobile-shell {
        padding-top: 8px !important;
        margin-top: 0 !important;
    }

    #app > .ms-home-shell,
    #app > .ms-locator-shell {
        margin-top: 0 !important;
    }

    /*
     * Screens designed as full-page experiences already
     * handle their internal layout. Keep them safely inside
     * the application canvas without a second top inset.
     */
    #app > .ms-impulse-screen,
    #app > .ms-facility-access-screen {
        min-height:
            calc(
                100dvh
                - env(safe-area-inset-top)
                - env(safe-area-inset-bottom)
                - 30px
            );
        padding-top: 0 !important;
    }

    /* Normalize direct cards generated by app.js. */
    #app > .card {
        width: 100%;
        max-width: 720px;

        /*
         * Some generated screens contain inline
         * margin:24px auto / 40px auto.
         * Keep the horizontal centering but remove the
         * large top offset on phones/tablets.
         */
        margin-top: 8px !important;
        margin-right: auto !important;
        margin-left: auto !important;

        box-sizing: border-box;
    }

    #app img,
    #app svg,
    #app canvas,
    #app video {
        max-width: 100%;
    }

    #app input,
    #app select,
    #app textarea,
    #app button {
        max-width: 100%;
        box-sizing: border-box;
    }
}


/* ---------------- PHONE ---------------- */

@media (max-width: 600px) {

    #msApp {
        max-width: 100%;

        padding-top:
            calc(env(safe-area-inset-top) + 10px);

        padding-right:
            max(10px, env(safe-area-inset-right));

        padding-left:
            max(10px, env(safe-area-inset-left));

        padding-bottom:
            calc(112px + env(safe-area-inset-bottom));
    }

    #app {
        width: 100%;
        max-width: 100%;
    }

    #app > .card {
        width: 100%;
        max-width: 100%;
        margin-top: 6px !important;
        margin-bottom: 10px;
    }

    #app > .ms-mobile-shell,
    #app > .ms-home-shell,
    #app > .ms-locator-shell {
        width: 100%;
        max-width: 100%;
    }
}


/* ---------------- TABLET ---------------- */

@media (min-width: 601px) and (max-width: 1024px) {

    #msApp {
        max-width: 860px;

        padding-top:
            calc(env(safe-area-inset-top) + 18px);

        padding-right:
            max(20px, env(safe-area-inset-right));

        padding-left:
            max(20px, env(safe-area-inset-left));
    }

    #app {
        max-width: 780px;
    }

    #app > .card {
        max-width: 720px;
    }
}


/* ---------------- DESKTOP ---------------- */

@media (min-width: 1025px) {

    #msApp {
        max-width: 1180px;
        margin-left: auto;
        margin-right: auto;
    }

    #app {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* END FINAL RESPONSIVE APP CANVAS */

/* =========================================================
   MOBILITY SAFE — FALL MONITORING WORKFLOW
   Alerts Home + Activation + History
   ========================================================= */

/* ---------- Alerts Home Band Safety ---------- */

.ms-fall-workflow-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.ms-fall-workflow-list .ms-mobile-list-action {
  width: 100%;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.ms-fall-action-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 800;
  background: rgba(29, 122, 76, 0.12);
}

.ms-fall-history-icon {
  font-size: 24px;
}

.ms-fall-action-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-fall-action-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.ms-fall-action-copy small {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.72;
}

.ms-mobile-list-arrow {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
  opacity: 0.45;
}


/* ---------- Fall Workflow Pages ---------- */

.ms-fall-monitor-page,
.ms-fall-history-page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.ms-mobile-page-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.ms-mobile-page-header > div {
  flex: 1;
  min-width: 0;
}

.ms-mobile-page-header h1 {
  margin: 5px 0 7px;
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1.08;
}

.ms-mobile-page-header p {
  margin: 0;
  line-height: 1.5;
  opacity: 0.74;
}

.ms-mobile-back-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 13px;
  border: 0;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ---------- Cards ---------- */

.ms-fall-setup-card,
.ms-fall-next-card,
.ms-fall-clinical-note,
.ms-fall-history-search,
.ms-fall-history-empty {
  border-radius: 22px;
  margin-bottom: 14px;
}

.ms-fall-setup-card h2,
.ms-fall-history-search h2,
.ms-fall-history-empty h2 {
  margin-top: 5px;
  margin-bottom: 7px;
}

.ms-fall-setup-card p,
.ms-fall-next-card p,
.ms-fall-clinical-note p,
.ms-fall-history-search p,
.ms-fall-history-empty p {
  line-height: 1.5;
}


/* ---------- Step Indicator ---------- */

.ms-fall-step-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 10px;
  background: rgba(29, 122, 76, 0.12);
}


/* ---------- Inputs ---------- */

.ms-fall-setup-card label,
.ms-fall-history-search label {
  display: block;
  margin-top: 18px;
  margin-bottom: 7px;
  font-weight: 700;
}

.ms-fall-setup-card input,
.ms-fall-history-search input {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 0 15px;
  font-size: 17px;
}

.ms-fall-setup-card .ms-emergency-send,
.ms-fall-history-search .ms-emergency-send {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border-radius: 14px;
  font-weight: 800;
}


/* ---------- Monitoring Status ---------- */

.ms-fall-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ms-fall-status-dot {
  width: 13px;
  height: 13px;
  min-width: 13px;
  border-radius: 50%;
  background: #9aa5a0;
}

.ms-fall-status-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ms-fall-status-row strong {
  font-size: 16px;
}

.ms-fall-status-row small {
  opacity: 0.68;
}


/* ---------- Clinical Safety Note ---------- */

.ms-fall-clinical-note {
  border-left: 4px solid currentColor;
}

.ms-fall-clinical-note strong {
  display: block;
  margin-bottom: 5px;
}


/* ---------- History Empty State ---------- */

.ms-fall-history-empty {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.ms-fall-history-icon-large {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 29px;
  background: rgba(29, 122, 76, 0.10);
}


/* ---------- Workflow Messages ---------- */

.ms-fall-workflow-message {
  min-height: 20px;
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 650;
}


/* ---------- iPhone ---------- */

@media (max-width: 600px) {

  .ms-fall-monitor-page,
  .ms-fall-history-page {
    padding-left: 2px;
    padding-right: 2px;
  }

  .ms-mobile-page-header h1 {
    font-size: 27px;
  }

  .ms-fall-workflow-list .ms-mobile-list-action {
    min-height: 78px;
  }

  .ms-fall-action-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

}


/* ---------- Tablet / Desktop ---------- */

@media (min-width: 768px) {

  .ms-fall-monitor-page,
  .ms-fall-history-page {
    max-width: 760px;
  }

  .ms-fall-workflow-list {
    gap: 14px;
  }

  .ms-fall-workflow-list .ms-mobile-list-action {
    min-height: 88px;
  }

}



/* ============================================================
   MOBILITY SAFE — COMMUNICATION CENTER PREMIUM V1
   ============================================================ */

.ms-comms-shell {
  --ms-green:#153f34;
  --ms-green-2:#205b4b;
  --ms-green-3:#2f725f;
  --ms-mint:#edf7f2;
  --ms-mint-2:#f5faf7;
  --ms-line:#dce9e3;
  --ms-ink:#17352d;
  --ms-muted:#6d8179;
  --ms-red:#b4232c;
  --ms-shadow:0 18px 45px rgba(20,63,52,.09);
  width:100%;
  max-width:760px;
  margin:0 auto;
  padding:0 16px 118px;
  box-sizing:border-box;
}

.ms-comms-shell *,
.ms-comms-shell *::before,
.ms-comms-shell *::after {
  box-sizing:border-box;
}

.ms-comms-topbar {
  position:relative;
  display:grid;
  grid-template-columns:46px minmax(0,1fr) 46px;
  align-items:center;
  gap:10px;
  margin:4px 0 18px;
  padding:8px 0 4px;
}

.ms-comms-back,
.ms-comms-header-message {
  position:relative;
  width:44px;
  height:44px;
  min-width:44px;
  margin:0;
  padding:0;
  border:1px solid var(--ms-line);
  border-radius:14px;
  background:#fff;
  color:var(--ms-green);
  box-shadow:0 5px 16px rgba(20,63,52,.06);
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-comms-back {
  font-size:32px;
  line-height:1;
  font-weight:400;
}

.ms-comms-header-message svg {
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-comms-header-badge {
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border:2px solid #fff;
  border-radius:999px;
  background:#b4232c;
  color:#fff;
  font-size:10px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-comms-heading {
  min-width:0;
}

.ms-comms-kicker {
  margin-bottom:2px;
  color:var(--ms-green-3);
  font-size:10px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.15em;
}

.ms-comms-heading h1 {
  margin:0;
  color:var(--ms-green);
  font-size:24px;
  line-height:1.12;
  font-weight:800;
  letter-spacing:-.025em;
}

.ms-comms-heading p {
  margin:4px 0 0;
  color:var(--ms-muted);
  font-size:12px;
  line-height:1.35;
}

.ms-comms-status-card {
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  padding:17px;
  margin-bottom:22px;
  border:1px solid #d7e8e0;
  border-radius:20px;
  background:
    linear-gradient(135deg,#f8fcfa 0%,#edf7f2 100%);
  box-shadow:var(--ms-shadow);
}

.ms-comms-status-icon {
  width:50px;
  height:50px;
  border-radius:16px;
  background:var(--ms-green);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 20px rgba(21,63,52,.16);
}

.ms-comms-status-icon svg {
  width:25px;
  height:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-comms-status-copy {
  min-width:0;
}

.ms-comms-status-copy > span {
  display:block;
  margin-bottom:3px;
  color:var(--ms-green-3);
  font-size:9px;
  font-weight:900;
  letter-spacing:.13em;
}

.ms-comms-status-copy strong {
  display:block;
  color:var(--ms-ink);
  font-size:16px;
  line-height:1.2;
}

.ms-comms-status-copy small {
  display:block;
  margin-top:4px;
  color:var(--ms-muted);
  font-size:11px;
}

.ms-comms-online,
.ms-thread-secure {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 9px;
  border:1px solid #cee3d9;
  border-radius:999px;
  background:#fff;
  color:#36705f;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
}

.ms-comms-online i,
.ms-thread-secure i {
  width:7px;
  height:7px;
  border-radius:50%;
  background:#31a36f;
  box-shadow:0 0 0 3px rgba(49,163,111,.12);
}

.ms-comms-section {
  margin:0 0 25px;
}

.ms-comms-section-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:0 3px 11px;
}

.ms-comms-section-head span {
  display:block;
  margin-bottom:3px;
  color:#75877f;
  font-size:9px;
  font-weight:900;
  letter-spacing:.14em;
}

.ms-comms-section-head h2 {
  margin:0;
  color:var(--ms-green);
  font-size:18px;
  line-height:1.2;
  font-weight:800;
}

.ms-comms-unread-pill {
  padding:6px 9px;
  border-radius:999px;
  background:#fceced;
  color:#a32029;
  font-size:10px;
  font-weight:800;
}

.ms-comms-action-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:11px;
}

.ms-comms-action {
  min-height:132px;
  margin:0;
  padding:16px;
  border:1px solid var(--ms-line);
  border-radius:20px;
  background:#fff;
  color:var(--ms-ink);
  text-align:left;
  display:grid;
  grid-template-columns:1fr auto;
  grid-template-rows:auto 1fr;
  gap:12px;
  box-shadow:0 8px 25px rgba(20,63,52,.06);
}

.ms-comms-action-primary {
  border-color:#cfe3da;
  background:
    linear-gradient(145deg,#fff 0%,#f1f8f4 100%);
}

.ms-comms-action-icon {
  grid-column:1 / -1;
  width:42px;
  height:42px;
  border-radius:14px;
  background:var(--ms-mint);
  color:var(--ms-green);
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-comms-action-primary .ms-comms-action-icon {
  background:var(--ms-green);
  color:#fff;
}

.ms-comms-action-icon svg {
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-comms-action span:nth-child(2) {
  min-width:0;
}

.ms-comms-action strong {
  display:block;
  color:var(--ms-ink);
  font-size:14px;
  line-height:1.25;
}

.ms-comms-action small {
  display:block;
  margin-top:5px;
  color:var(--ms-muted);
  font-size:11px;
  line-height:1.35;
}

.ms-comms-action b {
  align-self:center;
  color:#8aa097;
  font-size:23px;
  font-weight:400;
}

.ms-comms-conversation-list {
  overflow:hidden;
  border:1px solid var(--ms-line);
  border-radius:20px;
  background:#fff;
  box-shadow:0 8px 25px rgba(20,63,52,.055);
}

.ms-comms-conversation {
  position:relative;
  width:100%;
  min-height:82px;
  margin:0;
  padding:14px 14px;
  border:0;
  border-bottom:1px solid #edf2ef;
  border-radius:0;
  background:#fff;
  color:var(--ms-ink);
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 14px;
  align-items:center;
  gap:11px;
  text-align:left;
  box-shadow:none;
}

.ms-comms-conversation:last-child {
  border-bottom:0;
}

.ms-comms-conversation.is-unread {
  background:#f8fcfa;
}

.ms-comms-avatar,
.ms-thread-avatar,
.ms-thread-mini-avatar {
  border-radius:50%;
  background:#e5f1eb;
  color:var(--ms-green);
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-comms-avatar {
  width:44px;
  height:44px;
  font-size:12px;
}

.ms-comms-conversation-main {
  min-width:0;
  display:block;
}

.ms-comms-conversation-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ms-comms-conversation-top strong {
  overflow:hidden;
  color:var(--ms-ink);
  font-size:13px;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.ms-comms-conversation-top time {
  flex:0 0 auto;
  color:#92a099;
  font-size:9px;
}

.ms-comms-role {
  display:block;
  margin-top:3px;
  overflow:hidden;
  color:#5f786e;
  font-size:10px;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.ms-comms-role i {
  margin:0 3px;
  font-style:normal;
}

.ms-comms-preview {
  display:block;
  margin-top:5px;
  overflow:hidden;
  color:#788b83;
  font-size:11px;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.ms-comms-unread-dot {
  width:9px;
  height:9px;
  border-radius:50%;
  background:#b4232c;
  box-shadow:0 0 0 4px rgba(180,35,44,.08);
}

.ms-comms-chevron {
  color:#94a69f;
  font-size:22px;
}

.ms-comms-empty {
  padding:35px 24px;
  color:var(--ms-muted);
  text-align:center;
}

.ms-comms-empty-icon {
  width:52px;
  height:52px;
  margin:0 auto 12px;
  border-radius:17px;
  background:var(--ms-mint);
  color:var(--ms-green);
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-comms-empty-icon svg {
  width:25px;
  height:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-comms-empty strong {
  display:block;
  color:var(--ms-ink);
  font-size:14px;
}

.ms-comms-empty p {
  max-width:330px;
  margin:6px auto 0;
  font-size:11px;
  line-height:1.5;
}

.ms-comms-security {
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:14px;
  border-radius:16px;
  background:#f5f8f6;
  color:#657a71;
}

.ms-comms-security svg {
  flex:0 0 19px;
  width:19px;
  height:19px;
  fill:none;
  stroke:#426f5f;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-comms-security strong {
  display:block;
  color:#405e53;
  font-size:11px;
}

.ms-comms-security span {
  display:block;
  margin-top:2px;
  font-size:10px;
  line-height:1.4;
}

.ms-compose-card {
  margin-bottom:14px;
  padding:18px;
  border:1px solid var(--ms-line);
  border-radius:21px;
  background:#fff;
  box-shadow:var(--ms-shadow);
}

.ms-compose-step {
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:17px;
}

.ms-compose-step > span {
  width:31px;
  height:31px;
  border-radius:10px;
  background:var(--ms-green);
  color:#fff;
  font-size:12px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-compose-step strong {
  display:block;
  color:var(--ms-ink);
  font-size:14px;
}

.ms-compose-step small {
  display:block;
  margin-top:2px;
  color:var(--ms-muted);
  font-size:10px;
}

.ms-compose-segment {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin-bottom:17px;
  padding:4px;
  border-radius:14px;
  background:#eef4f1;
}

.ms-compose-segment button {
  min-height:40px;
  margin:0;
  border:0;
  border-radius:11px;
  background:transparent;
  color:#6c8178;
  font-size:12px;
  font-weight:800;
  box-shadow:none;
}

.ms-compose-segment button.active {
  background:#fff;
  color:var(--ms-green);
  box-shadow:0 4px 12px rgba(20,63,52,.08);
}

.ms-compose-field {
  margin-top:13px;
}

.ms-compose-field label {
  display:block;
  margin:0 0 7px 2px;
  color:#4f695f;
  font-size:10px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.ms-compose-select-wrap select {
  width:100%;
  min-height:52px;
  margin:0;
  padding:0 42px 0 13px;
  border:1px solid #d9e5df;
  border-radius:14px;
  background:#fbfdfc;
  color:var(--ms-ink);
  font-size:13px;
}

.ms-compose-textarea-wrap {
  position:relative;
}

.ms-compose-textarea-wrap textarea {
  width:100%;
  min-height:145px;
  margin:0;
  padding:14px 50px 14px 14px;
  resize:vertical;
  border:1px solid #d9e5df;
  border-radius:16px;
  background:#fbfdfc;
  color:var(--ms-ink);
  font:inherit;
  font-size:13px;
  line-height:1.5;
}

.ms-compose-mic {
  position:absolute;
  right:10px;
  bottom:10px;
  width:36px;
  height:36px;
  min-width:36px;
  margin:0;
  padding:0;
  border:1px solid #dce8e2;
  border-radius:11px;
  background:#fff;
  color:var(--ms-green);
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-compose-mic svg {
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-compose-secure-note {
  display:flex;
  align-items:center;
  gap:7px;
  margin:12px 2px 15px;
  color:#6e8279;
  font-size:10px;
}

.ms-compose-secure-dot {
  width:7px;
  height:7px;
  border-radius:50%;
  background:#35a674;
}

.ms-compose-send {
  width:100%;
  min-height:52px;
  margin:0;
  padding:0 17px;
  border:0;
  border-radius:15px;
  background:var(--ms-green);
  color:#fff;
  font-size:13px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  box-shadow:0 10px 22px rgba(21,63,52,.17);
}

.ms-compose-send svg {
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-compose-status {
  min-height:17px;
  margin:9px 2px 0;
  color:#9e2730;
  font-size:11px;
}

.ms-thread-identity {
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  padding:14px;
  margin-bottom:11px;
  border:1px solid var(--ms-line);
  border-radius:18px;
  background:#fff;
}

.ms-thread-avatar {
  width:46px;
  height:46px;
  font-size:12px;
}

.ms-thread-identity strong {
  display:block;
  color:var(--ms-ink);
  font-size:13px;
}

.ms-thread-identity span:not(.ms-thread-avatar):not(.ms-thread-secure) {
  display:block;
  margin-top:3px;
  color:var(--ms-muted);
  font-size:10px;
}

.ms-thread-messages {
  min-height:280px;
  max-height:52vh;
  overflow-y:auto;
  padding:16px 3px 20px;
  scroll-behavior:smooth;
}

.ms-thread-row {
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:0 0 17px;
}

.ms-thread-row.is-own {
  justify-content:flex-end;
}

.ms-thread-mini-avatar {
  flex:0 0 32px;
  width:32px;
  height:32px;
  margin-top:18px;
  font-size:9px;
}

.ms-thread-message-wrap {
  max-width:82%;
}

.ms-thread-row.is-own .ms-thread-message-wrap {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
}

.ms-thread-sender {
  margin:0 0 5px 4px;
}

.ms-thread-sender strong {
  display:inline;
  color:#39594d;
  font-size:10px;
}

.ms-thread-sender span {
  margin-left:4px;
  color:#8a9993;
  font-size:9px;
}

.ms-thread-bubble {
  padding:11px 13px;
  border:1px solid #dce8e2;
  border-radius:5px 17px 17px 17px;
  background:#fff;
  color:#29463c;
  font-size:12px;
  line-height:1.48;
  box-shadow:0 5px 14px rgba(20,63,52,.04);
  overflow-wrap:anywhere;
}

.ms-thread-row.is-own .ms-thread-bubble {
  border-color:var(--ms-green);
  border-radius:17px 5px 17px 17px;
  background:var(--ms-green);
  color:#fff;
}

.ms-thread-message-wrap time {
  display:block;
  margin:4px 5px 0;
  color:#94a29d;
  font-size:8px;
}

.ms-thread-composer {
  position:sticky;
  bottom:0;
  z-index:5;
  padding:12px 0 calc(9px + env(safe-area-inset-bottom));
  background:
    linear-gradient(
      to bottom,
      rgba(247,250,248,.4),
      #f7faf8 24%
    );
}

.ms-thread-input {
  display:grid;
  grid-template-columns:minmax(0,1fr) 38px 42px;
  align-items:end;
  gap:7px;
  padding:7px;
  border:1px solid #d7e4de;
  border-radius:18px;
  background:#fff;
  box-shadow:0 10px 28px rgba(20,63,52,.1);
}

.ms-thread-input textarea {
  width:100%;
  min-height:40px;
  max-height:105px;
  margin:0;
  padding:10px 8px;
  resize:none;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ms-ink);
  font:inherit;
  font-size:12px;
}

.ms-thread-tool,
.ms-thread-send {
  width:38px;
  height:38px;
  min-width:38px;
  margin:0;
  padding:0;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-thread-tool {
  border:0;
  background:#edf5f1;
  color:var(--ms-green);
}

.ms-thread-send {
  width:42px;
  min-width:42px;
  border:0;
  background:var(--ms-green);
  color:#fff;
}

.ms-thread-tool svg,
.ms-thread-send svg {
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-thread-encrypted {
  display:block;
  margin-top:7px;
  color:#8b9b95;
  font-size:8px;
  text-align:center;
}

.ms-comms-loading,
.ms-comms-error {
  padding:45px 22px;
  border:1px solid var(--ms-line);
  border-radius:20px;
  background:#fff;
  color:var(--ms-muted);
  text-align:center;
}

.ms-comms-loading strong,
.ms-comms-error strong {
  display:block;
  color:var(--ms-ink);
  font-size:13px;
}

.ms-comms-error p {
  margin:7px auto 14px;
  max-width:380px;
  font-size:11px;
  line-height:1.45;
}

.ms-comms-loading-ring {
  width:30px;
  height:30px;
  margin:0 auto 12px;
  border:3px solid #dceae4;
  border-top-color:var(--ms-green);
  border-radius:50%;
  animation:msCommsSpin .8s linear infinite;
}

@keyframes msCommsSpin {
  to { transform:rotate(360deg); }
}


/* Premium incoming-message card */

.ms-message-overlay {
  top:calc(66px + env(safe-area-inset-top)) !important;
  right:14px !important;
  width:min(405px,calc(100vw - 28px)) !important;
  border:1px solid rgba(21,63,52,.15) !important;
  border-radius:22px !important;
  box-shadow:
    0 24px 65px rgba(12,44,35,.26),
    0 4px 14px rgba(12,44,35,.08) !important;
}

.ms-message-overlay-head {
  min-height:66px;
  padding:13px 15px !important;
  background:
    linear-gradient(135deg,#edf7f2,#f8fcfa) !important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.ms-message-overlay-brand {
  display:flex;
  align-items:center;
  gap:10px;
}

.ms-message-overlay-brand-icon {
  width:38px;
  height:38px;
  border-radius:12px;
  background:#153f34;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ms-message-overlay-brand-icon svg {
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.ms-message-overlay-brand strong {
  display:block;
  color:#173f34;
  font-size:13px;
}

.ms-message-overlay-eyebrow {
  margin-bottom:2px !important;
  font-size:8px !important;
}

.ms-message-overlay-live {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:6px 8px;
  border:1px solid #d3e6dd;
  border-radius:999px;
  background:#fff;
  color:#39705f;
  font-size:8px;
  font-weight:900;
  letter-spacing:.08em;
}

.ms-message-overlay-live i {
  width:6px;
  height:6px;
  border-radius:50%;
  background:#31a36f;
}

.ms-message-overlay-body {
  padding:16px !important;
}

.ms-message-overlay-body h3 {
  font-size:17px;
  font-weight:800;
}

.ms-message-overlay-meta {
  font-size:10px !important;
  font-weight:700;
}

.ms-message-overlay-preview {
  border:1px solid #e2ece7;
  background:#f8fbf9 !important;
  color:#38554b;
  font-size:12px;
  line-height:1.5 !important;
}

.ms-message-overlay-actions button:first-child {
  border:0;
  background:#153f34;
  color:#fff;
}

.ms-message-overlay-actions button:last-child {
  border:1px solid #d9e5df;
  background:#fff;
  color:#486359;
}


/* Existing home Communication Center card gets stronger hierarchy */

.ms-home-action-card[onclick="MS.staffMessagingCenter()"] {
  border-color:#cee2d8;
  background:
    linear-gradient(145deg,#ffffff 0%,#eef7f2 100%);
}

.ms-home-action-card[onclick="MS.staffMessagingCenter()"]
.ms-home-action-icon {
  background:#153f34;
  color:#fff;
}


/* Mobile */

@media (max-width:560px) {

  .ms-comms-shell {
    padding-left:13px;
    padding-right:13px;
  }

  .ms-comms-heading h1 {
    font-size:21px;
  }

  .ms-comms-heading p {
    font-size:10px;
  }

  .ms-comms-status-card {
    grid-template-columns:48px minmax(0,1fr);
  }

  .ms-comms-online {
    grid-column:2;
    width:max-content;
    margin-top:-3px;
  }

  .ms-comms-action-grid {
    grid-template-columns:1fr 1fr;
    gap:9px;
  }

  .ms-comms-action {
    min-height:128px;
    padding:14px;
  }

  .ms-comms-action strong {
    font-size:12px;
  }

  .ms-comms-action small {
    font-size:9px;
  }

  .ms-comms-conversation {
    grid-template-columns:40px minmax(0,1fr) 11px;
    padding:12px;
  }

  .ms-comms-avatar {
    width:40px;
    height:40px;
  }

  .ms-thread-message-wrap {
    max-width:85%;
  }

  .ms-thread-secure {
    padding:6px 7px;
    font-size:7px;
  }

  .ms-message-overlay {
    right:10px !important;
    width:calc(100vw - 20px) !important;
  }
}



/* MS PROFILE + ASSISTANCE PREMIUM INTEGRATION V1 */

.ms-assistance-input {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  padding: 0 15px;
  border: 1px solid rgba(19,74,57,.16);
  border-radius: 14px;
  background: #fff;
  color: #173f33;
  font: inherit;
}

.ms-assistance-input:focus {
  outline: none;
  border-color: rgba(19,74,57,.55);
  box-shadow: 0 0 0 3px rgba(19,74,57,.08);
}

.ms-assistance-routing-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 0;
  padding: 15px;
  border-radius: 16px;
  background: rgba(227,244,237,.72);
  border: 1px solid rgba(19,74,57,.10);
}

.ms-assistance-routing-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #174c3b;
  color: #fff;
  font-weight: 900;
}

.ms-assistance-routing-note strong,
.ms-assistance-routing-note small {
  display: block;
}

.ms-assistance-routing-note strong {
  margin-bottom: 4px;
  color: #173f33;
}

.ms-assistance-routing-note small {
  color: #61736c;
  line-height: 1.45;
}

.ms-assistance-cancel {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #315f50;
  font-weight: 800;
}

.ms-assistance-success {
  margin: 18px 0;
  padding: 34px 22px;
  text-align: center;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(19,74,57,.10);
  box-shadow: 0 14px 38px rgba(18,55,43,.08);
}

.ms-assistance-success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e4f4ed;
  color: #174c3b;
  font-size: 28px;
  font-weight: 900;
}

.ms-assistance-success > span {
  display: block;
  color: #5c756c;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .11em;
}

.ms-assistance-success h2 {
  margin: 8px 0;
  color: #173f33;
}

.ms-assistance-success p {
  max-width: 420px;
  margin: 0 auto 22px;
  color: #64766f;
  line-height: 1.5;
}

.ms-profile-comms {
  margin: 24px 0 20px;
  padding: 20px;
  border: 1px solid rgba(19,74,57,.11);
  border-radius: 22px;
  background:
    linear-gradient(
      180deg,
      rgba(241,249,246,.98),
      rgba(255,255,255,.99)
    );
  box-shadow: 0 12px 32px rgba(18,55,43,.07);
}

.ms-profile-comms-head {
  margin-bottom: 15px;
}

.ms-profile-comms-head > span {
  display: block;
  margin-bottom: 5px;
  color: #527166;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .1em;
}

.ms-profile-comms-head h2 {
  margin: 0 0 5px;
  color: #173f33;
  font-size: 1.22rem;
}

.ms-profile-comms-head p {
  margin: 0;
  color: #65776f;
  font-size: .88rem;
  line-height: 1.45;
}

.ms-profile-comms-grid {
  display: grid;
  gap: 10px;
}

.ms-profile-comms-action {
  display: grid;
  grid-template-columns:
    42px
    minmax(0,1fr)
    auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid rgba(19,74,57,.10);
  border-radius: 16px;
  background: #fff;
  color: #173f33;
  text-align: left;
  box-shadow: 0 5px 15px rgba(18,55,43,.04);
}

.ms-profile-comms-action:active {
  transform: scale(.99);
}

.ms-profile-comms-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #e7f3ee;
  color: #174c3b;
  font-size: 1.05rem;
  font-weight: 900;
}

.ms-profile-comms-assist
.ms-profile-comms-icon {
  background: #174c3b;
  color: #fff;
}

.ms-profile-comms-action strong,
.ms-profile-comms-action small {
  display: block;
}

.ms-profile-comms-action strong {
  margin-bottom: 3px;
  font-size: .93rem;
}

.ms-profile-comms-action small {
  color: #718079;
  font-size: .77rem;
  line-height: 1.3;
}

.ms-profile-comms-action b {
  color: #789087;
  font-size: 1.45rem;
  font-weight: 500;
}

.ms-profile-open-comms {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #174c3b;
  color: #fff;
  font-weight: 800;
}

.ms-profile-open-comms span:last-child {
  font-size: 1.35rem;
}

@media (min-width:700px) {
  .ms-profile-comms-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* MS REQUEST ASSISTANCE COMMUNICATION ROUTING V2 */

.ms-assistance-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.ms-assistance-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid rgba(19,74,57,.11);
  border-radius: 18px;
  background: #fff;
  color: #173f33;
  text-align: left;
  box-shadow: 0 6px 18px rgba(18,55,43,.05);
}

.ms-assistance-action.is-active {
  background:
    linear-gradient(
      145deg,
      #174c3b,
      #246450
    );
  color: #fff;
}

.ms-assistance-action-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e7f3ee;
  color: #174c3b;
  font-size: 1.05rem;
  font-weight: 900;
}

.ms-assistance-action.is-active
.ms-assistance-action-icon {
  background: rgba(255,255,255,.16);
  color: #fff;
}

.ms-assistance-action strong,
.ms-assistance-action small {
  display: block;
}

.ms-assistance-action strong {
  margin-bottom: 4px;
  font-size: .9rem;
}

.ms-assistance-action small {
  color: #718079;
  font-size: .75rem;
  line-height: 1.35;
}

.ms-assistance-action.is-active small {
  color: rgba(255,255,255,.76);
}

@media (max-width:390px) {
  .ms-assistance-action-grid {
    grid-template-columns: 1fr;
  }

  .ms-assistance-action {
    min-height: auto;
  }
}


/* MOBILITY SAFE — PREMIUM CLINICAL PROFILE V1 */

.ms-clinical-profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(25, 88, 70, .12);
  box-shadow:
    0 18px 44px rgba(26, 66, 55, .10),
    0 3px 10px rgba(26, 66, 55, .05);
}

.ms-clinical-profile-hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -90px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

.ms-clinical-profile-hero h1 {
  margin-top: 9px;
  margin-bottom: 6px;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.ms-clinical-profile {
  border: 1px solid #e1ebe6;
  border-radius: 24px;
  box-shadow:
    0 16px 40px rgba(31,68,58,.08),
    0 2px 8px rgba(31,68,58,.04);
}

.ms-clinical-profile > .ms-eyebrow {
  margin-bottom: 5px;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.ms-clinical-profile > h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.45rem;
  letter-spacing: -.025em;
}

/* PT / OT / SPEECH selector */

.ms-clinical-profile [data-rehab-tab] {
  min-height: 68px;
  border-radius: 15px !important;
  border: 1px solid #dce7e2;
  transition:
    transform .16s ease,
    box-shadow .16s ease;
}

.ms-clinical-profile [data-rehab-tab]:active {
  transform: scale(.985);
}

.ms-clinical-profile [data-rehab-tab]:not(.secondary) {
  box-shadow: 0 8px 20px rgba(31,93,75,.16);
}

.ms-clinical-profile [data-rehab-tab] span {
  display: inline-block;
  margin-top: 3px;
  opacity: .78;
  line-height: 1.2;
}

/* Discipline container */

.ms-clinical-profile [data-rehab-panel] {
  margin-top: 8px;
  padding: 21px;
  border: 1px solid #e3ece8;
  border-radius: 20px;
  background:
    linear-gradient(
      180deg,
      rgba(248,252,250,.98) 0%,
      #ffffff 34%
    );
}

.ms-clinical-profile [data-rehab-panel] > .ms-eyebrow {
  margin-bottom: 5px;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.ms-clinical-profile [data-rehab-panel] > h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.38rem;
  letter-spacing: -.025em;
}

/* Clinical information cards */

.ms-clinical-profile .item {
  padding: 14px 15px;
  margin: 9px 0;
  border: 1px solid #e1eae6;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(32,66,57,.035);
}

.ms-clinical-profile .item .muted {
  display: block;
  margin-bottom: 5px;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
  opacity: .68;
}

.ms-clinical-profile .item .big {
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.015em;
}

/* Freshness card */

.ms-clinical-profile
[data-rehab-panel] > .item:first-of-type {
  margin-bottom: 16px !important;
  padding: 14px 15px !important;
  background: #f6faf8;
  border-color: #d9e7e0;
  font-size: .84rem;
  line-height: 1.55;
}

/* Section headings */

.ms-clinical-profile [data-rehab-panel] h3 {
  margin-top: 22px !important;
  margin-bottom: 10px;
  font-size: .98rem;
  font-weight: 900;
}

/* DO / DO NOT */

.ms-clinical-profile .status {
  margin-top: 10px;
  padding: 16px 17px;
  border-radius: 16px;
  line-height: 1.5;
}

.ms-clinical-profile .status strong {
  display: block;
  margin-bottom: 7px;
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .07em;
}

.ms-clinical-profile .status.approved {
  background: #f0f8f4;
  border: 1px solid #cfe5da;
}

.ms-clinical-profile .status.denied {
  background: #fff6f5;
  border: 1px solid #efd7d5;
}

.ms-clinical-profile .status ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.ms-clinical-profile .status li {
  margin: 6px 0;
}

/* Speech clinical grid */

.ms-clinical-profile .profile-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.ms-clinical-profile .profile-grid > div {
  padding: 14px;
  border: 1px solid #e1eae6;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(32,66,57,.035);
}

.ms-clinical-profile .profile-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
  opacity: .68;
}

.ms-clinical-profile .profile-grid strong + div {
  font-size: 1.04rem;
  font-weight: 850;
  line-height: 1.3;
}

/* Recommendations */

.ms-clinical-profile [data-rehab-panel] h3 + p {
  margin-top: 0;
  padding: 15px 16px;
  border: 1px solid #e0e9e5;
  border-radius: 15px;
  background: #f8faf9;
  line-height: 1.58;
}

/* Bottom actions */

.ms-clinical-profile > button {
  min-height: 48px;
  margin-top: 10px;
  border-radius: 14px;
  font-weight: 850;
}

/* iPhone */

@media (max-width: 640px) {

  .ms-clinical-profile-hero,
  .ms-clinical-profile {
    border-radius: 20px;
  }

  .ms-clinical-profile {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ms-clinical-profile [data-rehab-tab] {
    min-height: 64px;
    padding: 9px 4px !important;
    font-size: .84rem !important;
  }

  .ms-clinical-profile [data-rehab-tab] span {
    font-size: .67rem !important;
  }

  .ms-clinical-profile [data-rehab-panel] {
    padding: 16px 13px;
    border-radius: 17px;
  }

  .ms-clinical-profile .profile-grid {
    grid-template-columns: 1fr;
  }

  .ms-clinical-profile
  [data-rehab-panel="ot"]
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet / desktop */

@media (min-width: 768px) {

  .ms-clinical-profile [data-rehab-panel] {
    padding: 24px;
  }

  .ms-clinical-profile .profile-grid {
    gap: 12px;
  }
}
