:root {
  --red: #D32F2F;
  --red-light: #ef9a9a;
  --red-pale: #fce8e8;
  --blue: #1565C0;
  --blue-light: #90caf9;
  --blue-pale: #e3f2fd;
  --gold: #C9A84C;
  --gold-light: #e8d5a3;
  --navy: #1a2a6c;
  --green: #2e7d32;
  --green-light: #a5d6a7;
  --orange: #e65100;
  --orange-light: #fff3e0;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --white: #fff;
  --shadow: 0 4px 24px rgba(0, 0, 0, .10);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, .14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  min-height: 100vh
}

/* ══════════════════════════════════════════════
   AUTH  —  centered card on red gradient
   ══════════════════════════════════════════════ */
#auth {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  background: linear-gradient(135deg, #b71c1c 0%, #D32F2F 50%, #c62828 100%);
  overflow: hidden;
  padding: 20px
}

#auth.active {
  display: flex !important
}

/* Hide left panel — not used in this layout */
.auth-panel-left {
  display: none !important
}

/* Right panel fills the whole screen as a flex centering wrapper */
.auth-panel-right {
  flex: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  background: transparent;
  background-image: none;
  position: static;
  overflow: visible
}

/* Top utility row — inside the card */
.auth-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px
}

[dir="rtl"] .auth-top-row {
  flex-direction: row-reverse
}

.login-support-top {
  font-size: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 5px 14px;
  background: var(--red);
  border: none;
  border-radius: 8px;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 5px
}

.login-support-top:hover {
  background: #b71c1c
}

.auth-lang-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.auth-lang-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue)
}

.auth-dark-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
  line-height: 1
}

.auth-dark-btn:hover {
  border-color: var(--red)
}

body.dark-mode .auth-lang-btn,
body.dark-mode .auth-dark-btn {
  border-color: rgba(255,255,255,.2);
  color: #e8ecf0
}

/* ── The card ── */
.auth-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: slideup .4s cubic-bezier(.34, 1.56, .64, 1);
  display: flex;
  flex-direction: column;
  margin: auto
}

@keyframes slideup {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Back to home — inline link at bottom of form */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color .2s
}

.auth-back-link:hover { color: var(--red) }

[dir="rtl"] .auth-back-link {
  flex-direction: row-reverse
}

/* Logo header */
.auth-hd {
  text-align: center;
  margin-bottom: 22px;
  margin-top: 8px;
  display: block
}

.auth-hd .ico {
  font-size: 36px;
  display: block;
  margin-bottom: 4px
}

.auth-hd h1 {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -.3px
}

.auth-hd p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px
}

/* Mobile header — same as hd, always shown */
.auth-mobile-header {
  display: none
}

/* ── Tabs — underline style ── */
.atabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  gap: 0
}

.atab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  border-radius: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  user-select: none;
  box-shadow: none;
  background: transparent
}

.atab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: transparent;
  box-shadow: none
}

.atab:not(.active):hover {
  color: var(--text)
}

/* ── Forms ── */
.aform {
  display: none;
  flex-direction: column;
  gap: 13px
}

.aform.active {
  display: flex
}

.af {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.af label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .1px
}

.af-input-wrap {
  position: relative;
  display: flex;
  align-items: center
}

.af-input-icon {
  position: absolute;
  left: 13px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
  line-height: 1
}

[dir="rtl"] .af-input-icon {
  left: auto;
  right: 13px
}

.af input {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  background: #fafafa;
  font-family: inherit
}

[dir="rtl"] .af input {
  padding: 11px 14px
}

.af input:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(211,47,47,.09)
}

.af-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

/* ── Main button ── */
.auth-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  width: 100%;
  letter-spacing: .2px
}

.auth-btn:hover { background: #b71c1c }

.auth-btn:active { background: #a11515 }

.auth-btn:disabled {
  background: var(--red-light);
  cursor: not-allowed
}

.admin-login-btn {
  background: var(--navy);
  box-shadow: none;
  margin-top: 0
}

.admin-login-btn:hover { background: #0d1b4b }

.responder-login-btn {
  background: #1b5e20;
  box-shadow: none;
  margin-top: 0
}

.responder-login-btn:hover { background: #0a3d0a }

/* ── OR divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border)
}

/* ── Alt login grid ── */
.auth-alt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

/* ── Error banner ── */
.aerr {
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  display: none;
  padding: 8px 12px;
  background: var(--red-pale);
  border-radius: 8px
}

.aerr.show {
  display: flex;
  justify-content: center
}

/* ── Password strength & criteria ── */
.hint {
  font-size: 11px;
  margin-top: 2px
}

.hint.ok {
  color: var(--green)
}

.hint.bad {
  color: var(--red)
}

.pw-c {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px
}

.crit {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px
}

.crit::before {
  content: '○';
  font-size: 10px
}

.crit.ok {
  color: var(--green)
}

.crit.ok::before {
  content: '●'
}

.pw-strength {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  display: none
}

.pw-strength.weak {
  display: block;
  color: #fff;
  background: var(--red)
}

.pw-strength.strong {
  display: block;
  color: #fff;
  background: var(--green)
}

/* ── Field-level error text ── */
.field-err {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  margin-top: 2px;
  display: none
}

.field-err.show {
  display: block
}

/* ── Forgot-password back button ── */
.auth-back-btn {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all .2s;
  box-shadow: none
}

.auth-back-btn:hover {
  border-color: var(--red);
  color: var(--red)
}

/* ── Dark mode ── */
body.dark-mode #auth {
  background: linear-gradient(135deg, #3a0a0a 0%, #6b0f0f 50%, #8a1515 100%)
}

body.dark-mode .auth-box {
  background: #1a2235;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.45)
}

body.dark-mode .auth-hd h1 { color: #ef9a9a }
body.dark-mode .auth-hd p  { color: #9aa5b4 }

body.dark-mode .atabs {
  border-bottom-color: rgba(255,255,255,.12);
  background: transparent
}

body.dark-mode .atab.active {
  color: #ef9a9a;
  border-bottom-color: #ef9a9a;
  background: transparent;
  box-shadow: none
}

body.dark-mode .af label { color: #9aa5b4 }

body.dark-mode .auth-back-link { color: rgba(255,255,255,.45) }
body.dark-mode .auth-back-link:hover { color: #ef9a9a }

body.dark-mode .auth-divider { color: rgba(255,255,255,.3) }

body.dark-mode .auth-back-btn {
  border-color: rgba(255,255,255,.15);
  color: #9aa5b4
}

body.dark-mode .auth-back-btn:hover {
  border-color: #ef9a9a;
  color: #ef9a9a
}

/* ── Mobile (phones ≤ 480px) ── */
@media (max-width: 480px) {
  #auth { padding: 12px }
  .auth-box {
    max-width: 100%;
    border-radius: 18px;
    zoom: 0.82
  }
  .af-row { grid-template-columns: 1fr }
  .auth-alt-grid { grid-template-columns: 1fr }
}

/* ── 15.6" laptop — height 768px–860px ── */
@media (max-height: 860px) and (min-width: 600px) {
  .auth-box { zoom: 0.9 }
}

/* ── 14" laptop — height 700px–767px ── */
@media (max-height: 767px) and (min-width: 600px) {
  .auth-box { zoom: 0.82 }
}

/* ── 14" at 125% scale — height ≤ 650px ── */
@media (max-height: 650px) and (min-width: 600px) {
  .auth-box { zoom: 0.72 }
}

/* ── PASSWORD EYE TOGGLE ── */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%
}

/* Input takes all space, leave room for eye button on the right */
.pw-wrap input {
  flex: 1;
  padding-right: 42px
}

[dir="rtl"] .pw-wrap input {
  padding-right: 14px;
  padding-left: 42px
}

/* In RTL the lock icon flips to the right side */
[dir="rtl"] .pw-wrap .af-input-icon {
  left: auto !important;
  right: 13px !important
}

.eye-btn {
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  margin: auto 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  line-height: 1;
  transition: color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  z-index: 2;
  flex-shrink: 0
}

[dir="rtl"] .eye-btn {
  right: auto;
  left: 8px
}

.eye-btn:hover {
  color: var(--red);
  background: rgba(211,47,47,.07)
}

.eye-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none
}

/* ── ONBOARDING POPUP ── */
#ov-welcome .afield input,
#ov-welcome .afield select,
#ov-welcome .afield textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit
}

#ov-welcome .afield input:focus,
#ov-welcome .afield select:focus,
#ov-welcome .afield textarea:focus {
  border-color: var(--red)
}

@media(max-width:640px) {
  #ov-welcome>div>div:nth-child(2) {
    grid-template-columns: 1fr
  }
}

/* ── USER DROPDOWN ── */
.user-menu {
  position: relative;
  cursor: pointer
}

.user-name-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 200px
}

.user-name-btn strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  display: inline-block;
  vertical-align: middle
}

.user-name-btn:hover {
  background: var(--red-pale);
  color: var(--red)
}

.user-name-btn .caret {
  font-size: 10px;
  transition: transform .2s
}

.user-menu.open .caret {
  transform: rotate(180deg)
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 200;
  overflow: hidden
}

.user-menu.open .user-dropdown {
  display: block
}

.user-dropdown button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
  text-align: left;
  transition: background .2s
}

.user-dropdown button:hover {
  background: var(--red-pale)
}

body.rtl .user-dropdown {
  right: auto;
  left: 0
}

body.rtl .user-dropdown button {
  text-align: right
}

/* ── PAGES ── */
.page {
  display: none;
  min-height: 100vh;
  flex-direction: column
}

.page.active {
  display: flex !important
}

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none
}

.navbar::-webkit-scrollbar {
  display: none
}

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  align-items: center;
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0
}

.nav-links::-webkit-scrollbar {
  display: none
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0
}

.logo-icon {
  font-size: 24px;
  color: var(--red)
}

.logo-name {
  font-size: 19px;
  font-weight: 900;
  color: var(--red);
  line-height: 1
}

.logo-sub {
  font-size: 10px;
  color: var(--red)
}

.logo-nums {
  display: flex;
  gap: 5px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center
}

.logo-num {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, opacity .12s;
  user-select: none
}

.logo-num:hover {
  opacity: .85;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.18)
}

.logo-num:active {
  transform: scale(.95)
}

.logo-num.red {
  background: var(--red);
  color: #fff
}

.logo-num.blue {
  background: var(--blue);
  color: #fff
}

.logo-num.orange {
  background: var(--orange);
  color: #fff
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--red)
}

.nav-links a.active-req {
  color: #fff;
  background: var(--red);
  border-radius: 16px;
  padding: 3px 11px;
  font-weight: 700;
  animation: pulsenav 1.5s ease-in-out infinite
}

@keyframes pulsenav {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, .4)
  }

  70% {
    box-shadow: 0 0 0 6px rgba(211, 47, 47, 0)
  }
}

.nav-greet {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap
}

.nav-greet strong {
  color: var(--red)
}

.btn-call {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  flex-shrink: 0
}

.btn-call:hover {
  background: #b71c1c
}

.btn-phones {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.btn-phones:hover {
  background: #0f2a5e
}

.btn-logout {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red)
}

.btn-lang {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0
}

.btn-lang:hover {
  background: var(--blue);
  color: #fff
}

body.rtl {
  direction: rtl;
  font-family: 'Segoe UI', Tahoma, sans-serif
}

body.rtl .navbar {
  flex-direction: row-reverse
}

body.rtl .logo-wrap {
  order: 10
}

/* In RTL push user-menu, lang btn and call btn to the far left */
body.rtl .user-menu {
  order: -3
}

body.rtl .btn-lang {
  order: -2
}

body.rtl .btn-call {
  order: -1
}

/* ── SOS ── */
.sos-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center
}

.sos-hero h1 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 50px
}

.sos-btns {
  display: flex;
  gap: 54px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap
}

.pulse-btn {
  width: 158px;
  height: 158px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  border: none;
  transition: transform .15s;
  user-select: none;
  letter-spacing: .5px
}

.pulse-btn:active {
  transform: scale(.95)
}

.pulse-btn.ambulance {
  background: #fff;
  color: var(--red);
  box-shadow: 0 0 0 10px rgba(211, 47, 47, .2), 0 0 0 24px rgba(211, 47, 47, .08);
  border: 6px solid var(--red)
}

.pulse-btn.police {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 10px rgba(21, 101, 192, .2), 0 0 0 24px rgba(21, 101, 192, .08);
  border: 6px solid var(--blue)
}

.pulse-btn.fire {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 0 10px rgba(211, 47, 47, .2), 0 0 0 24px rgba(211, 47, 47, .08);
  border: 6px solid var(--red)
}

.pulse-btn.pulse {
  animation: pr 1.6s ease-out infinite
}

.pulse-btn.police.pulse {
  animation: pb 1.6s ease-out infinite
}

@keyframes pr {
  0% {
    box-shadow: 0 0 0 6px rgba(211, 47, 47, .35), 0 0 0 18px rgba(211, 47, 47, .15)
  }

  100% {
    box-shadow: 0 0 0 18px rgba(211, 47, 47, 0), 0 0 0 40px rgba(211, 47, 47, 0)
  }
}

@keyframes pb {
  0% {
    box-shadow: 0 0 0 6px rgba(21, 101, 192, .35), 0 0 0 18px rgba(21, 101, 192, .15)
  }

  100% {
    box-shadow: 0 0 0 18px rgba(21, 101, 192, 0), 0 0 0 40px rgba(21, 101, 192, 0)
  }
}

/* ── OVERLAY / MODAL ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .2);
  z-index: 500;
  align-items: center;
  justify-content: center
}

.overlay.active {
  display: flex
}

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 30px 26px 22px;
  max-width: 520px;
  width: 95%;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  max-height: 92vh;
  overflow-y: auto
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.check-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold
}

.check-circle.green {
  background: var(--green);
  color: #fff
}

.check-circle.navy {
  background: var(--navy);
  color: #fff
}

.modal h3 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .5px
}

.modal p {
  font-size: 12.5px;
  color: var(--muted)
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  width: 100%
}

.btn-red {
  background: var(--red);
  color: #fff
}

.btn-red:hover {
  background: #b71c1c
}

.btn-outline {
  background: transparent;
  color: var(--muted)
}

.btn-outline:hover {
  color: var(--red)
}

.btn-gold {
  background: var(--gold-light);
  color: var(--text);
  border: 1px solid var(--gold)
}

.btn-gold:hover {
  background: var(--gold);
  color: #fff
}

/* ── SOS FORM MODAL ── */
.sos-modal-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  width: 100%;
  text-align: left
}

.sos-sec {
  width: 100%;
  text-align: left;
  margin-top: 10px
}

.sos-sec h4 {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border)
}

.sf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px
}

.sf label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted)
}

.sf input,
.sf select,
.sf textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color .2s;
  font-family: inherit
}

.sf input:focus,
.sf select:focus,
.sf textarea:focus {
  border-color: var(--red)
}

.sf textarea {
  resize: vertical;
  min-height: 64px
}

.sf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px
}

.chip {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  user-select: none
}

.chip:hover,
.chip.sel {
  background: var(--red);
  color: #fff;
  border-color: var(--red)
}

.chip.blue:hover,
.chip.blue.sel {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff
}

.chip.orange:hover,
.chip.orange.sel {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff
}

.sev-row {
  display: flex;
  gap: 7px
}

.sev {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 6px 3px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  transition: all .2s
}

.sev.sel-minor {
  background: #fff9c4;
  border-color: #f9a825;
  color: #f9a825
}

.sev.sel-serious {
  background: #ffe0b2;
  border-color: var(--orange);
  color: var(--orange)
}

.sev.sel-critical {
  background: var(--red-pale);
  border-color: var(--red);
  color: var(--red)
}

.ck-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.ck {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer
}

.ck input {
  accent-color: var(--red)
}

.dsteps {
  width: 100%;
  margin-top: 8px
}

.dstep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 3px;
  transition: all .4s
}

.dstep .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background .4s
}

.dstep.done {
  color: var(--muted)
}

.dstep.done .dot {
  background: var(--green)
}

.dstep.cur {
  background: var(--red-pale);
  font-weight: 700;
  color: var(--red)
}

.dstep.cur .dot {
  background: var(--red);
  animation: spin .8s linear infinite
}

/* ── REQUEST PAGE ── */
.req-hd {
  text-align: center;
  padding: 12px 28px 4px
}

.req-card {
  margin: 14px auto;
  max-width: 450px;
  width: 94%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow)
}

.req-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px
}

.req-id {
  font-size: 13px;
  color: var(--muted)
}

.req-id span {
  font-weight: 700;
  color: var(--text)
}

.btn-omaps {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s
}

.btn-omaps:hover {
  border-color: var(--red);
  color: var(--red)
}

.map-box {
  width: 100%;
  height: 190px;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 13px;
  background: #e8f5e9
}

.map-box iframe {
  width: 100%;
  height: 100%;
  border: none
}

.eta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px
}

.eta-val {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700
}

.status-badge {
  background: var(--text);
  color: #fff;
  border-radius: 18px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize
}

