.safety-center-launcher {
  position: fixed;
  left: 352px;
  right: auto;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
  z-index: 2147482000;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 16px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 999px;
  color: #fff !important;
  background: #b42318 !important;
  box-shadow: 0 10px 28px rgba(27,31,36,.3);
  font: 800 14px/1.1 system-ui, sans-serif;
  cursor: pointer;
}
.safety-center-launcher:hover { background: #8f1b13 !important; transform: translateY(-1px); }
.safety-center-launcher:focus-visible,
.safety-center button:focus-visible,
.safety-center a:focus-visible,
.safety-center input:focus-visible { outline: 3px solid #fbbf24; outline-offset: 3px; }
.safety-center-launcher__pulse {
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 5px rgba(255,255,255,.22);
}
.safety-center {
  width: min(680px, calc(100vw - 24px));
  max-height: min(780px, calc(100dvh - 24px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  color: #15202b;
  background: #f7fafc;
  box-shadow: 0 24px 80px rgba(2, 12, 27, .45);
}
.safety-center::backdrop { background: rgba(2, 12, 27, .72); backdrop-filter: blur(3px); }
.safety-center__head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  padding: 22px 22px 18px; color: #fff;
  background: linear-gradient(135deg, #7f1d1d, #b42318);
}
.safety-center__eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.safety-center h2 { margin: 0; color: #fff; font: 850 clamp(22px, 4vw, 30px)/1.1 system-ui, sans-serif; }
.safety-center__close { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 25px; cursor: pointer; }
.safety-center__body { max-height: calc(100dvh - 118px); padding: 18px 22px 24px; overflow: auto; }
.safety-center__status {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin-bottom: 16px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 12px;
  background: #fff; font-size: 13px;
}
.safety-center__dot { width: 9px; height: 9px; border-radius: 50%; background: #15803d; }
.safety-center__dot.offline { background: #b45309; }
.safety-center__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.safety-center__action {
  display: flex; min-height: 72px; padding: 13px; align-items: center; gap: 12px;
  border: 1px solid #d7e0e8 !important; border-radius: 14px; color: #102a43 !important; background: #fff !important;
  text-decoration: none; text-align: left; cursor: pointer;
}
.safety-center__action:hover { border-color: #0b5cab !important; background: #eff6ff !important; }
.safety-center__action--urgent { border-color: #f2b8b5 !important; color: #7f1d1d !important; background: #fff7f6 !important; }
.safety-center__icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; background: #e9f2fb; font-size: 21px; }
.safety-center__action--urgent .safety-center__icon { background: #fee2e2; }
.safety-center__action strong, .safety-center__action small { display: block; }
.safety-center__action small { margin-top: 3px; color: #526678 !important; line-height: 1.25; }
.safety-center__local {
  margin-top: 16px; padding: 14px; border: 1px solid #cad8e4; border-radius: 14px; background: #eef7fb;
}
.safety-center__local h3 { margin: 0 0 9px; color: #17334d; font-size: 17px; }
.safety-center__barangay {
  width: 100%; min-height: 46px; padding: 9px 11px; border: 2px solid #91aec4;
  border-radius: 10px; color: #102f4a; background: #fff; font: inherit;
}
.safety-center__local-help { margin: 7px 0 0; color: #526b7d; font-size: 13px; line-height: 1.4; }
.safety-center__contact { margin-top: 9px; color: #17334d; font-size: 13px; font-weight: 700; line-height: 1.45; }
.safety-center__call-local {
  min-height: 42px; margin-top: 9px; padding: 8px 12px; border: 0; border-radius: 9px;
  color: #fff !important; background: #9a5c1b !important; font: 800 14px/1.2 system-ui, sans-serif; cursor: pointer;
}
.safety-center__preferences { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.safety-center__preferences button {
  min-height: 42px; padding: 8px 11px; border: 1px solid #9eb7ca !important; border-radius: 9px;
  color: #123754 !important; background: #fff !important; cursor: pointer;
}
.safety-center__preferences button[aria-pressed="true"] { color: #fff !important; background: #075b70 !important; }
.safety-center__search-label { display: block; margin: 18px 0 7px; font-weight: 800; }
.safety-center__search {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 2px solid #a9bac9;
  border-radius: 11px; background: #fff; font-size: 16px;
}
.safety-center__results { display: grid; gap: 7px; margin-top: 10px; }
.safety-center__result {
  width: 100%; padding: 10px 12px; border: 1px solid #d7e0e8; border-radius: 10px;
  color: #16324f !important; background: #fff !important; text-align: left; cursor: pointer;
}
.safety-center__result strong { display: block; }
.safety-center__result span { display: block; margin-top: 2px; color: #627588; font-size: 12px; }
.safety-center__hint { margin: 10px 0 0; color: #617487; font-size: 12px; }

/* The legacy portal contains high-specificity button themes. These rules keep
   this emergency surface readable regardless of the active portal theme. */
body > button.safety-center-launcher {
  border-color: rgba(255,255,255,.9) !important;
  color: #fff !important;
  background: #b42318 !important;
}
#mdrrmoSafetyCenter button.safety-center__action {
  border-color: #d7e0e8 !important;
  color: #102a43 !important;
  background: #fff !important;
}
#mdrrmoSafetyCenter button.safety-center__action .safety-center__icon {
  color: #102a43 !important;
  background: #e9f2fb !important;
}
#mdrrmoSafetyCenter button.safety-center__action small {
  color: #526678 !important;
}
#mdrrmoSafetyCenter button.safety-center__close {
  border-color: rgba(255,255,255,.55) !important;
  color: #fff !important;
  background: rgba(255,255,255,.12) !important;
}
#mdrrmoSafetyCenter button.safety-center__call-local {
  color: #fff !important;
  background: #9a5c1b !important;
}
@media (max-width: 560px) {
  .safety-center__actions { grid-template-columns: 1fr; }
  .safety-center__body { padding: 15px; }
}
@media (max-width: 980px) {
  .mobile-eoc-quick-nav > button.safety-center-launcher {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transform: none !important;
    border-color: rgba(255,255,255,.9) !important;
    color: #fff !important;
    background: #b42318 !important;
    background-image: none !important;
  }
  .mobile-eoc-quick-nav > button.safety-center-launcher:hover,
  .mobile-eoc-quick-nav > button.safety-center-launcher:active {
    color: #fff !important;
    background: #8f1b13 !important;
    background-image: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .safety-center-launcher { transition: none; }
}
@media print { .safety-center-launcher, .safety-center { display: none !important; } }