.req-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 13px
}

.rtab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s
}

.rtab.active {
  color: var(--text);
  border-bottom-color: var(--text)
}

.rtc {
  display: none
}

.rtc.active {
  display: block
}

.ri-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 5px;
  margin-top: 10px
}

.ri-row {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  margin-bottom: 4px
}

.ri-label {
  color: var(--muted);
  min-width: 88px;
  flex-shrink: 0
}

.ri-val {
  font-weight: 500
}

.wait-box {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 13px
}

.btn-call-resp {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 12px 20px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s;
  width: auto;
  white-space: nowrap;
  letter-spacing: .3px;
}

.btn-call-resp:hover {
  background: #b71c1c
}

/* ── SERVICES ── */
.svc-wrap {
  padding: 26px 40px;
  max-width: 860px
}

.svc-sec {
  margin-bottom: 40px
}

.svc-sec h2 {
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 9px
}

.svc-body {
  display: flex;
  gap: 32px;
  align-items: flex-start
}

.svc-txt {
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted)
}

.svc-txt .hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 6px
}

.svc-txt .hint a {
  color: var(--red);
  cursor: pointer;
  text-decoration: none
}

.svc-img {
  font-size: 66px;
  flex-shrink: 0
}

.svc-btn {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  letter-spacing: .5px;
  margin-top: 12px
}

.svc-btn.ambulance {
  background: #fff;
  color: var(--red);
  border: 5px solid var(--red);
  box-shadow: 0 0 0 7px rgba(211, 47, 47, .12)
}

.svc-btn.police {
  background: var(--blue);
  color: #fff;
  border: 5px solid var(--blue);
  box-shadow: 0 0 0 7px rgba(21, 101, 192, .12)
}

.svc-btn.fire {
  background: var(--red);
  color: #fff;
  border: 5px solid var(--red);
  box-shadow: 0 0 0 7px rgba(211, 47, 47, .12)
}

.svc-div {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 34px
}

/* ── PREMIUM ── */
.prem-wrap {
  padding: 26px 34px
}

.prem-wrap h1 {
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 26px
}

.prem-card {
  max-width: 640px;
  margin: 0 auto;
  border: 2px solid var(--gold);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px;
  cursor: pointer;
  transition: box-shadow .2s
}

.prem-card:hover {
  box-shadow: 0 6px 22px rgba(201, 168, 76, .22)
}

.prem-icon {
  width: 114px;
  height: 114px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 0 7px rgba(201, 168, 76, .2), 0 0 0 14px rgba(201, 168, 76, .08);
  flex-shrink: 0
}

.prem-info h3 {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px
}

.prem-info p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6
}

/* ── BOOKING ── */
.bk-wrap {
  padding: 14px 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: center
}

.bk-icon {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 0 0 7px rgba(201, 168, 76, .2), 0 0 0 14px rgba(201, 168, 76, .08);
  margin-bottom: 22px
}

.bk-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  max-width: 660px;
  width: 100%
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.fg label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600
}

.fg input,
.fg select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit
}

.fg input:focus {
  border-color: var(--red)
}

.phone-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .2s
}

.phone-wrap:focus-within {
  border-color: var(--red)
}

.ph-pre {
  background: #f5f5f5;
  padding: 8px 9px;
  font-size: 12.5px;
  color: var(--muted);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none
}

.phone-wrap input {
  border: none;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  width: 100%
}

.bk-submit {
  text-align: center;
  margin-top: 18px
}

.bk-btn {
  background: transparent;
  border: 1px solid var(--gold-light);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 32px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s
}

.bk-btn:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold)
}

/* ── ABOUT ── */
.ab-wrap {
  padding: 26px 34px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%
}

.ab-wrap h1 {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 16px
}

.ab-intro {
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  margin-bottom: 28px
}

.ab-intro strong {
  color: var(--red)
}

.ab-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px
}

.ab-card {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.ab-img {
  width: 100%;
  height: 140px;
  border-radius: 7px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px
}

.ab-title {
  font-size: 12.5px;
  font-weight: 700
}

.ab-title.red {
  color: var(--red)
}

.ab-title.blue {
  color: var(--blue)
}

.ab-title.orange {
  color: var(--orange)
}

.ab-card p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted)
}

/* ── ACCOUNT / MEDICAL ── */
.acc-wrap {
  padding: 26px 40px;
  max-width: 780px
}

.acc-wrap h2 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 16px
}

.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 32px;
  margin-bottom: 18px
}

.afield {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.acc-ec-group {
  grid-column: 1 / -1
}

.acc-ec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 32px;
  align-items: start
}

.afield label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600
}

.afield .fw {
  position: relative;
  display: flex;
  align-items: center
}

.afield input,
.afield select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  padding-right: 52px;
  font-family: inherit
}

.afield input:focus {
  border-color: var(--red)
}

.afield input[type="date"] {
  padding-right: 11px
}

.fbadge {
  position: absolute;
  right: 9px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9px
}

.fbadge.verify {
  color: var(--red);
  cursor: pointer
}

.fbadge.verified {
  color: var(--green)
}

.unsaved-bar {
  display: none;
  background: #fff3e0;
  border: 1px solid #ffb300;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 14px;
  align-items: center;
  gap: 7px
}

.unsaved-bar.show {
  display: flex
}

.save-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s
}

.save-btn:hover {
  background: #b71c1c
}

/* ── TOAST ── */
#toast {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--navy);
  color: #fff;
  border-radius: 9px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: var(--shadow-md)
}

@media(max-width:640px) {
  .navbar {
    padding: 8px 12px;
    gap: 8px
  }

  .nav-links {
    gap: 8px
  }

  .sos-btns {
    gap: 20px
  }

  .pulse-btn {
    width: 120px;
    height: 120px;
    font-size: 13px
  }

  .acc-grid {
    grid-template-columns: 1fr
  }

  .acc-ec-row {
    grid-template-columns: 1fr
  }

  .bk-form {
    grid-template-columns: 1fr
  }

  .ab-cards {
    grid-template-columns: 1fr
  }

  .svc-body {
    flex-direction: column
  }

  .af-row {
    grid-template-columns: 1fr
  }

  .sf-row {
    grid-template-columns: 1fr
  }
}

/* First Aid Guide */
.fa-wrap {
  padding: 26px 34px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%
}

.fa-wrap h1 {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px
}

.fa-intro {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 26px
}

.fa-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.fa-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden
}

.fa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  background: #fafafa;
  transition: background .2s
}

.fa-header:hover {
  background: var(--red-pale)
}

.fa-header .fa-ico {
  font-size: 20px;
  flex-shrink: 0
}

.fa-header .fa-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform .3s;
  color: var(--muted)
}

.fa-item.open .fa-arrow {
  transform: rotate(180deg)
}

.fa-body {
  display: none;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--border)
}

.fa-item.open .fa-body {
  display: block
}

.fa-steps {
  margin: 8px 0 0 0;
  padding-left: 18px
}

.fa-steps li {
  margin-bottom: 5px
}

.fa-warning {
  background: #fff3e0;
  border: 1px solid #ffb300;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  margin-top: 8px
}

/* SOS hero centered */
.sos-hero {
  justify-content: center
}

/* =========================================================
   LIFELINE FULL REDESIGN THEME — REPLACE YOUR style.css WITH THIS FILE
   Strong futuristic emergency background + glass UI
   Works across user, admin, and responder pages.
========================================================= */

:root {
  --red: #D32F2F;
  --red-light: #ff8a8a;
  --red-pale: #fff0f0;
  --blue: #1565C0;
  --blue-light: #7fc7ff;
  --blue-pale: #eef7ff;
  --gold: #C9A84C;
  --gold-light: #f3df9a;
  --navy: #111f55;
  --green: #2e7d32;
  --green-light: #9be29f;
  --orange: #e65100;
  --orange-light: #fff0df;
  --text: #101828;
  --muted: #5f6b7a;
  --border: rgba(255, 255, 255, .46);
  --white: #fff;
  --shadow: 0 14px 46px rgba(17, 31, 85, .14);
  --shadow-md: 0 22px 70px rgba(17, 31, 85, .20);
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .55);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  position: relative;
  background:
    radial-gradient(circle at 10% 14%, rgba(211, 47, 47, .48), transparent 23%),
    radial-gradient(circle at 88% 20%, rgba(201, 168, 76, .30), transparent 24%),
    radial-gradient(circle at 86% 78%, rgba(21, 101, 192, .46), transparent 25%),
    radial-gradient(circle at 36% 78%, rgba(46, 125, 50, .18), transparent 22%),
    linear-gradient(135deg, #dfe8ff 0%, #f6f8ff 28%, #fff0e8 61%, #e8f2ff 100%) !important;
  background-attachment: fixed !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 10%, rgba(255, 255, 255, .42) 11%, transparent 23%, transparent 58%, rgba(255, 255, 255, .30) 59%, transparent 72%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .50), transparent 48%);
  filter: blur(26px);
  animation: lifelineLightMove 13s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, rgba(17, 31, 85, .10) 0px, rgba(17, 31, 85, .10) 2px, transparent 2px, transparent 42px),
    linear-gradient(rgba(17, 31, 85, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 31, 85, .075) 1px, transparent 1px),
    radial-gradient(rgba(17, 31, 85, .18) 1.15px, transparent 1.2px);
  background-size: auto, 40px 40px, 40px 40px, 24px 24px;
  opacity: .82;
}

@keyframes lifelineLightMove {
  0% {
    transform: translate3d(0, 0, 0) scale(1)
  }

  100% {
    transform: translate3d(28px, -18px, 0) scale(1.07)
  }
}

/* universal transparent page layers */
.page,
.adm-shell,
.adm-main,
.adm-content,
.adm-section,
.rc-shell,
.rc-main,
.rc-content {
  background: transparent !important
}

/* glass containers */
.navbar,
.adm-topbar,
.rc-topbar,
.req-card,
.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap,
.adm-card,
.stat-card,
.rc-card,
.rc-stat,
.adm-box,
.resp-box,
.modal,
.prem-card,
.fa-item,
.svc-sec,
.ab-card {
  background: var(--glass) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--shadow);
}

.navbar,
.adm-topbar,
.rc-topbar {
  background: rgba(255, 255, 255, .72) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .55) !important;
}

.req-card,
.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap,
.adm-card,
.stat-card,
.rc-card,
.rc-stat,
.prem-card,
.fa-item {
  border-radius: 22px !important;
}

/* content spacing for wrappers that originally had no card look */
.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap {
  margin: 28px auto !important;
}

/* strong readable inner cards */
.afield input,
.afield select,
.fg input,
.fg select,
.sf input,
.sf select,
.sf textarea,
.af input,
input,
textarea,
select {
  background: rgba(255, 255, 255, .80) !important;
  border: 1px solid rgba(17, 31, 85, .14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

input:focus,
textarea:focus,
select:focus,
.afield input:focus,
.fg input:focus,
.sf input:focus,
.sf select:focus,
.sf textarea:focus {
  outline: none !important;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 4px rgba(21, 101, 192, .14) !important;
  background: #fff !important;
}

button,
.auth-btn,
.btn-call,
.btn-sm,
.save-btn,
.bk-btn,
.svc-btn,
.pulse-btn {
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease !important;
}

button:hover,
.auth-btn:hover,
.btn-call:hover,
.btn-sm:hover,
.save-btn:hover,
.bk-btn:hover,
.svc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 31, 85, .18) !important;
}

/* SOS page made more dramatic */
.sos-hero h1 {
  font-size: clamp(28px, 4vw, 46px) !important;
  line-height: 1.1;
  text-shadow: 0 6px 24px rgba(17, 31, 85, .14);
}

.pulse-btn {
  box-shadow: 0 18px 44px rgba(17, 31, 85, .16), 0 0 0 12px rgba(255, 255, 255, .38) !important;
}

.pulse-btn.ambulance {
  background: rgba(255, 255, 255, .88) !important;
  color: var(--red) !important;
  border-color: var(--red) !important
}

.pulse-btn.police {
  background: linear-gradient(145deg, #0e56b2, #1976d2) !important;
  color: #fff !important;
  border-color: #5fb4ff !important
}

.pulse-btn.fire {
  background: linear-gradient(145deg, #d32f2f, #ff5b45) !important;
  color: #fff !important;
  border-color: #ffb0a7 !important
}

/* request map */
.map-box {
  box-shadow: 0 12px 32px rgba(17, 31, 85, .13);
  border: 1px solid rgba(255, 255, 255, .7)
}

/* service / about sections */
.svc-sec,
.ab-card,
.fa-item {
  padding: 18px;
  border-radius: 18px;
  overflow: hidden
}

.svc-div {
  border-top-color: rgba(17, 31, 85, .14) !important
}

.fa-header {
  background: rgba(255, 255, 255, .54) !important
}

.fa-body {
  background: rgba(255, 255, 255, .42) !important
}

/* admin and responder pages: override inline/internal pale backgrounds */
.adm-sidebar,
.rc-sidebar {
  background: linear-gradient(180deg, rgba(17, 31, 85, .96), rgba(26, 42, 108, .92)) !important;
  box-shadow: 10px 0 34px rgba(17, 31, 85, .22);
}

.stat-card {
  background: rgba(255, 255, 255, .78) !important
}

table {
  background: rgba(255, 255, 255, .35);
  border-radius: 14px;
  overflow: hidden
}

thead tr {
  background: rgba(255, 255, 255, .62) !important
}

tr:hover td {
  background: rgba(255, 255, 255, .48) !important
}

/* login screens keep branded left panel — no override needed */

body:has(.adm-box) {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .16), transparent 28%),
    radial-gradient(circle at 90% 80%, rgba(21, 101, 192, .38), transparent 28%),
    linear-gradient(135deg, #07133d, #111f55, #243b88) !important;
}

body:has(.resp-box) {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .16), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(165, 214, 167, .30), transparent 28%),
    linear-gradient(135deg, #123d16, #2e7d32, #41a047) !important;
}

.adm-box,
.resp-box {
  background: rgba(255, 255, 255, .82) !important;
  border-radius: 28px !important
}

/* responsive polish */
@media(max-width:820px) {
  .nav-links {
    gap: 12px
  }

  .sos-btns {
    gap: 30px
  }

  .pulse-btn {
    width: 132px;
    height: 132px
  }

  .acc-wrap,
  .med-wrap,
  .fa-wrap,
  .prem-wrap,
  .svc-wrap,
  .bk-wrap,
  .booking-wrap,
  .ab-wrap {
    width: 94%;
    padding: 22px !important
  }
}

@media(max-width:640px) {
  body::after {
    opacity: .55;
    background-size: auto, 34px 34px, 34px 34px, 22px 22px
  }

  .pulse-btn {
    width: 118px;
    height: 118px
  }

  .navbar {
    border-radius: 0 0 18px 18px
  }
}

/* =========================================================
   UPDATE V2 — SMOOTH BACKGROUND + BIGGER FONT + SOS BUTTON MOTION
   Added after the full theme to override the previous grid/dot style.
========================================================= */

/* 1) Bigger readable typography across the whole app */
html {
  font-size: 17px;
}

body {
  font-size: 16.5px !important;
  line-height: 1.55;
}

.nav-links a,
.user-name-btn,
.btn-call,
.btn-lang,
.af label,
.af input,
.afield label,
.afield input,
.afield select,
.fg label,
.fg input,
.fg select,
.sf label,
.sf input,
.sf select,
.sf textarea,
.ri-row,
.svc-txt,
.prem-info p,
.fa-body,
.modal p,
table,
th,
td {
  font-size: 1rem !important;
}

.logo-name {
  font-size: 1.35rem !important;
}

.logo-sub {
  font-size: .78rem !important;
}

.logo-num {
  font-size: .72rem !important;
}

.sos-hero h1 {
  font-size: clamp(34px, 4.8vw, 56px) !important;
}

.sos-hero p,
.sos-hero .subtitle,
.sos-hero .sos-sub {
  font-size: 1.15rem !important;
}

/* 2) Replace harsh grid/dots with a smooth cinematic background */
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(211, 47, 47, .42), transparent 27%),
    radial-gradient(circle at 82% 22%, rgba(201, 168, 76, .25), transparent 26%),
    radial-gradient(circle at 88% 78%, rgba(21, 101, 192, .42), transparent 30%),
    radial-gradient(circle at 40% 86%, rgba(46, 125, 50, .16), transparent 24%),
    linear-gradient(135deg, #dfe8ff 0%, #f7f9ff 35%, #fff1e8 68%, #eaf3ff 100%) !important;
  background-attachment: fixed !important;
}

/* soft animated lighting only — no dots, no lines */
body::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .62), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, .45), transparent 34%),
    linear-gradient(120deg, transparent 0 12%, rgba(255, 255, 255, .30) 18%, transparent 32%, transparent 60%, rgba(255, 255, 255, .22) 68%, transparent 84%) !important;
  filter: blur(18px) !important;
  opacity: .95 !important;
}

body::after {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .58), transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(17, 31, 85, .10), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, .18)) !important;
  background-size: auto !important;
  opacity: .85 !important;
}

/* 3) SOS buttons: restore breathing pulse + hover grow */
.pulse-btn {
  width: 166px !important;
  height: 166px !important;
  font-size: 1.08rem !important;
  transform: scale(1);
  will-change: transform, box-shadow;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease !important;
}

.pulse-btn:hover {
  transform: scale(1.10) !important;
  filter: brightness(1.05);
}

.pulse-btn:active {
  transform: scale(.96) !important;
}

.pulse-btn.ambulance,
.pulse-btn.fire {
  animation: sosPulseRed 1.65s ease-in-out infinite !important;
}

.pulse-btn.police {
  animation: sosPulseBlue 1.65s ease-in-out infinite !important;
}

.pulse-btn.ambulance:hover,
.pulse-btn.fire:hover {
  animation: sosPulseRedHover 1.2s ease-in-out infinite !important;
}

.pulse-btn.police:hover {
  animation: sosPulseBlueHover 1.2s ease-in-out infinite !important;
}

@keyframes sosPulseRed {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 9px rgba(211, 47, 47, .24), 0 0 0 24px rgba(211, 47, 47, .10), 0 18px 44px rgba(17, 31, 85, .16);
  }

  50% {
    transform: scale(1.055);
    box-shadow: 0 0 0 15px rgba(211, 47, 47, .16), 0 0 0 38px rgba(211, 47, 47, .04), 0 24px 56px rgba(17, 31, 85, .22);
  }
}

@keyframes sosPulseBlue {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 9px rgba(21, 101, 192, .24), 0 0 0 24px rgba(21, 101, 192, .10), 0 18px 44px rgba(17, 31, 85, .16);
  }

  50% {
    transform: scale(1.055);
    box-shadow: 0 0 0 15px rgba(21, 101, 192, .16), 0 0 0 38px rgba(21, 101, 192, .04), 0 24px 56px rgba(17, 31, 85, .22);
  }
}

@keyframes sosPulseRedHover {

  0%,
  100% {
    transform: scale(1.10);
    box-shadow: 0 0 0 10px rgba(211, 47, 47, .26), 0 0 0 28px rgba(211, 47, 47, .11), 0 26px 62px rgba(17, 31, 85, .24);
  }

  50% {
    transform: scale(1.16);
    box-shadow: 0 0 0 18px rgba(211, 47, 47, .17), 0 0 0 44px rgba(211, 47, 47, .05), 0 30px 72px rgba(17, 31, 85, .28);
  }
}

@keyframes sosPulseBlueHover {

  0%,
  100% {
    transform: scale(1.10);
    box-shadow: 0 0 0 10px rgba(21, 101, 192, .26), 0 0 0 28px rgba(21, 101, 192, .11), 0 26px 62px rgba(17, 31, 85, .24);
  }

  50% {
    transform: scale(1.16);
    box-shadow: 0 0 0 18px rgba(21, 101, 192, .17), 0 0 0 44px rgba(21, 101, 192, .05), 0 30px 72px rgba(17, 31, 85, .28);
  }
}

/* Make glass panels a bit more readable with the bigger font */
.navbar,
.adm-topbar,
.rc-topbar,
.req-card,
.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap,
.adm-card,
.stat-card,
.rc-card,
.rc-stat,
.adm-box,
.resp-box,
.modal,
.prem-card,
.fa-item,
.svc-sec,
.ab-card {
  background: rgba(255, 255, 255, .74) !important;
}

@media(max-width:820px) {
  .pulse-btn {
    width: 142px !important;
    height: 142px !important;
    font-size: 1rem !important;
  }
}

@media(max-width:640px) {
  html {
    font-size: 16px;
  }

  .pulse-btn {
    width: 122px !important;
    height: 122px !important;
    font-size: .92rem !important;
  }
}


/* =========================================================
   LIFELINE V3 REFINEMENTS
   - synchronized SOS pulse with fading rings
   - smoother background without dots/lines
   - bigger readable fonts
   - clearer emergency numbers
   - better use of empty space
   - first aid visual cards
========================================================= */

:root {
  --ll-bg-a: #e7efff;
  --ll-bg-b: #fff2ea;
  --ll-bg-c: #edf6ff;
  --ll-soft-red: rgba(211, 47, 47, .30);
  --ll-soft-blue: rgba(21, 101, 192, .28);
  --ll-soft-gold: rgba(201, 168, 76, .20);
}

html {
  font-size: 17px;
}

body {
  font-size: 1rem !important;
  line-height: 1.55;
  background:
    radial-gradient(circle at 12% 18%, var(--ll-soft-red), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, .85), transparent 26%),
    radial-gradient(circle at 82% 78%, var(--ll-soft-blue), transparent 32%),
    radial-gradient(circle at 48% 45%, var(--ll-soft-gold), transparent 36%),
    linear-gradient(135deg, var(--ll-bg-a) 0%, var(--ll-bg-b) 52%, var(--ll-bg-c) 100%) !important;
  background-attachment: fixed !important;
}

body::before,
body::after {
  display: none !important;
  content: none !important;
}

/* More readable text everywhere */
p,
li,
label,
input,
textarea,
select,
button,
a,
td,
th,
.af label,
.af input,
.ri-row,
.ri-label,
.ri-val,
.fa-body,
.fa-header,
.nav-links a {
  font-size: 1rem;
}

.nav-links a {
  font-weight: 750;
}

.logo-name {
  font-size: 1.28rem !important;
}

.logo-sub {
  font-size: .78rem !important;
}

/* Clearer emergency numbers in navbar */
.logo-nums {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap;
  margin-top: 6px !important;
}

.logo-num {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 5px 9px !important;
  border-radius: 999px !important;
  font-size: .86rem !important;
  font-weight: 900 !important;
  letter-spacing: .2px;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 0 4px 12px rgba(13, 27, 75, .12);
  border: 1px solid rgba(255, 255, 255, .75);
}

.logo-num.red {
  color: var(--red) !important;
  border-color: rgba(211, 47, 47, .22)
}

.logo-num.blue {
  color: var(--blue) !important;
  border-color: rgba(21, 101, 192, .22)
}

.logo-num.orange {
  color: var(--orange) !important;
  border-color: rgba(230, 81, 0, .22)
}

/* Better use of empty space */
.page {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 38px;
}

.sos-hero {
  min-height: calc(100vh - 118px);
  padding: 56px 5vw 72px !important;
}

.sos-hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.9rem) !important;
  line-height: 1.08;
  margin-bottom: 64px !important;
  max-width: 1100px;
}

.sos-btns {
  width: min(1120px, 94vw);
  gap: clamp(38px, 6vw, 86px) !important;
}

.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap,
.req-card {
  width: min(1180px, 94vw) !important;
  max-width: 1180px !important;
  margin: 34px auto !important;
  padding: clamp(28px, 4vw, 48px) !important;
}

.req-card {
  max-width: 1050px !important;
}

.acc-grid,
.med-grid {
  gap: 22px !important;
}

/* Strong synchronized SOS pulse */
.pulse-btn {
  position: relative !important;
  isolation: isolate;
  width: clamp(152px, 15vw, 190px) !important;
  height: clamp(152px, 15vw, 190px) !important;
  font-size: clamp(1rem, 1.15vw, 1.22rem) !important;
  border-width: 7px !important;
  animation: sosUnifiedPulse 1.75s ease-in-out infinite !important;
  animation-delay: 0s !important;
  transition: transform .22s ease, filter .22s ease, box-shadow .22s ease !important;
  overflow: visible !important;
}

.pulse-btn::before,
.pulse-btn::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  z-index: -1;
  border: 3px solid currentColor;
  opacity: .38;
  animation: sosRingFade 1.75s ease-out infinite;
  animation-delay: 0s !important;
  pointer-events: none;
}

.pulse-btn::after {
  inset: -30px;
  opacity: .22;
  animation-name: sosRingFadeWide;
}

.pulse-btn:hover {
  transform: scale(1.13) !important;
  filter: brightness(1.08) saturate(1.05);
  animation: sosUnifiedPulseHover 1.35s ease-in-out infinite !important;
}

.pulse-btn:hover::before,
.pulse-btn:hover::after {
  animation-duration: 1.35s;
}

.pulse-btn:active {
  transform: scale(.96) !important;
}

.pulse-btn.ambulance,
.pulse-btn.fire {
  box-shadow: 0 18px 42px rgba(211, 47, 47, .26), 0 0 0 10px rgba(211, 47, 47, .22), 0 0 0 28px rgba(211, 47, 47, .10) !important;
}

.pulse-btn.police {
  box-shadow: 0 18px 42px rgba(21, 101, 192, .26), 0 0 0 10px rgba(21, 101, 192, .22), 0 0 0 28px rgba(21, 101, 192, .10) !important;
}

@keyframes sosUnifiedPulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.07)
  }
}

@keyframes sosUnifiedPulseHover {

  0%,
  100% {
    transform: scale(1.13)
  }

  50% {
    transform: scale(1.20)
  }
}

@keyframes sosRingFade {
  0% {
    transform: scale(.90);
    opacity: .46
  }

  70% {
    opacity: .12
  }

  100% {
    transform: scale(1.28);
    opacity: 0
  }
}

@keyframes sosRingFadeWide {
  0% {
    transform: scale(.88);
    opacity: .28
  }

  75% {
    opacity: .08
  }

  100% {
    transform: scale(1.45);
    opacity: 0
  }
}

/* Cleaner stronger panels on smooth background */
.navbar,
.adm-topbar,
.rc-topbar,
.req-card,
.acc-wrap,
.med-wrap,
.fa-wrap,
.prem-wrap,
.svc-wrap,
.bk-wrap,
.booking-wrap,
.ab-wrap,
.adm-card,
.stat-card,
.rc-card,
.rc-stat,
.adm-box,
.resp-box,
.modal,
.prem-card,
.fa-item,
.svc-sec,
.ab-card {
  background: rgba(255, 255, 255, .78) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .68) !important;
  box-shadow: 0 16px 48px rgba(13, 27, 75, .12), 0 3px 12px rgba(13, 27, 75, .05) !important;
}

/* First Aid: visual, more useful cards */
.fa-wrap {
  max-width: 1240px !important;
}

.fa-wrap h1 {
  font-size: clamp(2rem, 3vw, 3rem) !important;
}

.fa-intro {
  font-size: 1.08rem !important;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.fa-accordion {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px !important;
  align-items: start;
}

.fa-item {
  border-radius: 24px !important;
  overflow: hidden;
}

.fa-header {
  min-height: 82px;
  padding: 20px 22px !important;
  font-size: 1.12rem !important;
}

.fa-header .fa-ico {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(211, 47, 47, .12);
  font-size: 1.7rem !important;
}

.fa-body {
  padding: 0 22px 22px !important;
  color: #374151 !important;
}

.fa-body-inner {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  align-items: start;
  padding-top: 18px;
}

.fa-visual {
  min-height: 190px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 12px 30px rgba(13, 27, 75, .16);
  position: relative;
  overflow: hidden;
}

.fa-visual::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .50), transparent 28%), radial-gradient(circle at 80% 90%, rgba(255, 255, 255, .25), transparent 32%);
}

.fa-visual-icon {
  font-size: 3.3rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.fa-visual-title {
  font-weight: 900;
  font-size: 1.02rem;
  position: relative;
  z-index: 1;
}

.fa-visual-sub {
  font-size: .82rem;
  opacity: .92;
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

.fa-visual.cpr {
  background: linear-gradient(145deg, #b71c1c, #ef5350)
}

.fa-visual.bleeding {
  background: linear-gradient(145deg, #8e0000, #d32f2f)
}

.fa-visual.burns {
  background: linear-gradient(145deg, #e65100, #ff9800)
}

.fa-visual.fracture {
  background: linear-gradient(145deg, #455a64, #90a4ae)
}

.fa-visual.choking {
  background: linear-gradient(145deg, #0d47a1, #42a5f5)
}

.fa-visual.shock {
  background: linear-gradient(145deg, #4a148c, #ab47bc)
}

.fa-visual.stroke {
  background: linear-gradient(145deg, #1a2a6c, #5c6bc0)
}

.fa-steps {
  font-size: 1rem !important;
  line-height: 1.75;
}

.fa-steps li {
  margin-bottom: 8px !important;
}

.fa-warning {
  font-size: .95rem !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
}

/* Dashboard/admin uses space better */
.adm-content {
  padding: 34px clamp(24px, 4vw, 54px) !important;
}

.stat-grid {
  gap: 22px !important;
}

.dash-cols {
  gap: 26px !important;
}

@media(max-width:960px) {
  html {
    font-size: 16px;
  }

  .fa-accordion {
    grid-template-columns: 1fr !important;
  }

  .fa-body-inner {
    grid-template-columns: 1fr;
  }

  .fa-visual {
    min-height: 160px;
  }
}

@media(max-width:640px) {
  html {
    font-size: 15.5px;
  }

  .logo-nums {
    gap: 5px !important;
  }

  .logo-num {
    font-size: .76rem !important;
    padding: 4px 7px !important;
  }

  .pulse-btn {
    width: 122px !important;
    height: 122px !important;
    font-size: .88rem !important;
  }

  .sos-btns {
    gap: 24px !important;
  }
}

/* =========================================================
   LIFELINE V4 FIXES
   - font reduced from V3
   - smooth background only, no visual noise
   - synchronized SOS pulse with clearer fading circles
   - first aid mannequin-style training illustrations
========================================================= */

html {
  font-size: 15.5px !important;
}

body {
  font-size: .96rem !important;
  line-height: 1.5 !important;
}

p,
li,
label,
input,
textarea,
select,
button,
a,
td,
th,
.af label,
.af input,
.ri-row,
.ri-label,
.ri-val,
.fa-body,
.fa-header,
.nav-links a {
  font-size: .96rem !important;
}

.nav-links a {
  font-size: .92rem !important;
  font-weight: 700 !important;
}

.user-name-btn,
.btn-call,
.btn-lang {
  font-size: .9rem !important;
}

.logo-name {
  font-size: 1.18rem !important;
}

.logo-sub {
  font-size: .68rem !important;
}

.logo-num {
  font-size: .78rem !important;
  padding: 4px 8px !important;
}

.sos-hero h1 {
  font-size: clamp(1.9rem, 3.3vw, 3.25rem) !important;
}

.fa-wrap h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.4rem) !important;
}

.fa-intro {
  font-size: .98rem !important;
}

/* Smoother background — stronger color but no dots/lines */
body {
  background:
    radial-gradient(circle at 10% 18%, rgba(211, 47, 47, .36), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(201, 168, 76, .24), transparent 27%),
    radial-gradient(circle at 88% 78%, rgba(21, 101, 192, .36), transparent 31%),
    radial-gradient(circle at 38% 88%, rgba(46, 125, 50, .13), transparent 25%),
    linear-gradient(135deg, #e5edff 0%, #f8fbff 34%, #fff0e8 66%, #e8f3ff 100%) !important;
  background-attachment: fixed !important;
}

body::before,
body::after {
  display: none !important;
  content: none !important;
}

/* SOS pulse — all three exactly synced, stronger fading rings */
.pulse-btn {
  animation: sosSyncPulse 1.55s ease-in-out infinite !important;
  animation-delay: 0s !important;
  overflow: visible !important;
}

.pulse-btn::before,
.pulse-btn::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: -1 !important;
  animation: sosCircleFade 1.55s ease-out infinite !important;
  animation-delay: 0s !important;
}

.pulse-btn::before {
  inset: -17px !important;
  border: 4px solid rgba(211, 47, 47, .38) !important;
}

.pulse-btn::after {
  inset: -36px !important;
  border: 3px solid rgba(211, 47, 47, .22) !important;
  animation-name: sosCircleFadeWide !important;
}

.pulse-btn.police::before {
  border-color: rgba(21, 101, 192, .42) !important;
}

.pulse-btn.police::after {
  border-color: rgba(21, 101, 192, .24) !important;
}

.pulse-btn.fire::before {
  border-color: rgba(230, 81, 0, .42) !important;
}

.pulse-btn.fire::after {
  border-color: rgba(230, 81, 0, .24) !important;
}

.pulse-btn:hover {
  animation: sosSyncPulseHover 1.15s ease-in-out infinite !important;
  transform: scale(1.12) !important;
}

.pulse-btn:hover::before,
.pulse-btn:hover::after {
  animation-duration: 1.15s !important;
}

@keyframes sosSyncPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.065);
  }
}

@keyframes sosSyncPulseHover {

  0%,
  100% {
    transform: scale(1.12);
  }

  50% {
    transform: scale(1.19);
  }
}

@keyframes sosCircleFade {
  0% {
    transform: scale(.86);
    opacity: .70;
  }

  65% {
    opacity: .18;
  }

  100% {
    transform: scale(1.38);
    opacity: 0;
  }
}

@keyframes sosCircleFadeWide {
  0% {
    transform: scale(.82);
    opacity: .45;
  }

  70% {
    opacity: .10;
  }

  100% {
    transform: scale(1.58);
    opacity: 0;
  }
}

/* First Aid: training-mannequin illustration panels */
.fa-accordion {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

.fa-header {
  min-height: 68px !important;
  padding: 16px 18px !important;
  font-size: 1rem !important;
}

.fa-header .fa-ico {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  font-size: 1.35rem !important;
}

.fa-body {
  padding: 0 18px 18px !important;
}

.fa-body-inner {
  grid-template-columns: 230px 1fr !important;
  gap: 18px !important;
  align-items: start;
}

.training-illustration {
  min-height: 210px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(238, 244, 255, .78));
  border: 1px solid rgba(17, 31, 85, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65), 0 12px 28px rgba(13, 27, 75, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.training-illustration svg {
  width: 100%;
  height: auto;
  display: block;
}

.training-illustration text {
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 800;
  fill: #1a2a6c;
}

.training-illustration .skin {
  fill: #f3d3bd;
  stroke: #b88265;
  stroke-width: 2;
}

.training-illustration .body {
  fill: #d9e6ff;
  stroke: #1a2a6c;
  stroke-width: 3;
}

.training-illustration .bed {
  fill: #ffffff;
  stroke: #90a4c8;
  stroke-width: 2;
}

.training-illustration .centerline {
  stroke: #d32f2f;
  stroke-width: 3;
  stroke-dasharray: 5 5;
}

.training-illustration .target {
  fill: rgba(211, 47, 47, .18);
  stroke: #d32f2f;
  stroke-width: 4;
}

.training-illustration .arrow {
  stroke: #d32f2f;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.training-illustration .hands {
  fill: #ffffff;
  stroke: #d32f2f;
  stroke-width: 3;
}

.training-illustration .cloth {
  fill: #ffffff;
  stroke: #1a2a6c;
  stroke-width: 3;
}

.training-illustration .blood {
  fill: #d32f2f;
}

.training-illustration .burn {
  fill: #ff7043;
  stroke: #e65100;
  stroke-width: 3;
}

.training-illustration .water {
  stroke: #1565c0;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
}

.training-illustration .tap {
  fill: #1565c0;
}

.training-illustration .limb,
.training-illustration .leg,
.training-illustration .arm {
  stroke: #d9e6ff;
  stroke-width: 18;
  stroke-linecap: round;
  fill: none;
}

.training-illustration .fracture {
  stroke: #d32f2f;
  stroke-width: 5;
  stroke-linecap: round;
}

.training-illustration .splint {
  fill: rgba(255, 255, 255, .45);
  stroke: #1a2a6c;
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.training-illustration .impact {
  fill: rgba(211, 47, 47, .18);
  stroke: #d32f2f;
  stroke-width: 4;
}

.training-illustration .fastbox {
  fill: #ffffff;
  stroke: #1565c0;
  stroke-width: 3;
}

.training-illustration .fasttxt {
  font-size: 23px;
  font-weight: 900;
  fill: #1565c0;
}

.training-illustration .face {
  stroke: #d32f2f;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}

.cpr-ill {
  background: linear-gradient(145deg, #fff7f7, #eaf1ff);
}

.bleeding-ill {
  background: linear-gradient(145deg, #fff2f2, #ffffff);
}

.burns-ill {
  background: linear-gradient(145deg, #fff5eb, #ffffff);
}

.fracture-ill {
  background: linear-gradient(145deg, #f3f7fb, #ffffff);
}

.choking-ill {
  background: linear-gradient(145deg, #edf5ff, #ffffff);
}

.shock-ill {
  background: linear-gradient(145deg, #f6f0ff, #ffffff);
}

.stroke-ill {
  background: linear-gradient(145deg, #eef2ff, #ffffff);
}

.fa-steps {
  font-size: .94rem !important;
  line-height: 1.65 !important;
}

.fa-warning {
  font-size: .88rem !important;
}

@media(max-width:960px) {
  html {
    font-size: 15px !important;
  }

  .fa-accordion {
    grid-template-columns: 1fr !important;
  }

  .fa-body-inner {
    grid-template-columns: 1fr !important;
  }

  .training-illustration {
    min-height: 180px;
  }
}

@media(max-width:640px) {
  html {
    font-size: 14.5px !important;
  }

  .pulse-btn {
    width: 116px !important;
    height: 116px !important;
  }
}

/* =========================================================
   V5 FIXES — exact SOS sync + clearer name UI + infographic first aid
========================================================= */

/* Slightly smaller, readable font */
html {
  font-size: 15px !important;
}

body {
  font-size: .94rem !important;
}

p,
li,
label,
input,
textarea,
select,
button,
a,
td,
th,
.af label,
.af input,
.ri-row,
.ri-label,
.ri-val,
.fa-body,
.fa-header,
.nav-links a {
  font-size: .94rem !important;
}

.nav-links a {
  font-size: .9rem !important;
}

.user-name-btn,
.btn-call,
.btn-lang {
  font-size: .88rem !important;
}

/* Make emergency numbers clearer */
.logo-nums {
  gap: 7px !important;
  margin-top: 5px !important;
}

.logo-num {
  font-size: .82rem !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: #fff !important;
  border: 2px solid currentColor !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .10) !important;
  letter-spacing: .2px !important;
}

.logo-num.red {
  color: var(--red) !important;
}

.logo-num.blue {
  color: var(--blue) !important;
}

.logo-num.orange {
  color: var(--orange) !important;
}

/* User name: clearer and avoids looking like default text */
.user-name-btn strong {
  color: var(--red) !important;
  font-weight: 900 !important;
  max-width: 180px !important;
}

.user-name-btn strong:empty::after {
  content: 'User';
}

/* SOS pulse — one master timing for the 3 buttons, same fading process */
.pulse-btn {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  animation: sosMasterPulse 1.45s cubic-bezier(.45, 0, .2, 1) infinite !important;
  animation-delay: 0s !important;
  will-change: transform !important;
}

.pulse-btn::before,
.pulse-btn::after {
  content: "" !important;
  position: absolute !important;
  inset: -18px !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: -1 !important;
  border: 4px solid rgba(211, 47, 47, .42) !important;
  opacity: 0 !important;
  transform: scale(.78) !important;
  animation: sosMasterRing 1.45s cubic-bezier(.25, .8, .25, 1) infinite !important;
  animation-delay: 0s !important;
}

.pulse-btn::after {
  inset: -38px !important;
  border-width: 3px !important;
  opacity: 0 !important;
  animation-name: sosMasterRingWide !important;
}

.pulse-btn.ambulance::before,
.pulse-btn.ambulance::after {
  border-color: rgba(211, 47, 47, .46) !important;
}

.pulse-btn.police::before,
.pulse-btn.police::after {
  border-color: rgba(21, 101, 192, .46) !important;
}

.pulse-btn.fire::before,
.pulse-btn.fire::after {
  border-color: rgba(230, 81, 0, .46) !important;
}

.pulse-btn:hover {
  animation: sosMasterPulseHover 1.45s cubic-bezier(.45, 0, .2, 1) infinite !important;
}

.pulse-btn:hover::before,
.pulse-btn:hover::after {
  animation-duration: 1.45s !important;
}

@keyframes sosMasterPulse {

  0%,
  100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.075);
  }

  60% {
    transform: scale(1.075);
  }
}

@keyframes sosMasterPulseHover {

  0%,
  100% {
    transform: scale(1.10);
  }

  45% {
    transform: scale(1.20);
  }

  60% {
    transform: scale(1.20);
  }
}

@keyframes sosMasterRing {
  0% {
    opacity: .72;
    transform: scale(.78);
  }

  45% {
    opacity: .35;
    transform: scale(1.12);
  }

  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes sosMasterRingWide {
  0% {
    opacity: .48;
    transform: scale(.72);
  }

  45% {
    opacity: .22;
    transform: scale(1.20);
  }

  100% {
    opacity: 0;
    transform: scale(1.82);
  }
}

/* First Aid infographic page */
.fa-wrap {
  max-width: 1180px !important;
  padding: 34px 30px !important;
}

.fa-intro {
  max-width: 760px;
  margin: 0 auto 24px !important;
}

.fa-accordion.infographic-aid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

.aid-poster {
  background: #fff !important;
  border: 4px solid #0b8f3a !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .13) !important;
}

.aid-title {
  background: #078c39;
  color: #fff;
  padding: 12px 16px;
  font-size: 1.25rem;
  font-weight: 1000;
  letter-spacing: .2px;
}

.aid-sub {
  background: #e7f7eb;
  color: #06702e;
  padding: 7px 16px;
  font-size: .88rem;
  font-weight: 800;
  border-bottom: 3px solid #078c39;
}

.aid-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.aid-step {
  min-height: 190px;
  padding: 10px;
  border-right: 3px solid #078c39;
  border-bottom: 3px solid #078c39;
  position: relative;
  background: #fffaf0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.aid-step:nth-child(3n) {
  border-right: none;
}

.aid-step:nth-last-child(-n+3) {
  border-bottom: none;
}

.aid-num {
  position: absolute;
  top: 6px;
  left: 9px;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 1000;
  color: #078c39;
}

.aid-step svg {
  width: 100%;
  height: 118px;
  margin-top: 18px;
}

.aid-step p {
  font-size: .78rem !important;
  line-height: 1.22 !important;
  font-weight: 750;
  color: #111;
  margin-top: 6px;
}

.aid-donts {
  background: #fff1c7 !important;
}

.aid-donts .aid-num,
.aid-donts strong {
  color: #d32f2f !important;
}

.svg-skin {
  fill: #f5b48e;
}

.svg-red {
  fill: #d32f2f;
}

.svg-blue {
  fill: #4aa3ff;
}

.svg-green {
  fill: #078c39;
}

.svg-dark {
  fill: #263238;
}

.svg-cloth {
  fill: #f8f8f8;
  stroke: #b0bec5;
  stroke-width: 3;
}

.svg-arrow {
  stroke: #078c39;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.svg-water {
  stroke: #4aa3ff;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: .78;
}

.svg-line {
  stroke: #263238;
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
}

@media(max-width:900px) {
  .fa-accordion.infographic-aid {
    grid-template-columns: 1fr !important;
  }

  .aid-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .aid-step:nth-child(3n) {
    border-right: 3px solid #078c39;
  }

  .aid-step:nth-child(2n) {
    border-right: none;
  }

  .aid-step:nth-last-child(-n+3) {
    border-bottom: 3px solid #078c39;
  }

  .aid-step:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media(max-width:560px) {
  .aid-grid {
    grid-template-columns: 1fr;
  }

  .aid-step {
    border-right: none !important;
    border-bottom: 3px solid #078c39 !important;
  }

  .aid-step:last-child {
    border-bottom: none !important;
  }
}

/* =========================================================
   V6 FIXES — USER NAME + SOS SYNC + CLEAR FIRST AID POSTERS
========================================================= */

/* slightly smaller global font than v5 */
body {
  font-size: 15.5px !important;
}

.nav-links a {
  font-size: 13px !important;
}

.logo-name {
  font-size: 20px !important;
}

.logo-sub {
  font-size: 10.5px !important;
}

/* show emergency numbers more clearly */
.logo-nums {
  display: flex !important;
  gap: 7px !important;
  flex-wrap: wrap !important;
  margin-top: 5px !important;
}

.logo-num {
  font-size: 12px !important;
  font-weight: 900 !important;
  padding: 4px 9px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .92) !important;
  border: 1.5px solid rgba(0, 0, 0, .08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .10) !important;
}

.logo-num.red {
  color: #b71c1c !important;
}

.logo-num.blue {
  color: #0d47a1 !important;
}

.logo-num.orange {
  color: #bf360c !important;
}

/* SOS pulse: one exact synchronized animation for all 3 buttons */
.sos-btns {
  gap: 58px !important;
}

.pulse-btn {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  animation: sosButtonBreath 1.85s cubic-bezier(.45, 0, .25, 1) infinite !important;
  transform-origin: center !important;
}

.pulse-btn::before,
.pulse-btn::after {
  content: "" !important;
  position: absolute !important;
  inset: -13px !important;
  border-radius: 50% !important;
  border: 4px solid currentColor !important;
  opacity: 0 !important;
  z-index: -1 !important;
  animation: sosRingSync 1.85s cubic-bezier(.18, .7, .2, 1) infinite !important;
}

.pulse-btn::after {
  inset: -25px !important;
  border-width: 3px !important;
  animation-name: sosRingSyncOuter !important;
}

.pulse-btn:hover {
  transform: scale(1.14) !important;
  animation-play-state: running !important;
}

.pulse-btn:hover::before,
.pulse-btn:hover::after {
  animation-duration: 1.45s !important;
}

@keyframes sosButtonBreath {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.075);
  }
}

@keyframes sosRingSync {
  0% {
    transform: scale(.82);
    opacity: .62;
  }

  70% {
    transform: scale(1.32);
    opacity: .16;
  }

  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@keyframes sosRingSyncOuter {
  0% {
    transform: scale(.76);
    opacity: .42;
  }

  70% {
    transform: scale(1.48);
    opacity: .10;
  }

  100% {
    transform: scale(1.68);
    opacity: 0;
  }
}

/* First Aid — poster/infographic style, clearer than mannequin drawings */
.fa-wrap {
  max-width: 1220px !important;
  padding: 26px 24px 40px !important;
}

.fa-intro {
  font-size: 16px !important;
  margin-bottom: 22px !important;
}

.infographic-aid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 28px !important;
}

.aid-poster {
  background: #fff !important;
  border: 5px solid #078c39 !important;
  border-radius: 0 !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .12) !important;
  overflow: hidden !important;
}

.aid-title {
  background: #078c39 !important;
  color: #fff !important;
  font-size: 34px !important;
  line-height: 1.05 !important;
  font-weight: 1000 !important;
  padding: 14px 18px 8px !important;
  letter-spacing: -.6px !important;
}

.aid-sub {
  background: #c8eef4 !important;
  color: #067a31 !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  padding: 6px 18px !important;
  border-bottom: 5px solid #078c39 !important;
}

.aid-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0 !important;
}

.aid-step {
  min-height: 245px !important;
  position: relative !important;
  padding: 12px 12px 14px !important;
  border-right: 5px solid #078c39 !important;
  border-bottom: 5px solid #078c39 !important;
  background: #fffdf6 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.aid-step:nth-child(3n) {
  border-right: none !important;
}

.aid-step:nth-last-child(-n+3) {
  border-bottom: none !important;
}

.aid-num {
  position: absolute !important;
  top: 6px !important;
  left: 10px !important;
  z-index: 2 !important;
  color: #078c39 !important;
  font-size: 42px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
}

.aid-step p {
  color: #111 !important;
  font-size: 15.5px !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  margin: 8px 0 0 !important;
}

.aid-visual {
  height: 165px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  margin-top: 12px !important;
}

.aid-emoji {
  font-size: 78px !important;
  line-height: 1 !important;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .14));
}

.aid-big {
  font-size: 96px !important;
}

.aid-arrow {
  position: absolute !important;
  color: #078c39 !important;
  font-size: 54px !important;
  font-weight: 1000 !important;
  text-shadow: 0 2px 0 #fff !important;
}

.aid-arrow.down {
  top: 18px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
}

.aid-arrow.right {
  right: 22px;
  top: 48px;
}

.aid-arrow.up {
  top: 18px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
}

.aid-label {
  position: absolute !important;
  bottom: 8px !important;
  right: 8px !important;
  background: #078c39 !important;
  color: #fff !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.aid-danger .aid-label {
  background: #d32f2f !important;
}

.aid-danger {
  background: #fff1e0 !important;
}

.aid-cross {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  background: #fff;
  border: 5px solid #078c39;
  position: relative;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .10);
}

.aid-cross::before,
.aid-cross::after {
  content: "";
  position: absolute;
  background: #078c39;
  border-radius: 4px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.aid-cross::before {
  width: 18px;
  height: 54px;
}

.aid-cross::after {
  width: 54px;
  height: 18px;
}

.aid-bandage {
  font-size: 86px !important;
}

@media(max-width:900px) {
  .aid-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .aid-step:nth-child(3n) {
    border-right: 5px solid #078c39 !important;
  }

  .aid-step:nth-child(2n) {
    border-right: none !important;
  }

  .aid-step:nth-last-child(-n+3) {
    border-bottom: 5px solid #078c39 !important;
  }

  .aid-step:nth-last-child(-n+2) {
    border-bottom: none !important;
  }

  .aid-title {
    font-size: 28px !important;
  }
}

@media(max-width:560px) {
  .aid-grid {
    grid-template-columns: 1fr !important;
  }

  .aid-step {
    border-right: none !important;
    border-bottom: 5px solid #078c39 !important;
  }

  .aid-step:last-child {
    border-bottom: none !important;
  }
}


/* =========================================================
   V7 FIXES
========================================================= */

/* New login username field should match the rest of auth inputs */
#li-name {
  width: 100%;
}

/* If any previous First Aid visual/image blocks remain from older versions, hide them.
   The v7 firstaid.html returns to the original text-card structure. */
.fa-visual,
.fa-img,
.fa-card-img,
.firstaid-illustration,
.aid-poster,
.aid-visual,
.aid-steps-img {
  display: none !important;
}

/* Keep app font readable but not too oversized */
body {
  font-size: 15.5px;
}

.nav-links a {
  font-size: 13.5px;
}

.logo-num {
  font-size: 12.5px !important;
  font-weight: 900 !important;
  padding: 5px 9px !important;
}


/* =========================================================
   V8 — EMERGENCY CONTACTS + FAMILY MEMBERS + PREMIUM CARDS
========================================================= */

/* Account extra emergency contacts */
.extra-contact-section {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.extra-contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.extra-contact-head h3 {
  font-size: 17px;
  color: var(--navy);
  font-weight: 900;
}

.add-round-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--red), #b71c1c);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(211, 47, 47, .28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.add-round-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.extra-contact-card,
.family-member-card {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(0, 0, 0, .06);
  margin-bottom: 12px;
}

.extra-contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.remove-mini-btn {
  border: none;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.remove-mini-btn:hover {
  background: #b71c1c;
}

/* Premium new service cards */
.premium-addons {
  margin-top: 36px;
}

.premium-addons h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 16px;
  font-weight: 900;
  text-align: center;
}

.premium-addon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.premium-addon-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .08);
  transition: .25s ease;
}

.premium-addon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

.premium-addon-icon {
  font-size: 34px;
  margin-bottom: 10px;
}

.premium-addon-card h3 {
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 8px;
}

.premium-addon-card p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* Family page */
.family-wrap {
  width: min(1180px, 94vw);
  margin: 28px auto 50px;
}

.family-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .66);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .09);
  margin-bottom: 20px;
}

.family-hero h1 {
  color: var(--navy);
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 6px;
}

.family-hero p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 15.5px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.family-member-card {
  padding: 18px;
  min-height: 190px;
}

.family-member-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.family-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  font-size: 25px;
  box-shadow: 0 10px 24px rgba(21, 101, 192, .24);
}

.family-member-card h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.family-role {
  color: var(--red);
  font-weight: 800;
  font-size: 13px;
}

.family-info {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.family-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.family-action-btn {
  border: none;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.family-action-btn.primary {
  background: var(--red);
  color: #fff;
}

.family-action-btn.secondary {
  background: rgba(26, 42, 108, .10);
  color: var(--navy);
}

.family-action-btn.danger {
  background: rgba(211, 47, 47, .10);
  color: var(--red);
}

.family-action-btn.danger:hover {
  background: var(--red);
  color: #fff;
}

.family-form {
  display: none;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .70);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .08);
}

.family-form.show {
  display: block;
}

.family-form h2 {
  color: var(--navy);
  font-size: 20px;
  margin-bottom: 12px;
}

.family-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.family-form .af {
  gap: 5px;
}

.family-save-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media(max-width:900px) {

  .premium-addon-grid,
  .family-grid,
  .family-form-grid {
    grid-template-columns: 1fr;
  }

  .extra-contact-grid {
    grid-template-columns: 1fr;
  }

  .family-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* =========================================================
   V9 POSITION FIX — ACCOUNT EXTRA CONTACTS BOTTOM RIGHT
========================================================= */

.extra-contact-bottom-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 24px 0 12px;
}

.extra-contact-bottom-wrap .extra-contact-section {
  width: min(560px, 100%);
}

.extra-contact-section {
  margin-top: 0;
}

.extra-contact-head {
  align-items: flex-start;
}

.extra-contact-grid {
  grid-template-columns: 1fr 1fr 1fr auto;
}

@media(max-width:800px) {
  .extra-contact-bottom-wrap {
    justify-content: stretch;
  }

  .extra-contact-bottom-wrap .extra-contact-section {
    width: 100%;
  }

  .extra-contact-grid {
    grid-template-columns: 1fr;
  }
}



/* FINAL REQUESTED FIXES */
.acc-ec-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.extra-contact-button-row {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 20px;
}

.add-emergency-contact-btn {
  border: none;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(211, 47, 47, .18);
  transition: .2s;
}

.add-emergency-contact-btn:hover {
  background: #b71c1c;
  transform: translateY(-1px);
}

.add-emergency-contact-btn .plus-sign {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

#extra-emergency-contacts {
  width: 100%;
  margin-bottom: 22px;
}

.extra-contact-grid {
  grid-template-columns: 1.2fr 1fr 1fr auto !important;
}

.clean-family-page .family-grid:empty {
  display: none;
}

.clean-family-hero .add-round-btn {
  display: none;
}

.family-add-main-btn {
  border: none;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: .2s;
}

.family-add-main-btn:hover {
  background: #b71c1c;
  transform: translateY(-1px);
}

.clean-family-page .family-avatar {
  display: none !important;
}

.clean-family-page .family-member-top {
  gap: 0;
}

@media(max-width:900px) {
  .acc-ec-row {
    grid-template-columns: 1fr !important;
  }

  .extra-contact-grid {
    grid-template-columns: 1fr !important;
  }

  .extra-contact-button-row {
    justify-content: stretch;
  }

  .add-emergency-contact-btn {
    width: 100%;
    justify-content: center;
  }
}


/* ══════════════════════════════════════════════════════════
   CHAT WIDGET — User side (premium.html)
   ══════════════════════════════════════════════════════════ */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 8000;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px 92px 24px 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s
}
.chat-overlay.open {
  pointer-events: all;
  opacity: 1
}
.chat-box {
  width: 360px;
  max-width: 96vw;
  height: 520px;
  max-height: 80vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1)
}
.chat-overlay.open .chat-box {
  transform: translateY(0) scale(1)
}
.chat-head {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0
}
.chat-head-ico { font-size: 22px }
.chat-head-info { flex: 1 }
.chat-head-title { font-size: 14px; font-weight: 800 }
.chat-head-sub { font-size: 11px; opacity: .7; margin-top: 1px }
.chat-close-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 30px; height: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s
}
.chat-close-btn:hover { background: rgba(255,255,255,.3) }
.chat-status-bar {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0
}
.chat-status-bar.closed { background: #fce8e8; color: var(--red) }
.chat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2e7d32;
  flex-shrink: 0
}
.chat-status-bar.closed .chat-dot { background: var(--red) }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px
}
.chat-msg {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px
}
.chat-msg.admin {
  align-self: flex-start;
  background: #f1f3f8;
  color: var(--text);
  border-bottom-left-radius: 4px
}
.chat-msg-time {
  font-size: 10px;
  opacity: .6;
  margin-top: 3px;
  text-align: right
}
.chat-msg.admin .chat-msg-time { text-align: left }
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  gap: 8px;
  padding: 20px
}
.chat-empty-ico { font-size: 36px }
.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #fff
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  resize: none;
  transition: border-color .2s
}
.chat-input:focus { border-color: var(--navy) }
.chat-send-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  align-self: flex-end
}
.chat-send-btn:hover { background: #0f2a5e }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed }

/* ── Premium card clickable ── */
.premium-addon-card.chat-card {
  cursor: pointer;
  transition: box-shadow .18s, transform .15s
}
.premium-addon-card.chat-card:hover {
  box-shadow: 0 8px 28px rgba(26,42,108,.15);
  transform: translateY(-2px)
}

/* ══════════════════════════════════════════════════════════
   CHAT SECTION — Admin side (admin.html)
   ══════════════════════════════════════════════════════════ */
.chat-admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 130px)
}
.chat-conv-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden
}
.chat-conv-list-hd {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0
}
.chat-conv-items {
  flex: 1;
  overflow-y: auto
}
.chat-conv-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s
}
.chat-conv-item:hover { background: #f8f9fb }
.chat-conv-item.active { background: #eef1fb }
.chat-conv-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text)
}
.chat-conv-preview {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}
.chat-conv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px
}
.chat-conv-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px
}
.chat-conv-badge.open { background: #e8f5e9; color: #2e7d32 }
.chat-conv-badge.closed { background: #fce8e8; color: var(--red) }
.chat-conv-time { font-size: 10px; color: var(--muted) }
.chat-conv-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px
}
.chat-admin-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden
}
.chat-admin-panel-hd {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0
}
.chat-admin-panel-hd h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy)
}
.chat-admin-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px
}
.chat-admin-input-row {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0
}
.chat-admin-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s
}
.chat-admin-input:focus { border-color: var(--navy) }
.chat-admin-send {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  flex-shrink: 0
}
.chat-admin-send:hover { background: #0f2a5e }
.chat-admin-send:disabled { background: #ccc; cursor: not-allowed }
.chat-no-conv {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  gap: 10px
}
.chat-no-conv-ico { font-size: 44px }
.chat-close-conv-btn {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}
.chat-close-conv-btn:hover { background: var(--red); color: #fff }
@media(max-width:700px) {
  .chat-admin-layout { grid-template-columns: 1fr; height: auto }
  .chat-conv-list { max-height: 260px }
  .chat-box { width: 100%; height: 70vh; border-radius: 18px 18px 0 0 }
  .chat-overlay { padding: 0; align-items: flex-end }
}

/* ══════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ══════════════════════════════════════════════════════════ */
.notif-bell-wrap {
  position: relative;
  flex-shrink: 0
}
.notif-bell-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: border-color .2s;
  line-height: 1
}
.notif-bell-btn:hover { border-color: var(--navy) }
.notif-bell-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 17px; height: 17px;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none
}
.notif-dropdown {
  display: none;
  position: fixed;
  width: 340px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: visible;
  flex-direction: column
}
.notif-dropdown.open { display: flex }
.notif-dropdown-hd {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  border-radius: 14px 14px 0 0
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text)
}
.notif-item:last-child { border-bottom: none }
.notif-item-msg { margin-bottom: 8px; line-height: 1.5 }
.notif-item-msg strong { color: var(--navy) }
.notif-item-btns { display: flex; gap: 8px }
.notif-allow-btn {
  flex: 1;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1.5px solid #a5d6a7;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}
.notif-allow-btn:hover { background: #2e7d32; color: #fff }
.notif-deny-btn {
  flex: 1;
  background: #fce8e8;
  color: var(--red);
  border: 1.5px solid #ef9a9a;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}
.notif-deny-btn:hover { background: var(--red); color: #fff }
.notif-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px
}

/* Resolved (allowed/denied) notification rows */
.notif-item-resolved {
  opacity: .85;
  background: #fafafa
}
.notif-item-status {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px
}
/* ── Notification list scroll ── */
#notif-list {
  overflow-y: auto;
  max-height: 400px;
  border-radius: 0 0 14px 14px
}

/* ── Send access request button on family cards ── */
.family-access-btn {
  width: 100%;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px
}
.family-access-btn:hover { background: #0f2a5e }
.family-access-btn.granted {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1.5px solid #a5d6a7;
  cursor: default
}
.family-access-btn.pending {
  background: #fff3e0;
  color: var(--orange);
  border: 1.5px solid #ffcc80;
  cursor: default
}

/* ══════════════════════════════════════════════════════════
   FAMILY NETWORK VIEWER (premium page overlay)
   ══════════════════════════════════════════════════════════ */
.fnet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s
}
.fnet-overlay.open {
  opacity: 1;
  pointer-events: all
}
.fnet-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  transform: translateY(20px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1)
}
.fnet-overlay.open .fnet-box {
  transform: translateY(0) scale(1)
}
.fnet-head {
  background: var(--navy);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0
}
.fnet-head h3 { font-size: 15px; font-weight: 800; margin: 0 }
.fnet-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 30px; height: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center
}
.fnet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px
}
.fnet-member-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}
.fnet-member-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 3px
}
.fnet-member-info p {
  font-size: 12px;
  color: var(--muted);
  margin: 0
}
.fnet-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap
}
.fnet-status-badge.active { background: var(--red-pale); color: var(--red) }
.fnet-status-badge.none   { background: #f1f3f8; color: var(--muted) }
.fnet-view-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s
}
.fnet-view-btn:hover { background: #b71c1c }
.fnet-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px
}
.fnet-empty-ico { font-size: 40px; display: block; margin-bottom: 10px }

/* Family request viewer overlay */
.freq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 7500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s
}
.freq-overlay.open { opacity: 1; pointer-events: all }
.freq-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  transform: scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1)
}
.freq-overlay.open .freq-box { transform: scale(1) }
.freq-head {
  background: var(--red);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1
}
.freq-head h3 { font-size: 15px; font-weight: 800; margin: 0 }
.freq-close {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 30px; height: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center
}
.freq-body { padding: 18px 20px }
.freq-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px
}
.freq-label {
  font-weight: 700;
  color: var(--muted);
  min-width: 110px;
  flex-shrink: 0
}
.freq-val { color: var(--text) }
.freq-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px
}
.freq-status.pending    { background: #fff3e0; color: var(--orange) }
.freq-status.active     { background: var(--red-pale); color: var(--red) }
.freq-status.dispatched { background: var(--blue-pale); color: var(--blue) }
.freq-status.completed  { background: #e8f5e9; color: #2e7d32 }

/* ══════════════════════════════════════════════════════════
   DISASTER ALERTS — Premium page card badge
   ══════════════════════════════════════════════════════════ */
.disaster-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 900;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse-badge .9s ease-in-out infinite alternate
}
@keyframes pulse-badge {
  from { transform: scale(1); opacity: 1 }
  to   { transform: scale(1.25); opacity: .75 }
}

/* ── Disaster Alerts Overlay ── */
.disaster-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 600;
  align-items: center;
  justify-content: center
}
.disaster-overlay.open { display: flex }

.disaster-box {
  background: #fff;
  border-radius: 18px;
  width: 560px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden
}

.disaster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0
}
.disaster-head-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy)
}
.disaster-head-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px
}
.disaster-close {
  background: #f5f6fa;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .2s
}
.disaster-close:hover { background: var(--red); color: #fff }

/* EMA banner inside disaster overlay */
.disaster-ema-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #e8eaf6 0%, #f0f4ff 100%);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  border-radius: 12px;
  margin-bottom: 12px;
}
.disaster-ema-banner:hover { background: #dde3f8 }
html[dir="rtl"] .disaster-ema-banner { direction: rtl; text-align: right }
html[dir="rtl"] .disaster-ema-banner #ema-banner-view { margin-left: 0; margin-right: auto }

/* Alert list */
.disaster-list {
  flex: 1;
  overflow-y: auto;
  padding: 0
}
.disaster-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  gap: 8px;
  font-size: 13px
}
.disaster-alert-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #ffe0b2;
  background: #fffaf2;
  margin-bottom: 10px;
}
.disaster-alert-item:last-child { margin-bottom: 0 }
.disaster-alert-item.sev-critical { border-color: #ffcdd2; background: #fff5f5 }
.disaster-alert-item.sev-high     { border-color: #ffe0b2; background: #fff8f0 }
.disaster-alert-item.sev-medium   { border-color: #fff9c4; background: #fffff0 }
.disaster-alert-item.sev-low      { border-color: #c8e6c9; background: #f1f8f1 }
.disaster-alert-hd {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.disaster-alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px }
.disaster-alert-title-wrap { flex: 1; min-width: 0 }
.disaster-alert-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
  word-break: break-word;
}
.disaster-alert-severity {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  border-radius: 20px;
  padding: 2px 8px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.sev-critical .disaster-alert-severity { background: #ffcdd2; color: #b71c1c }
.sev-high     .disaster-alert-severity { background: #ffe0b2; color: #e65100 }
.sev-medium   .disaster-alert-severity { background: #fff9c4; color: #f57f17 }
.sev-low      .disaster-alert-severity { background: #c8e6c9; color: #2e7d32 }
.disaster-alert-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
}
html[dir="rtl"] .disaster-alert-time { margin-left: 0; margin-right: auto }
.disaster-alert-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
html[dir="rtl"] .disaster-alert-msg { text-align: right; direction: rtl }
.disaster-alert-footer {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
html[dir="rtl"] .disaster-alert-footer { text-align: right }

/* ── EMA Iframe Overlay ── */
.ema-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 700;
  align-items: center;
  justify-content: center
}
.ema-overlay.open { display: flex }

.ema-box {
  background: #fff;
  border-radius: 16px;
  width: 900px;
  max-width: 97vw;
  height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 72px rgba(0,0,0,.28);
  overflow: hidden
}
.ema-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
  gap: 12px
}
.ema-open-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .2s
}
.ema-open-btn:hover { background: #0d1b4b }
.ema-close {
  background: #f5f6fa;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .2s
}
.ema-close:hover { background: var(--red); color: #fff }
.ema-frame-wrap {
  flex: 1;
  position: relative;
  overflow: hidden
}
.ema-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block
}
.ema-fallback {
  display: none;
  position: absolute;
  inset: 0;
  background: #f8f9fb;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px
}

/* ── Disaster card hover (premium page) ── */
.disaster-card {
  border: 1.5px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .15s
}
.disaster-card:hover {
  border-color: var(--red);
  box-shadow: 0 8px 28px rgba(211,47,47,.15)
}

/* ══════════════════════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════════════════════ */

/* Dark mode toggle button */
.btn-dark-mode {
  background: transparent;
  border: 1.5px solid rgba(26,42,108,.20);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 16px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  gap: 4px;
}
.btn-dark-mode:hover {
  border-color: var(--navy);
  background: rgba(26,42,108,.08);
  transform: scale(1.06);
}
body.dark-mode .btn-dark-mode {
  border-color: rgba(255,255,255,.22);
  color: #e8ecf0;
}
body.dark-mode .btn-dark-mode:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.40);
}

/* ── Dark mode root overrides ── */
body.dark-mode {
  --text: #e8ecf0;
  --muted: #9aa5b4;
  --border: rgba(255,255,255,.12);
  --white: #1c2333;
  --shadow: 0 14px 46px rgba(0,0,0,.40);
  --shadow-md: 0 22px 70px rgba(0,0,0,.55);
  --glass: rgba(28,35,51,.80);
  --glass-strong: rgba(28,35,51,.92);
  --glass-border: rgba(255,255,255,.10);

  background:
    radial-gradient(circle at 10% 18%, rgba(211,47,47,.22), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(201,168,76,.12), transparent 27%),
    radial-gradient(circle at 88% 78%, rgba(21,101,192,.22), transparent 31%),
    radial-gradient(circle at 38% 88%, rgba(46,125,50,.08), transparent 25%),
    linear-gradient(135deg, #0d1220 0%, #111827 40%, #0e1a2e 70%, #0d1220 100%) !important;
  background-attachment: fixed !important;
  color: var(--text);
}

/* ── Dark mode: auth panels ── */

body.dark-mode::before,
body.dark-mode::after {
  display: none !important;
  content: none !important;
}

/* Glass panels in dark */
body.dark-mode .navbar,
body.dark-mode .adm-topbar,
body.dark-mode .rc-topbar,
body.dark-mode .req-card,
body.dark-mode .acc-wrap,
body.dark-mode .med-wrap,
body.dark-mode .fa-wrap,
body.dark-mode .prem-wrap,
body.dark-mode .svc-wrap,
body.dark-mode .bk-wrap,
body.dark-mode .booking-wrap,
body.dark-mode .ab-wrap,
body.dark-mode .adm-card,
body.dark-mode .stat-card,
body.dark-mode .rc-card,
body.dark-mode .rc-stat,
body.dark-mode .adm-box,
body.dark-mode .resp-box,
body.dark-mode .modal,
body.dark-mode .prem-card,
body.dark-mode .fa-item,
body.dark-mode .svc-sec,
body.dark-mode .ab-card,
body.dark-mode .family-hero,
body.dark-mode .family-form,
body.dark-mode .family-member-card,
body.dark-mode .extra-contact-section,
body.dark-mode .extra-contact-card,
body.dark-mode .premium-addon-card,
body.dark-mode .req-card,
body.dark-mode .fnet-box,
body.dark-mode .freq-box,
body.dark-mode .chat-box,
body.dark-mode .disaster-box,
body.dark-mode .ema-box {
  background: rgba(20,28,45,.82) !important;
  border-color: rgba(255,255,255,.10) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.45), 0 3px 12px rgba(0,0,0,.30) !important;
}

body.dark-mode .navbar,
body.dark-mode .adm-topbar,
body.dark-mode .rc-topbar {
  background: rgba(13,18,32,.90) !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
}

/* Text colours in dark */
body.dark-mode .nav-links a,
body.dark-mode .logo-name,
body.dark-mode .logo-sub,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.dark-mode p, body.dark-mode label, body.dark-mode li,
body.dark-mode .ri-val, body.dark-mode .req-id span,
body.dark-mode .fa-header {
  color: var(--text);
}

body.dark-mode .nav-links a:hover,
body.dark-mode .nav-links a.active {
  color: var(--red);
}

body.dark-mode .muted,
body.dark-mode .ri-label,
body.dark-mode .fa-intro,
body.dark-mode .ab-intro,
body.dark-mode .svc-txt,
body.dark-mode .prem-info p,
body.dark-mode .modal p,
body.dark-mode .family-hero p,
body.dark-mode .family-info {
  color: var(--muted) !important;
}

/* Inputs in dark */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .afield input,
body.dark-mode .afield select,
body.dark-mode .fg input,
body.dark-mode .fg select,
body.dark-mode .sf input,
body.dark-mode .sf select,
body.dark-mode .sf textarea,
body.dark-mode .af input,
body.dark-mode .chat-input,
body.dark-mode .chat-admin-input {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: #e8ecf0 !important;
  box-shadow: none !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: rgba(255,255,255,.35) !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  background: rgba(255,255,255,.10) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 4px rgba(21,101,192,.20) !important;
  color: #fff !important;
}

body.dark-mode select option {
  background: #1c2333;
  color: #e8ecf0;
}

/* Navbar buttons in dark */
body.dark-mode .btn-lang,
body.dark-mode .btn-phones,
body.dark-mode .btn-dark-mode {
  border-color: rgba(255,255,255,.20);
  color: #e8ecf0;
}

body.dark-mode .btn-lang { color: var(--blue-light); border-color: var(--blue); }
body.dark-mode .btn-phones { background: rgba(26,42,108,.50); }

body.dark-mode .user-name-btn { color: var(--muted); }
body.dark-mode .user-name-btn strong { color: var(--red-light) !important; }
body.dark-mode .user-name-btn:hover { background: rgba(211,47,47,.10); }

body.dark-mode .user-dropdown {
  background: #1c2333;
  border-color: rgba(255,255,255,.10);
}
body.dark-mode .user-dropdown button { color: var(--red-light); }
body.dark-mode .user-dropdown button:hover { background: rgba(211,47,47,.12); }

/* Logo numbers */
body.dark-mode .logo-num {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
}
body.dark-mode .logo-num.red  { color: #ff8a8a !important; }
body.dark-mode .logo-num.blue { color: #7fc7ff !important; }
body.dark-mode .logo-num.orange { color: #ffcc80 !important; }

/* First Aid */
body.dark-mode .fa-header { background: rgba(255,255,255,.05) !important; }
body.dark-mode .fa-header .fa-ico { background: rgba(211,47,47,.15); }
body.dark-mode .fa-body { background: rgba(255,255,255,.03) !important; color: #c4cdd8 !important; }
body.dark-mode .fa-body .fa-steps { color: #c4cdd8; }
body.dark-mode .fa-warning {
  background: rgba(230,81,0,.15) !important;
  border-color: rgba(230,81,0,.30) !important;
  color: #ffcc80 !important;
}

/* About cards */
body.dark-mode .ab-img { background: rgba(255,255,255,.06) !important; }

/* Service section */
body.dark-mode .svc-div { border-top-color: rgba(255,255,255,.10) !important; }
body.dark-mode .svc-btn.ambulance {
  background: #fff !important;
  color: var(--red) !important;
}

/* Request page */
body.dark-mode .req-card { background: rgba(20,28,45,.85) !important; }
body.dark-mode .status-badge { background: rgba(255,255,255,.14); }
body.dark-mode .req-tabs { border-bottom-color: rgba(255,255,255,.10); }
body.dark-mode .rtab.active { color: #e8ecf0; border-bottom-color: #e8ecf0; }
body.dark-mode .rtab { color: var(--muted); }
body.dark-mode .btn-omaps {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: var(--muted);
}

/* Unsaved bar */
body.dark-mode .unsaved-bar {
  background: rgba(230,81,0,.12) !important;
  border-color: rgba(230,81,0,.30) !important;
  color: #ffcc80 !important;
}

/* Toast */
body.dark-mode #toast {
  background: rgba(26,42,108,.95);
  border: 1px solid rgba(255,255,255,.10);
}

/* Phone prefix */
body.dark-mode .ph-pre {
  background: rgba(255,255,255,.06) !important;
  border-right-color: rgba(255,255,255,.10) !important;
  color: var(--muted) !important;
}

/* Chips & severity buttons */
body.dark-mode .chip {
  border-color: rgba(255,255,255,.15);
  color: #c4cdd8;
  background: rgba(255,255,255,.04);
}

body.dark-mode .sev {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  color: #c4cdd8;
}

/* Steps inside SOS modal */
body.dark-mode .dstep { color: var(--muted); }
body.dark-mode .dstep.cur { background: rgba(211,47,47,.12); color: var(--red-light); }

/* Chat widgets */
body.dark-mode .chat-box,
body.dark-mode .chat-admin-panel,
body.dark-mode .chat-conv-list {
  background: #141c2d !important;
}
body.dark-mode .chat-msg.admin {
  background: rgba(255,255,255,.08);
  color: #e8ecf0;
}
body.dark-mode .chat-input-row,
body.dark-mode .chat-admin-input-row {
  background: #141c2d;
  border-top-color: rgba(255,255,255,.08);
}
body.dark-mode .chat-conv-item { border-bottom-color: rgba(255,255,255,.06); }
body.dark-mode .chat-conv-item:hover { background: rgba(255,255,255,.05); }
body.dark-mode .chat-conv-item.active { background: rgba(255,255,255,.09); }
body.dark-mode .chat-conv-name { color: #e8ecf0; }
body.dark-mode .chat-conv-preview { color: var(--muted); }
body.dark-mode .chat-conv-list-hd,
body.dark-mode .chat-admin-panel-hd { border-bottom-color: rgba(255,255,255,.08); }
body.dark-mode .chat-status-bar { background: rgba(46,125,50,.15); color: #81c784; }
body.dark-mode .chat-status-bar.closed { background: rgba(211,47,47,.15); color: #ff8a8a; }

/* Notification bell */
body.dark-mode .notif-bell-btn {
  border-color: rgba(255,255,255,.15);
  color: #e8ecf0;
}
body.dark-mode .notif-dropdown {
  background: #1c2333;
  border-color: rgba(255,255,255,.10);
}
body.dark-mode .notif-dropdown-hd {
  border-bottom-color: rgba(255,255,255,.08);
  color: #e8ecf0;
}
body.dark-mode .notif-item { border-bottom-color: rgba(255,255,255,.06); color: #c4cdd8; }
body.dark-mode .notif-item-msg strong { color: #90caf9; }
body.dark-mode .notif-empty { color: var(--muted); }

/* Family page overlays */
body.dark-mode .fnet-box,
body.dark-mode .freq-box { background: #141c2d !important; }
body.dark-mode .fnet-member-card,
body.dark-mode .family-member-card {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode .fnet-member-info h4,
body.dark-mode .family-member-card h3 { color: #e8ecf0; }
body.dark-mode .fnet-member-info p,
body.dark-mode .freq-label { color: var(--muted); }
body.dark-mode .freq-body { color: #c4cdd8; }
body.dark-mode .freq-val { color: #e8ecf0; }
body.dark-mode .fnet-status-badge.none { background: rgba(255,255,255,.08); color: var(--muted); }

/* Disaster overlay */
body.dark-mode .disaster-box { background: #141c2d !important; }
body.dark-mode .disaster-head,
body.dark-mode .disaster-ema-banner { border-bottom-color: rgba(255,255,255,.08); }
body.dark-mode .disaster-ema-banner { background: rgba(26,42,108,.25); }
body.dark-mode .disaster-ema-banner:hover { background: rgba(26,42,108,.45); }
body.dark-mode .disaster-alert-item { border-bottom-color: rgba(255,255,255,.06); }
body.dark-mode .disaster-alert-msg { color: #c4cdd8; }
body.dark-mode .disaster-alert-footer { color: var(--muted); }
body.dark-mode .disaster-close { background: rgba(255,255,255,.08); color: var(--muted); }
body.dark-mode .disaster-head-title { color: #e8ecf0; }
body.dark-mode .disaster-head-sub { color: var(--muted); }

/* Tables (admin/responder) */
body.dark-mode table { background: rgba(255,255,255,.04); }
body.dark-mode thead tr { background: rgba(255,255,255,.08) !important; }
body.dark-mode tr:hover td { background: rgba(255,255,255,.06) !important; }
body.dark-mode td, body.dark-mode th { color: #c4cdd8; border-color: rgba(255,255,255,.06); }

/* Booking form */
body.dark-mode .bk-btn {
  border-color: rgba(201,168,76,.25);
  color: #e8ecf0;
}
body.dark-mode .bk-btn:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

/* Auth screen dark mode is handled by .auth-panel-right and .auth-box */
body.dark-mode #auth {
  background: #111827
}

body.dark-mode .atab { color: var(--muted); }
body.dark-mode .aerr { background: rgba(211,47,47,.15); }

/* Overlays (modals) */
body.dark-mode .overlay { background: rgba(0,0,0,.55); }
body.dark-mode .modal {
  background: #141c2d !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
body.dark-mode .modal h3 { color: #e8ecf0; }
body.dark-mode .modal p { color: var(--muted); }
body.dark-mode .btn-outline { color: var(--muted); }

/* SOS hero text */
body.dark-mode .sos-hero h1 { color: #e8ecf0; text-shadow: 0 4px 18px rgba(0,0,0,.40); }
body.dark-mode .sos-hero p  { color: var(--muted); }

/* pulse buttons: ambulance matches police/fire filled style in dark mode */
body.dark-mode .pulse-btn.ambulance {
  background: linear-gradient(145deg, #c62828, #e53935) !important;
  color: #fff !important;
  border-color: var(--red) !important;
  box-shadow: 0 18px 42px rgba(211,47,47,.26), 0 0 0 10px rgba(211,47,47,.22), 0 0 0 28px rgba(211,47,47,.10) !important;
}

body.dark-mode .pulse-btn.ambulance::before {
  border-color: rgba(211,47,47,.46) !important;
}

body.dark-mode .pulse-btn.ambulance::after {
  border-color: rgba(211,47,47,.24) !important;
}

/* Premium cards */
body.dark-mode .prem-card { background: rgba(20,28,45,.82) !important; }
body.dark-mode .prem-info h3 { color: var(--gold-light); }
body.dark-mode .premium-addon-card {
  background: rgba(20,28,45,.78) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode .premium-addon-card h3 { color: #e8ecf0; }

/* Family page add button */
body.dark-mode .family-add-main-btn:hover,
body.dark-mode .add-emergency-contact-btn:hover { opacity: .92; }

/* Navy text → white in dark mode */
body.dark-mode .extra-contact-head h3,
body.dark-mode .premium-addons h2,
body.dark-mode .premium-addon-card h3,
body.dark-mode .family-hero h1,
body.dark-mode .family-action-btn.secondary,
body.dark-mode .family-form h2,
body.dark-mode .chat-conv-list-hd,
body.dark-mode .chat-admin-panel-hd h3,
body.dark-mode .notif-dropdown-hd,
body.dark-mode .notif-item-msg strong,
body.dark-mode .fnet-member-info h4,
body.dark-mode .disaster-head-title { color: #e8ecf0 !important; }

body.dark-mode [style*="color: var(--navy)"],
body.dark-mode [style*="color:var(--navy)"] { color: #e8ecf0 !important; }

/* ── Global: hardcoded light colors invisible in dark mode ── */
body.dark-mode [style*="color:#666"],
body.dark-mode [style*="color: #666"],
body.dark-mode [style*="color:#777"],
body.dark-mode [style*="color: #777"],
body.dark-mode [style*="color:#888"],
body.dark-mode [style*="color: #888"],
body.dark-mode [style*="color:#999"],
body.dark-mode [style*="color: #999"],
body.dark-mode [style*="color:#555"],
body.dark-mode [style*="color: #555"] { color: #9aa5b4 !important; }

body.dark-mode [style*="color:#1a1a2e"],
body.dark-mode [style*="color: #1a1a2e"],
body.dark-mode [style*="color:#1a2a6c"],
body.dark-mode [style*="color: #1a2a6c"],
body.dark-mode [style*="color:#0d1b4b"],
body.dark-mode [style*="color: #0d1b4b"] { color: #e8ecf0 !important; }

/* ── Global: white/near-white backgrounds that stay white in dark ── */
body.dark-mode [style*="background:#fff"]:not(.modal):not(button):not(input):not(select):not(textarea),
body.dark-mode [style*="background: #fff"]:not(.modal):not(button):not(input):not(select):not(textarea),
body.dark-mode [style*="background:#ffffff"]:not(.modal):not(button):not(input):not(select):not(textarea),
body.dark-mode [style*="background:white"]:not(.modal):not(button):not(input):not(select):not(textarea) {
  background: rgba(20,28,45,.85) !important;
}

/* ── SpeakUp page dark mode ── */
body.dark-mode .su-abuse-card {
  background: rgba(20,28,45,.85) !important;
  border-color: rgba(255,100,150,.25) !important;
}
body.dark-mode .su-abuse-card h4 { color: #f48fb1 !important; }
body.dark-mode .su-abuse-card p,
body.dark-mode .su-abuse-card p[style*="color:#666"],
body.dark-mode .su-abuse-card p[style*="color: #666"]  { color: #c4cdd8 !important; }
body.dark-mode .su-section-title { color: #f48fb1 !important; }
body.dark-mode .su-num-label     { color: #e8ecf0 !important; }
body.dark-mode .su-num-desc      { color: var(--muted) !important; }
body.dark-mode .su-resource-card p,
body.dark-mode .su-resource-card p[style*="color:#666"]  { color: #c4cdd8 !important; }
body.dark-mode .su-resource-card h4 { color: #e8ecf0 !important; }
body.dark-mode .su-number-card,
body.dark-mode .su-resource-card {
  background: rgba(20,28,45,.85) !important;
  border-color: rgba(255,100,150,.25) !important;
}
/* "not at fault" pink box */
body.dark-mode #page-speakup div[style*="fce4ec"],
body.dark-mode #page-speakup div[style*="#fce4ec"] {
  background: rgba(136,14,79,.18) !important;
}
body.dark-mode #page-speakup div[style*="fce4ec"] p,
body.dark-mode #page-speakup div[style*="#fce4ec"] p { color: #f48fb1 !important; }

/* ── About page premium banner dark mode ── */
body.dark-mode div[style*="fff8e1"],
body.dark-mode div[style*="#fff8e1"] {
  background: linear-gradient(135deg, rgba(184,134,11,.12), rgba(184,134,11,.08)) !important;
  border-color: rgba(255,215,0,.20) !important;
}
body.dark-mode div[style*="fff8e1"] div[style*="color:#b8860b"],
body.dark-mode div[style*="#fff8e1"] div[style*="color:#b8860b"] { color: #ffd700 !important; }
body.dark-mode div[style*="fff8e1"] span[style*="color:var(--text)"],
body.dark-mode div[style*="#fff8e1"] span[style*="color:var(--text)"] { color: #c4cdd8 !important; }
body.dark-mode div[style*="fff8e1"] strong,
body.dark-mode div[style*="#fff8e1"] strong { color: #e8ecf0 !important; }
/* Step cards */
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div[style*="background:#fff"],
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div[style*="background: #fff"] {
  background: rgba(20,28,45,.85) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div div[style*="font-weight:800"],
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div h3 { color: #e8ecf0 !important; }
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div div[style*="color:var(--navy)"] { color: #e8ecf0 !important; }
body.dark-mode div[style*="repeat(auto-fit,minmax(200px,1fr))"] > div p  { color: #9aa5b4 !important; }
/* Feature cards (border-left:4px) */
body.dark-mode div[style*="border-left:4px solid"] {
  background: rgba(20,28,45,.85) !important;
}
body.dark-mode div[style*="border-left:4px solid"] strong,
body.dark-mode div[style*="border-left:4px solid"] strong[style*="color:var(--navy)"] { color: #e8ecf0 !important; }
body.dark-mode div[style*="border-left:4px solid"] p      { color: #9aa5b4 !important; }
/* Premium mini-feature grid inside about */
body.dark-mode div[style*="gap:12px"] > div[style*="background:#fff"],
body.dark-mode div[style*="gap:12px"] > div[style*="background: #fff"] {
  background: rgba(20,28,45,.85) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode div[style*="gap:12px"] > div strong { color: #e8ecf0 !important; }

/* ── Location choice popup (dynamically created) ── */
#ov-loc-choice > div {
  background: #fff;
}
body.dark-mode #ov-loc-choice > div {
  background: #141c2d !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
body.dark-mode #ov-loc-choice h3      { color: #e8ecf0 !important; }
body.dark-mode #ov-loc-choice p       { color: #9aa5b4 !important; }
body.dark-mode #loc-no-btn {
  background: rgba(255,255,255,.08) !important;
  color: #e8ecf0 !important;
  border-color: rgba(255,255,255,.15) !important;
}
body.dark-mode #loc-saved-btn {
  background: rgba(46,125,50,.18) !important;
  color: #81c784 !important;
  border-color: rgba(46,125,50,.40) !important;
}
body.dark-mode #loc-all-saved-btn {
  background: rgba(21,101,192,.18) !important;
  color: #90caf9 !important;
  border-color: rgba(21,101,192,.40) !important;
}
body.dark-mode #loc-cancel-btn { color: var(--muted) !important; }

/* ── Saved locations choice popup (dynamically created) ── */
body.dark-mode #ov-saved-location-choice > div {
  background: #141c2d !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
body.dark-mode #ov-saved-location-choice div[style*="border-bottom"] {
  border-bottom-color: rgba(255,255,255,.08) !important;
}
body.dark-mode #ov-saved-location-choice div[style*="color:var(--navy)"],
body.dark-mode #ov-saved-location-choice div[style*="color: var(--navy)"] {
  color: #e8ecf0 !important;
}
body.dark-mode #saved-loc-list {
  background: transparent !important;
}
body.dark-mode .sos-saved-loc-item {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e8ecf0 !important;
}
body.dark-mode .sos-saved-loc-item:hover {
  background: rgba(21,101,192,.20) !important;
  border-color: #90caf9 !important;
}
body.dark-mode .sos-saved-loc-item div[style*="font-weight:700"],
body.dark-mode .sos-saved-loc-item strong { color: #e8ecf0 !important; }
body.dark-mode .sos-saved-loc-item div[style*="font-size:11px"],
body.dark-mode .sos-saved-loc-item span   { color: #9aa5b4 !important; }
/* footer bar of saved-loc popup */
body.dark-mode #ov-saved-location-choice div[style*="f8f9fb"],
body.dark-mode #ov-saved-location-choice div[style*="#f8f9fb"] {
  background: rgba(20,28,45,.95) !important;
  border-top-color: rgba(255,255,255,.08) !important;
}
body.dark-mode #saved-loc-back {
  background: rgba(255,255,255,.08) !important;
  color: #e8ecf0 !important;
  border-color: rgba(255,255,255,.15) !important;
}

/* ── Premium modals (subscribe, one-time, manage) ── */
/* White inputs inside modals */
body.dark-mode #ov-subscribe input,
body.dark-mode #ov-onetime input,
body.dark-mode #ov-cancel-sub input {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: #e8ecf0 !important;
}
body.dark-mode #ov-subscribe input::placeholder,
body.dark-mode #ov-onetime input::placeholder { color: rgba(255,255,255,.30) !important; }
/* Field labels inside payment modals */
body.dark-mode #ov-subscribe label,
body.dark-mode #ov-onetime label { color: #9aa5b4 !important; }/* Wallet background box */
body.dark-mode #pay-form-wallet > div[style*="f8f9ff"],
body.dark-mode #pay-form-wallet > div[style*="#f8f9ff"],
body.dark-mode #ot-form-wallet > div[style*="f8f9ff"],
body.dark-mode #ot-form-wallet > div[style*="#f8f9ff"] {
  background: rgba(255,255,255,.05) !important;
}
body.dark-mode #pay-form-wallet div[style*="color:var(--navy)"],
body.dark-mode #ot-form-wallet  div[style*="color:var(--navy)"] { color: #e8ecf0 !important; }
body.dark-mode #ot-wallet-selected-info { background: rgba(46,125,50,.18) !important; color: #81c784 !important; }
body.dark-mode #ot-form-wallet label { color: #9aa5b4 !important; }
body.dark-mode #ot-form-wallet input {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: #e8ecf0 !important;
}
body.dark-mode .wallet-opt {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e8ecf0 !important;
}
body.dark-mode .wallet-opt:hover { background: rgba(255,255,255,.12) !important; }
/* Summary row */
body.dark-mode #ov-subscribe div[style*="color:var(--navy)"] { color: #e8ecf0 !important; }
/* Tab buttons inactive state */
body.dark-mode #pay-tab-wallet,
body.dark-mode #ot-tab-wallet {
  background: rgba(255,255,255,.06) !important;
  color: #9aa5b4 !important;
}
/* One-time modal contact fields container */
body.dark-mode #ov-onetime > div.modal > div:nth-child(2) {
  background: transparent !important;
}
/* One-time wallet buttons */
body.dark-mode .wallet-btn {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e8ecf0 !important;
}
body.dark-mode .wallet-btn:hover { background: rgba(255,255,255,.12) !important; }

/* ── SOS modal skip-to-send sticky bar ── */
body.dark-mode #ambu-skip-bar,
body.dark-mode #police-skip-bar,
body.dark-mode #fire-skip-bar {
  background: rgba(20,28,45,.97) !important;
  border-bottom-color: rgba(255,255,255,.10) !important;
}
body.dark-mode #ambu-skip-bar p,
body.dark-mode #police-skip-bar p,
body.dark-mode #fire-skip-bar p { color: #9aa5b4 !important; }

/* ── SOS form section headings & voice note buttons ── */
body.dark-mode .sos-sec h4 { color: #e8ecf0 !important; }
body.dark-mode #vnote-ambulance { background: rgba(211,47,47,.12) !important; }
body.dark-mode #vnote-police    { background: rgba(21,101,192,.12) !important; }
body.dark-mode #vnote-fire      { background: rgba(230,81,0,.12) !important; }


/* ── CLEAN NAVBAR + SIDE MENU ── */
.lifeline-navbar{overflow:visible;gap:12px}
.nav-menu-btn{background:var(--navy);color:#fff;border:none;border-radius:10px;width:40px;height:38px;font-size:22px;font-weight:900;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.nav-menu-btn:hover{background:#0d1b4b}
.nav-main-links{flex:0 1 auto;gap:18px;overflow:visible}
.nav-spacer{flex:1}
.nav-user-right{margin-left:auto;order:20}
.lifeline-navbar .btn-call{order:21}
.side-menu-backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:10000;opacity:0;pointer-events:none;transition:opacity .22s ease}
.side-menu{position:fixed;top:0;left:0;width:280px;height:100vh;background:#fff;border-right:1px solid var(--border);box-shadow:0 8px 38px rgba(0,0,0,.18);z-index:10001;padding:18px;display:flex;flex-direction:column;gap:7px;transform:translateX(-100%);transition:transform .22s ease;will-change:transform}
.side-menu-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;color:var(--navy);font-size:16px}
.side-menu-head button{border:none;background:var(--red-pale);color:var(--red);border-radius:8px;padding:6px 10px;font-weight:900;cursor:pointer}
.side-menu a{padding:12px 12px;border-radius:10px;text-decoration:none;color:var(--text);font-size:14px;font-weight:700;cursor:pointer}
.side-menu a:hover,.side-menu a.active{background:var(--red-pale);color:var(--red)}
body.side-menu-open .side-menu-backdrop{opacity:1;pointer-events:auto}
body.side-menu-open .side-menu{transform:translateX(0)}
body.rtl .side-menu,
html[dir="rtl"] .side-menu{left:auto;right:0;border-right:none;border-left:1px solid var(--border);transform:translateX(100%)}
body.rtl.side-menu-open .side-menu,
html[dir="rtl"] body.side-menu-open .side-menu{transform:translateX(0)}
body.rtl .nav-user-right{margin-left:0;margin-right:auto}

/* ── RTL lifeline-navbar full mirror ── */
body.rtl .lifeline-navbar { flex-direction: row-reverse; }
body.rtl .nav-menu-btn    { order: 30; }   /* far right  */
body.rtl .logo-wrap       { order: 25; }
body.rtl .nav-main-links  { order: 15; flex-direction: row; } /* keep items in natural DOM order */
body.rtl .nav-spacer      { order: 10; }
body.rtl .btn-dark-mode   { order: 5;  }
body.rtl .btn-lang        { order: 4;  }
body.rtl .notif-bell-wrap { order: 3;  }
body.rtl .nav-user-right  { order: 2; margin-left: 0; margin-right: auto; }
body.rtl .lifeline-navbar .btn-call { order: 1; } /* far left */
.chat-page-wrap{width:100%;max-width:980px;margin:0 auto;padding:28px}
.chat-page-card{background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:18px}
.chat-page-card .chat-box{position:relative;width:100%;max-width:none;height:620px;box-shadow:none;border:1px solid var(--border)}
.chat-page-card .chat-close-btn{display:none}
@media(max-width:900px){.nav-main-links{gap:10px}.nav-main-links a{font-size:12px}.logo-nums{display:none}.btn-dark-mode,.btn-lang,.notif-bell-wrap{display:none}.chat-page-wrap{padding:14px}.chat-page-card .chat-box{height:70vh}}


/* ── FLOATING CHAT BUTTON ── */
.floating-chat-btn{
  position:fixed;
  right:22px;
  bottom:22px;
  width:56px;
  height:56px;
  border-radius:50%;
  background:var(--navy);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:25px;
  text-decoration:none;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  z-index:450;
  cursor:pointer;
  transition:transform .18s, box-shadow .18s, background .18s;
}
.floating-chat-btn:hover{
  transform:translateY(-3px) scale(1.03);
  box-shadow:0 14px 34px rgba(0,0,0,.28);
  background:#0d1b4b;
}
[dir="rtl"] .floating-chat-btn,
body.rtl .floating-chat-btn{
  right:auto;
  left:22px;
}
@media(max-width:640px){
  .floating-chat-btn{right:16px;bottom:16px;width:52px;height:52px;font-size:23px}
  [dir="rtl"] .floating-chat-btn, body.rtl .floating-chat-btn{left:16px;right:auto}
}
/* Fix Trusted Locations Page */
.feature-wrap{
  max-width:1100px;
  margin:0 auto;
  padding:34px 28px;
  width:100%;
}

.feature-wrap h1{
  font-size:32px;
  font-weight:900;
  color:var(--navy);
  margin-bottom:8px;
}

.feature-wrap p{
  font-size:14px;
  color:var(--muted);
  margin-bottom:22px;
}

.trusted-form{
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:18px;
  padding:22px;
  max-width:680px;
  box-shadow:var(--shadow);
}

.trusted-form input{
  width:100%;
  height:44px;
  border:1.5px solid var(--border);
  border-radius:10px;
  padding:0 14px;
  font-size:14px;
  margin-bottom:12px;
  outline:none;
}

.trusted-form input:focus{
  border-color:var(--red);
}

.trusted-form .two-cols{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.trusted-form button{
  border:none;
  border-radius:10px;
  padding:12px 16px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  margin-right:8px;
  background:var(--navy);
  color:#fff;
}

.trusted-form button:first-of-type{
  background:var(--red);
}

#trusted-locations-list{
  margin-top:22px;
}

/* Menu active/highlight */
.side-menu a.active,
.side-menu a.menu-active{
  background:var(--red-pale);
  color:var(--red);
  font-weight:900;
  border-left:4px solid var(--red);
}
.side-menu{
    overflow-y:auto;
    height:100vh;
    padding-bottom:80px;
}

.side-menu a{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:42px;
}

.side-menu-head{
    position:sticky;
    top:0;
    background:white;
    z-index:10;
}
.saved-locations-page h1{
  color:var(--navy);
}

.saved-locations-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:20px;
}

.add-location-btn{
  width:46px;
  height:46px;
  border-radius:50%;
  border:none;
  background:var(--red);
  color:#fff;
  font-size:28px;
  font-weight:900;
  cursor:pointer;
  box-shadow:var(--shadow);
}

.saved-location-card{
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:18px;
  padding:20px;
  max-width:760px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
}

.saved-location-card input{
  width:100%;
  height:44px;
  border:1.5px solid var(--border);
  border-radius:10px;
  padding:0 14px;
  font-size:14px;
  margin-bottom:12px;
  outline:none;
}

.saved-location-card input:focus{
  border-color:var(--red);
}

.map-box{
  width:100%;
  height:260px;
  border-radius:16px;
  overflow:hidden;
  border:1.5px solid var(--border);
  margin:12px 0;
}

.map-box iframe{
  width:100%;
  height:100%;
  border:0;
}

.saved-location-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.saved-location-actions button{
  border:none;
  border-radius:10px;
  padding:12px 16px;
  cursor:pointer;
  font-weight:800;
  background:var(--navy);
  color:#fff;
}

.saved-location-actions button:first-child{
  background:var(--red);
}
.side-menu-backdrop{
  z-index:10000 !important;
}

.side-menu{
  z-index:10001 !important;
}

.leaflet-container,
.leaflet-pane,
.leaflet-top,
.leaflet-bottom{
  z-index:1 !important;
}

.center-pin{
  z-index:2 !important;
}

/* ── Shared chat widget z-index — above maps, below side menu ── */
#shared-chat-overlay {
  z-index: 8500 !important;
}
.floating-chat-btn {
  z-index: 8400 !important;
}


/* ── Chat popup position: keep send button clear of floating chat button ── */
#shared-chat-overlay{
  right:92px !important;
}
[dir="rtl"] #shared-chat-overlay,
body.rtl #shared-chat-overlay{
  right:auto !important;
  left:92px !important;
}
[dir="rtl"] .chat-overlay,
body.rtl .chat-overlay{
  padding:24px 24px 24px 92px;
}
@media(max-width:640px){
  #shared-chat-overlay{right:10px !important;}
  [dir="rtl"] #shared-chat-overlay,
  body.rtl #shared-chat-overlay{left:10px !important;right:auto !important;}
  .chat-overlay{padding:0 !important;}
}

/* ── Nearby help section hidden by default ── */
#nearby-help-section {
  display: none;
}

/* ── History page dark mode card text ── */
body.dark-mode .hist-card {
  background: rgba(20,28,45,.82) !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* ── Locations page dark mode ── */
body.dark-mode .loc-add-card,
body.dark-mode .loc-item {
  background: rgba(20,28,45,.82) !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* ── SpeakUp menu item — same color as all other menu items ── */
.side-menu a.speakup-link {
  color: var(--text);
  font-weight: 700;
}
.side-menu a.speakup-link:hover {
  color: var(--red);
}

/* ── Side menu dark mode ── */
body.dark-mode .side-menu {
  background: #1a1a2e !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode .side-menu-head {
  background: #1a1a2e !important;
  color: #e8ecf0 !important;
}
body.dark-mode .side-menu-head strong {
  color: #e8ecf0 !important;
}
body.dark-mode .side-menu-head button {
  background: rgba(255,255,255,.08) !important;
  color: #e8ecf0 !important;
  border: 1px solid rgba(255,255,255,.15) !important;
}
body.dark-mode .side-menu a {
  color: #e8ecf0 !important;
}
body.dark-mode .side-menu a.speakup-link {
  color: #e8ecf0 !important;
}
body.dark-mode .side-menu a:hover,
body.dark-mode .side-menu a.active,
body.dark-mode .side-menu a.menu-active {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
}


/* ── FINAL FIX: wider side menu + SpeakUp menu link color ── */
.side-menu{
  width:320px !important;
  transform:translateX(-340px) !important;
  visibility: visible !important;
  display: flex !important;
  flex-direction: column !important;
}
body.side-menu-open .side-menu{
  transform:translateX(0) !important;
  visibility: visible !important;
}
body.rtl .side-menu,
html[dir="rtl"] .side-menu{
  left:auto !important;
  right:0 !important;
  border-right:none !important;
  border-left:1px solid var(--border) !important;
  transform:translateX(100%) !important;
  visibility: visible !important;
}
body.rtl.side-menu-open .side-menu,
html[dir="rtl"] body.side-menu-open .side-menu{
  transform:translateX(0) !important;
  visibility: visible !important;
}
.side-menu a.speakup-link,
.side-menu a[onclick*="speakup"]{
  color:var(--text) !important;
  font-weight:700 !important;
}
.side-menu a.speakup-link:hover,
.side-menu a[onclick*="speakup"]:hover{
  background:var(--red-pale) !important;
  color:var(--red) !important;
}
.side-menu a.speakup-link.active,
.side-menu a.speakup-link.menu-active,
.side-menu a[onclick*="speakup"].active,
.side-menu a[onclick*="speakup"].menu-active{
  background:var(--red-pale) !important;
  color:var(--red) !important;
}


/* ── Pause all SOS pulse animations while the side menu is open ──
   This eliminates the stutter caused by compositing 9+ concurrent
   infinite animations alongside the menu backdrop transition.     */
body.side-menu-open .pulse-btn,
body.side-menu-open .pulse-btn::before,
body.side-menu-open .pulse-btn::after {
  animation-play-state: paused !important;
}

/* Also pause the background light movement on the SOS hero */
body.side-menu-open .sos-hero-bg,
body.side-menu-open [style*="lifelineLightMove"] {
  animation-play-state: paused !important;
}

/* Ambulance hover in dark mode — keep colored fill, not white */
body.dark-mode .pulse-btn.ambulance:hover {
  background: linear-gradient(145deg, #b71c1c, #c62828) !important;
  color: #fff !important;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first overrides
   Breakpoints: 768px (tablet), 480px (phone), 360px (small)
   ═══════════════════════════════════════════════════════════ */

/* ── 768px: tablet ─────────────────────────────────────── */
@media (max-width: 768px) {

  /* Navbar: hide inline nav links — hamburger is enough */
  .nav-main-links { display: none !important; }
  .nav-spacer     { display: none !important; }

  /* Show lang + notif + dark on tablet (hide only on 480) */
  .btn-dark-mode, .btn-lang, .notif-bell-wrap { display: flex !important; }

  /* Notification dropdown — don't overflow screen */
  .notif-dropdown {
    width: min(340px, 94vw) !important;
    right: 8px !important;
    left: auto !important;
  }
  body.rtl .notif-dropdown {
    right: auto !important;
    left: 8px !important;
  }

  /* Side menu — never wider than 88vw */
  .side-menu { width: min(320px, 88vw) !important; }

  /* Page wraps — full width with safe padding */
  .prem-wrap, .family-wrap, .acc-wrap,
  .locations-wrap, .nearby-wrap, .history-wrap,
  .phones-wrap, .services-wrap, .svc-wrap {
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }

  /* SOS hero */
  .sos-hero { padding: 32px 16px !important; }
  .sos-hero h1 { font-size: 22px !important; margin-bottom: 36px !important; }
  .sos-btns { gap: 32px !important; }

  /* Modals/overlays — full screen on tablet */
  .overlay { padding: 12px !important; }
  .modal   { width: 100% !important; max-width: 100% !important;
             max-height: 92vh !important; border-radius: 16px !important; }

  /* Family hero — stack */
  .family-hero {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .family-hero-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }

  /* Account grid */
  .acc-grid { grid-template-columns: 1fr !important; }

  /* Premium service overlays */
  .prem-service-box { width: 96vw !important; }

  /* Emergency tools panel — smaller offset */
  #ll-sos-tools-wrapper {
    bottom: 14px !important;
    left: 14px !important;
  }
  html[dir="rtl"] #ll-sos-tools-wrapper,
  body.rtl #ll-sos-tools-wrapper {
    left: auto !important;
    right: 14px !important;
  }
}

/* ── 480px: phone ───────────────────────────────────────── */
@media (max-width: 480px) {

  /* Navbar — minimal: just hamburger, logo, bell */
  .btn-dark-mode, .btn-lang { display: none !important; }
  .btn-call { display: none !important; }
  .logo-nums { display: none !important; }
  .logo-sub  { display: none !important; }
  .logo-name { font-size: 16px !important; }

  .lifeline-navbar {
    padding: 8px 12px !important;
    gap: 8px !important;
  }

  /* User greeting — shorten */
  .user-name-btn { font-size: 11px !important; }
  .user-name-btn .caret { display: none; }

  /* SOS hero */
  .sos-hero { padding: 24px 12px !important; }
  .sos-hero h1 { font-size: 19px !important; margin-bottom: 28px !important; }

  /* SOS buttons — slightly smaller, tighter gap */
  .sos-btns { gap: 18px !important; }
  .pulse-btn {
    width: 108px !important;
    height: 108px !important;
    font-size: 12px !important;
    border-width: 5px !important;
  }

  /* Notification dropdown full-width */
  .notif-dropdown {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
  }

  /* Side menu — nearly full screen */
  .side-menu { width: min(300px, 92vw) !important; }

  /* Modals */
  .modal { border-radius: 12px !important; padding: 16px !important; }

  /* Premium wrap */
  .prem-wrap {
    padding: 12px !important;
  }

  /* Family page */
  .family-hero { padding: 16px !important; }
  .family-hero h1 { font-size: 20px !important; }
  .family-add-main-btn { font-size: 13px !important; padding: 10px 14px !important; }
  .family-grid { grid-template-columns: 1fr !important; }

  /* Emergency tools panel — tighter position */
  #ll-sos-tools-wrapper {
    bottom: 10px !important;
    left: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }
  html[dir="rtl"] #ll-sos-tools-wrapper,
  body.rtl #ll-sos-tools-wrapper {
    left: auto !important;
    right: 10px !important;
  }
  #ll-sos-tools-panel {
    min-width: unset !important;
    max-width: calc(100vw - 80px) !important;
  }

  /* Chat FAB — smaller, higher up to not clash with tools panel */
  .floating-chat-btn {
    right: 12px !important;
    bottom: 12px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 21px !important;
  }

  /* Toast */
  #toast {
    right: 12px !important;
    left: 12px !important;
    bottom: 12px !important;
    text-align: center !important;
  }

  /* Overlays — full screen */
  .prem-service-overlay {
    padding: 10px !important;
  }
  .prem-service-box { border-radius: 14px !important; }
  .prem-service-hero { padding: 20px 16px 18px !important; }
  .prem-service-content { padding: 14px !important; }

  /* About page */
  .ab-cards { grid-template-columns: 1fr !important; }

  /* Location/nearby cards */
  .saved-location-card { padding: 14px !important; }
}

/* ── 360px: very small phones ───────────────────────────── */
@media (max-width: 360px) {

  .sos-btns { gap: 12px !important; }
  .pulse-btn {
    width: 96px !important;
    height: 96px !important;
    font-size: 11px !important;
  }

  .modal { padding: 12px !important; }

  .logo-icon { font-size: 18px !important; }
  .logo-name { font-size: 14px !important; }
}

/* ── Request page mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .request-wrap, .req-wrap {
    width: 100% !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }
  .req-tabs { flex-wrap: wrap !important; gap: 6px !important; }
  .req-tab  { flex: 1 1 auto !important; font-size: 12px !important; }

  /* Nearby / locations cards */
  .nearby-grid, .saved-locs-grid {
    grid-template-columns: 1fr !important;
  }

  /* History table — make it scroll */
  .history-wrap .adm-table-wrap,
  .history-table-wrap {
    overflow-x: auto !important;
  }

  /* Phones page */
  .phones-grid { grid-template-columns: 1fr !important; }
  .phone-card  { padding: 12px !important; }

  /* Donations */
  .donation-cards, .don-grid {
    grid-template-columns: 1fr !important;
  }

  /* First Aid */
  .fa-steps { grid-template-columns: 1fr !important; }

  /* Medical profile */
  .med-grid { grid-template-columns: 1fr !important; }

  /* Services page */
  .svc-grid { grid-template-columns: 1fr !important; }

  /* Chat page */
  .chat-page-wrap { padding: 8px !important; }
  .chat-page-card .chat-box { height: 75vh !important; }
}

@media (max-width: 480px) {
  /* Request page step tracker */
  .dsteps { gap: 4px !important; }
  .dstep-label { font-size: 9px !important; }

  /* Overlays: make form fields bigger touch targets */
  .sos-sec input, .sos-sec select, .sos-sec textarea {
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 10px 12px !important;
  }
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom */
  }

  /* Premium plan cards stack */
  .premium-addon-grid { grid-template-columns: 1fr !important; }

  /* About page bio cards */
  .ab-cards { grid-template-columns: 1fr !important; }

  /* Donations page */
  .don-amount-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Login / Auth — prevent cut-off on small laptop screens ── */

/* Center the box when there's plenty of room, scroll when there isn't */
#auth.active {
  display: flex !important;
}

/* ── Laptop viewport fix (14"–15.6" at 100% scale) ──────────────
   Target: viewport height ≤ 900px with left panel visible (> 820px wide)
   Goal:   fit all left-panel content without scrolling or overflow
   ────────────────────────────────────────────────────────────── */
@media (max-height: 900px) and (min-width: 821px) {

  .auth-panel-left {
    padding: 28px 32px;
    overflow-y: auto
  }

  .auth-left-logo {
    margin-bottom: 20px
  }

  .auth-left-logo-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 12px
  }

  .auth-left-logo-text strong {
    font-size: 17px
  }

  .auth-left-logo-text span {
    font-size: 10px
  }

  .auth-left-headline {
    font-size: clamp(18px, 2.4vw, 24px);
    margin-bottom: 10px
  }

  .auth-left-sub {
    font-size: 12px;
    line-height: 1.55;
    max-width: 100%
  }

  .auth-mission {
    padding: 10px 12px;
    margin-top: 12px;
    border-radius: 10px;
    gap: 9px
  }

  .auth-mission-icon {
    font-size: 17px
  }

  .auth-mission p {
    font-size: 11px;
    line-height: 1.5
  }

  .auth-left-services {
    gap: 7px;
    margin-top: 14px
  }

  .auth-svc-pill {
    padding: 8px 12px;
    gap: 9px;
    border-radius: 10px
  }

  .auth-svc-name {
    font-size: 11.5px
  }

  .auth-svc-desc {
    font-size: 9.5px
  }

  .auth-svc-pill .svc-dot {
    width: 8px;
    height: 8px;
    margin-top: 2px
  }

  .auth-svc-pill .svc-num {
    font-size: 10px
  }

  .auth-left-bottom {
    padding-top: 12px
  }

  .auth-hiw-label {
    font-size: 9px;
    margin-bottom: 7px
  }

  .auth-hiw-num {
    width: 22px;
    height: 22px;
    font-size: 10px
  }

  .auth-hiw-step {
    font-size: 11px;
    gap: 6px
  }

  .auth-hiw-arrow {
    font-size: 12px
  }

  /* Right panel — keep card vertically centered but scrollable */
  .auth-panel-right {
    padding: 28px 28px;
    justify-content: center
  }

  .auth-top-row {
    top: 14px;
    right: 16px
  }

  .auth-box {
    padding: 24px 28px 22px
  }

  .auth-hd {
    margin-bottom: 16px
  }

  .auth-hd h1 {
    font-size: 19px
  }

  .auth-hd p {
    font-size: 12px
  }

  .atabs {
    margin-bottom: 16px
  }

  .aform {
    gap: 11px
  }

  .af input {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 13px
  }

  .auth-btn {
    padding: 11px;
    font-size: 14px
  }

  .auth-back-link {
    margin-bottom: 12px
  }
}

/* Extra tight — 768px height (common 14" at 125% scale) */
@media (max-height: 768px) and (min-width: 821px) {

  .auth-panel-left {
    padding: 20px 28px
  }

  .auth-left-logo {
    margin-bottom: 14px
  }

  .auth-left-headline {
    font-size: clamp(16px, 2vw, 20px);
    margin-bottom: 7px
  }

  .auth-left-sub {
    font-size: 11.5px
  }

  .auth-mission {
    margin-top: 9px;
    padding: 8px 11px
  }

  .auth-mission p {
    font-size: 10.5px
  }

  .auth-left-services {
    gap: 5px;
    margin-top: 10px
  }

  .auth-svc-pill {
    padding: 7px 10px
  }

  .auth-box {
    padding: 20px 24px 18px
  }

  .aform {
    gap: 9px
  }
}

/* ═══════════════════════════════════════════════════════════
   PAGE-LEVEL ZOOM-TO-FIT on small laptop screens
   Applies to: First Aid, Medical Profile, Account, About,
               Nearby Help, Saved Locations, Donations,
               SpeakUp, Premium Services
   Navbar is excluded — only the page content scales.
   ═══════════════════════════════════════════════════════════ */

@media (max-height: 750px) {
  .fa-wrap,
  .acc-wrap,
  .nearby-wrap,
  .prem-wrap,
  .don-wrap,
  .su-wrap,
  .loc-wrap {
    zoom: 0.88;
  }
}

@media (max-height: 650px) {
  .fa-wrap,
  .acc-wrap,
  .nearby-wrap,
  .prem-wrap,
  .don-wrap,
  .su-wrap,
  .loc-wrap {
    zoom: 0.78;
  }
}

@media (max-height: 560px) {
  .fa-wrap,
  .acc-wrap,
  .nearby-wrap,
  .prem-wrap,
  .don-wrap,
  .su-wrap,
  .loc-wrap {
    zoom: 0.68;
  }
}

/* ── Prevent zoomed page content from trapping the side menu ──
   zoom creates a stacking context; give content wrappers an
   explicit low z-index so fixed side-menu always paints above. */
.fa-wrap,
.acc-wrap,
.nearby-wrap,
.prem-wrap,
.don-wrap,
.su-wrap,
.loc-wrap {
  position: relative;
  z-index: 1;
}

/* ── Side menu always on top of everything including zoomed wrappers ── */
#side-menu,
.side-menu {
  z-index: 99999 !important;
}
#side-menu-backdrop,
.side-menu-backdrop {
  z-index: 99998 !important;
}

/* ── Subscribe modal — scrollable, no zoom needed ── */
#ov-subscribe .modal {
  max-height: 92vh !important;
  overflow-y: auto !important;
}

/* ── Active Request page zoom-to-fit ── */
@media (max-height: 750px) {
  #page-request .req-hd,
  #page-request .req-card {
    zoom: 0.88;
    position: relative;
    z-index: 1;
  }
}
@media (max-height: 650px) {
  #page-request .req-hd,
  #page-request .req-card {
    zoom: 0.78;
  }
}
@media (max-height: 560px) {
  #page-request .req-hd,
  #page-request .req-card {
    zoom: 0.68;
  }
}

/* ── Side menu backdrop when moved to body ── */
body > .side-menu-backdrop {
  position: fixed !important;
  display: block !important;
  visibility: visible !important;
  inset: 0 !important;
  background: rgba(0,0,0,.28) !important;
  z-index: 99998 !important;
  backdrop-filter: blur(3px) !important;
  transition: opacity .2s ease !important;
  opacity: 0;
  pointer-events: none;
}
body.side-menu-open > .side-menu-backdrop {
  opacity: 1 !important;
  pointer-events: auto !important;
}
