/* ==========================================================================
   CivicShield — Modern Public Safety & Emergency Response Design System
   Visual Direction: Calm, Trustworthy, Modern Emergency Utility (Light Theme)
   Designed according to safety product standards (Apple Health + Uber Safety)
   ========================================================================== */

/* Inter Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Surfaces & Backgrounds */
  --bg-primary: #F7F8FA;
  --bg: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-soft: #F2F4F7;
  --bg-surface-hover: #F8F9FA;
  --surface: #FFFFFF;
  --surface-soft: #F2F4F7;

  /* Typography Colors */
  --text-primary: #101828;
  --text: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border: #E4E7EC;
  --border-subtle: #E4E7EC;
  --border-strong: #D0D5DD;
  --border-focus: #D92D20;

  /* Emergency Red / Primary Brand */
  --color-sos: #D92D20;
  --color-sos-dark: #B42318;
  --color-sos-hover: #B42318;
  --primary: #D92D20;
  --primary-hover: #B42318;
  --primary-soft: #FEF3F2;
  --primary-border: #FECDCA;

  /* Safe / Success Green */
  --color-safe: #12B76A;
  --color-safe-dark: #027A48;
  --color-whatsapp: #12B76A;
  --success: #12B76A;
  --success-hover: #027A48;
  --success-soft: #ECFDF3;
  --success-border: #A6F4C7;

  /* Information / SMS Blue */
  --color-sms: #2563EB;
  --info: #2563EB;
  --info-hover: #1D4ED8;
  --info-soft: #EFF6FF;
  --info-border: #BFDBFE;

  /* Warning Amber */
  --color-warning: #F79009;
  --warning: #F79009;
  --warning-hover: #B54708;
  --warning-soft: #FFFAEB;
  --warning-border: #FEDF89;

  /* Neutrals */
  --color-accent: #344054;
  --color-purple: #7C3AED;

  /* Restrained Radii (No 24px-40px excessive rounding!) */
  --radius-xs: 4px;
  --radius-sm: 8px;     /* controls, tags */
  --radius-md: 10px;    /* buttons */
  --radius-lg: 12px;    /* cards */
  --radius-xl: 16px;    /* large containers */
  --radius-full: 9999px;

  /* Restrained, Crisp Shadows (No neon glows!) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);

  /* Clean Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient glow removed — clean whitespace background */
.ambient-glow {
  display: none !important;
}

/* Screen strobe mode (for emergency flashlight/strobe feature) */
body.siren-strobe {
  animation: screenStrobeAnim 0.18s infinite alternate !important;
}
@keyframes screenStrobeAnim {
  0% { filter: invert(0) brightness(1); }
  100% { filter: invert(1) brightness(1.6); }
}

/* Accessible outline */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
#app-viewport {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.app-content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Tab Panels */
.tab-view {
  display: none;
  width: 100%;
}

.tab-view.active {
  display: block;
  animation: fadeInTab 0.18s ease-out;
}

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

/* ==========================================================================
   Official Government / Public Safety Top Bar
   ========================================================================== */
.gov-top-bar {
  background: #081120;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #FF9933 0%, #FF9933 33.3%, #FFFFFF 33.3%, #FFFFFF 66.6%, #138808 66.6%, #138808 100%) 1;
  color: #E2E8F0;
  font-size: 11.5px;
  line-height: 1.4;
  position: relative;
  z-index: 101;
}

.gov-top-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gov-top-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gov-flag-emblem {
  font-size: 14px;
}

.gov-portal-tag {
  letter-spacing: 0.04em;
  color: #CBD5E1;
  font-weight: 500;
}

.gov-portal-tag strong {
  color: #FFFFFF;
  font-weight: 700;
}

.gov-top-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94A3B8;
}

.gov-helpline-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #F87171;
  font-weight: 600;
}

.gov-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
  display: inline-block;
  animation: pulseAlarm 1.2s infinite;
}

.gov-112-link {
  color: #FFFFFF;
  background: #DC2626;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition: background-color var(--transition-fast);
}

.gov-112-link:hover {
  background: #B91C1C;
}

.gov-separator {
  color: #475569;
}

.gov-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gov-top-accessibility {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gov-access-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #F1F5F9;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gov-access-btn:hover {
  background: #334155;
  border-color: #64748B;
  color: #FFFFFF;
}

.gov-access-btn:active {
  transform: scale(0.96);
}

.brand-gov-seal {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #1D4ED8;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ==========================================================================
   Global Header & Navigation
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-soft);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.desktop-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.desktop-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
}

.desktop-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Restrained emergency tab styling */
.desktop-nav-link-sos.active {
  color: var(--primary);
  background: var(--bg-surface);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Voice indicator pill: subtle, calm, human */
.voice-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.voice-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.voice-indicator-pill.active {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--color-safe-dark);
}

.voice-indicator-pill.active .voice-pulse-dot {
  background: var(--success);
}

/* Language selector */
.lang-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-select-btn {
  appearance: none;
  padding: 6px 28px 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.lang-select-btn:hover, .lang-select-btn:focus {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.lang-caret {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--text-muted);
}

/* ==========================================================================
   Cards & Surfaces System (Apple Health / Clean Utility style)
   ========================================================================== */
.emergency-hotlines-card,
.journey-card,
.safety-score-card,
.community-reports-feed-card,
.gps-status-card,
.nearby-finder-container,
.trusted-contacts-quick {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.emergency-hotlines-card:last-child,
.journey-card:last-child {
  margin-bottom: 0;
}

/* Subtle Honest Notice Banner */
.honesty-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.45;
}

.honesty-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--info);
  flex-shrink: 0;
}

/* Section Labels & Headers */
.section-label {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.section-label-row,
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-label-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-surface-soft);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.card-icon-badge.journey-badge {
  background: var(--info-soft);
  color: var(--info);
  border-color: var(--info-border);
}

.card-icon-badge.security-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.card-main-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   TAB 1: EMERGENCY SOS SCREEN
   ========================================================================== */
.desktop-sos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

/* SOS Hero Area */
.sos-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

/* SOS Button Container: Solid, calm, serious emergency device */
.sos-radar-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 20px;
}

/* Subtle, restrained outer ring (no huge neon waves) */
.sos-wave {
  display: none; /* removed excessive pulsing blobs */
}

/* Main circular emergency button */
.btn-sos-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(170px, 22vw, 210px);
  height: clamp(170px, 22vw, 210px);
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, #DC2626 0%, #991B1B 100%);
  color: #FFFFFF;
  border: 8px solid var(--primary-soft);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.28);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-sos-main:hover {
  background: linear-gradient(145deg, #EF4444 0%, #B91C1C 100%);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.38);
  transform: translateY(-2px);
}

.btn-sos-main:active {
  transform: scale(0.96);
  background: #7F1D1D;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.sos-shield-icon {
  margin-bottom: 4px;
}

.sos-shield-icon svg {
  width: 32px;
  height: 32px;
  fill: #FFFFFF;
}

.sos-text {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sos-subtext {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-top: 4px;
}

/* Status Badge below button */
.sos-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-safe-dark);
  margin-bottom: 8px;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.sos-instruction {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
}

/* Dispatch Actions: WhatsApp & SMS rectangular buttons */
.dispatch-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-align: left;
}

.btn-action:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.btn-whatsapp:hover {
  border-color: var(--success);
  background: var(--success-soft);
}

.btn-sms:hover {
  border-color: var(--info);
  background: var(--info-soft);
}

.btn-action-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-soft);
  flex-shrink: 0;
}

.btn-whatsapp .btn-action-icon-wrap {
  color: var(--success);
  background: var(--success-soft);
}

.btn-sms .btn-action-icon-wrap {
  color: var(--info);
  background: var(--info-soft);
}

.btn-action-text-wrap {
  display: flex;
  flex-direction: column;
}

.btn-action-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.25;
}

.btn-action-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Safe Check-In Button: clean secondary confirmation */
.btn-safe-checkin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  margin-bottom: 20px;
}

.btn-safe-checkin:hover {
  background: var(--bg-surface-soft);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Emergency Hotlines: Clean List Rows */
.hotline-tollfree-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-soft);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.hotline-buttons-grid {
  display: flex;
  flex-direction: column;
}

.btn-hotline {
  display: flex;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-fast);
  text-decoration: none;
}

.btn-hotline:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.btn-hotline:hover {
  background-color: var(--bg-surface-hover);
}

.hotline-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-right: 14px;
  flex-shrink: 0;
}

.hotline-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hotline-num {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
}

.hotline-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.hotline-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   Right Column: Live Location, Safe Havens & Contacts
   ========================================================================== */

/* Live GPS Card */
.gps-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gps-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.satellite-radar-icon {
  display: flex;
  align-items: center;
  color: var(--success);
}

.satellite-ping {
  display: none;
}

.gps-accuracy-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.gps-coords-display-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.gps-coords-display {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-copy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-copy-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.gps-meta-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.gps-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-gps-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-gps-action:hover {
  background: var(--bg-surface-soft);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Nearby Safe Havens: Clean List Rows */
.nearby-finder-grid {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.btn-nearby {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.btn-nearby:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.btn-nearby:hover {
  background-color: var(--bg-surface-hover);
}

.nearby-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-right: 12px;
  flex-shrink: 0;
}

.police-icon { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.hospital-icon { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-border); }
.pharmacy-icon { color: var(--success); background: var(--success-soft); border-color: var(--success-border); }
.fire-icon { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-border); }

.nearby-text {
  flex: 1;
}

.nearby-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
}

.nearby-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.nearby-ext {
  color: var(--text-muted);
}

/* Trusted Contacts Quick Preview */
.btn-manage-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--info);
  cursor: pointer;
}

.btn-manage-link:hover {
  text-decoration: underline;
}

.quick-contacts-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.quick-contact-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.quick-contact-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-contact-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   TAB 2: SAFE JOURNEY SCREEN (Transportation Safety / Uber style)
   ========================================================================== */
.desktop-journey-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Presets & Chips: Simple outlined chips */
.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-preset-chip {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-preset-chip:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-surface-soft);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ETA chips */
.eta-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.eta-pill {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.eta-pill:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.eta-pill.active {
  background: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
  font-weight: 600;
}

/* Primary Button system */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Active Journey State Card (Uber safety trip feeling) */
.journey-active-state {
  border: 1.5px solid var(--warning);
  background: var(--bg-surface);
}

.journey-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.journey-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warning-hover);
  background: var(--warning-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--warning-border);
}

.journey-dest-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface-soft);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.journey-timer-display {
  text-align: center;
  padding: 20px 0;
}

.journey-timer-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.journey-clock {
  font-size: 44px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 6px 0;
}

.journey-timer-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto;
}

.btn-arrived-success {
  background: var(--success) !important;
}

.btn-arrived-success:hover {
  background: var(--color-safe-dark) !important;
}

/* Companion Sentinel List */
.sentinel-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.sentinel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sentinel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.sentinel-icon.green { background: var(--success-soft); color: var(--success); }
.sentinel-icon.blue { background: var(--info-soft); color: var(--info); }
.sentinel-icon.amber { background: var(--warning-soft); color: var(--warning); }

.sentinel-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
}

.sentinel-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.safety-tips-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.safety-tips-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.safety-tips-checklist span {
  color: var(--text-muted);
  font-weight: 700;
}

/* ==========================================================================
   TAB 3: COMMUNITY SAFETY MAP (Map is the hero)
   ========================================================================== */
.desktop-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Area Safety Index */
.safety-score-card {
  padding: 16px 20px;
  margin-bottom: 16px;
}

.safety-score-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.score-number-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.score-number {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.score-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.safety-score-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.safety-score-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.score-explanation {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Leaflet Map Wrap: Hero Element */
.map-container-wrap {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-wrap {
  width: 100%;
  height: 520px;
}

#safety-map {
  width: 100%;
  height: 100%;
  background: #E5E7EB;
}

.map-quick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.btn-map-control {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-map-control:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.legend-dot.dark-street { background: var(--warning); }
.legend-dot.harassment { background: var(--primary); }
.legend-dot.no-cctv { background: var(--color-purple); }

/* Right Column: Hazard Reporting & Feed */
.hazard-action-card {
  margin-bottom: 16px;
}

.btn-report-hazard {
  background: var(--text-primary);
}

.btn-report-hazard:hover {
  background: #1F2937;
}

.verified-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--info);
  background: var(--info-soft);
  border: 1px solid var(--info-border);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.hazard-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-chip {
  padding: 5px 12px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-chip.active {
  background: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
  font-weight: 600;
}

.reports-scroll-container {
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   TAB 4: FAMILY & FRIENDS (Trusted Contacts)
   ========================================================================== */
.desktop-contacts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

.contacts-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.contacts-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.contacts-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-add-loved-one {
  width: auto;
  padding: 0 16px;
  height: 40px;
  font-size: 13.5px;
}

.contacts-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.contact-item-card:hover {
  border-color: var(--border-strong);
}

.contact-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  font-size: 15px;
  font-weight: 700;
}

.contact-meta h4 {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.contact-meta p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-action:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Realistic Emergency Message Preview Box */
.dispatch-preview-box {
  background: #EFEAE2; /* subtle WhatsApp chat wallpaper tint */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
}

.preview-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.preview-text {
  background: #FFFFFF;
  border-radius: 8px 8px 8px 2px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   TAB 5: SAFETY TOOLS (Utility Screen)
   ========================================================================== */
.desktop-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.tool-card:nth-child(4) {
  grid-column: span 3;
  margin-top: 10px;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.siren-tool-icon { background: var(--primary-soft); color: var(--primary); }
.fakecall-tool-icon { background: var(--info-soft); color: var(--info); }
.strobe-tool-icon { background: var(--warning-soft); color: var(--warning); }

.tool-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* Siren wave bars */
.siren-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  margin: 12px 0 18px;
}

.wave-bar {
  width: 5px;
  height: 8px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  transition: height 0.15s ease;
}

.siren-visualizer.active .wave-bar {
  background: var(--primary);
  animation: waveBarAnim 0.4s infinite alternate;
}

.siren-visualizer.active .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.siren-visualizer.active .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.siren-visualizer.active .wave-bar:nth-child(4) { animation-delay: 0.15s; }
.siren-visualizer.active .wave-bar:nth-child(5) { animation-delay: 0.05s; }
.siren-visualizer.active .wave-bar:nth-child(6) { animation-delay: 0.25s; }
.siren-visualizer.active .wave-bar:nth-child(7) { animation-delay: 0.12s; }

@keyframes waveBarAnim {
  0% { height: 6px; }
  100% { height: 28px; }
}

.btn-siren-trigger {
  margin-top: auto;
}

.fake-call-delays-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.btn-clear-link {
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-clear-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.activity-history-scroll {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* ==========================================================================
   TAB 6: PRIVACY LOCK & SETTINGS
   ========================================================================== */
.desktop-security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.pattern-modes-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.pattern-mode-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-soft);
}

.mode-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mode-dot.green { background: var(--success); }
.mode-dot.red { background: var(--primary); }

.mode-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pattern-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-strong);
  transition: 0.2s ease;
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
  background-color: var(--success);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.keywords-box {
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.keywords-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.keywords-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-pill {
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

/* QA Checklist */
.qa-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.qa-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   Modals & Overlays (Clean Dialogs)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeInModal 0.15s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-sheet {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

/* SOS BROADCAST DISPATCH CENTER MODAL */
.sos-dispatch-sheet {
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.25), 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.dispatch-pulse-icon {
  font-size: 1.6rem;
  display: inline-block;
  animation: pulseAlarm 1.2s infinite;
}

.dispatch-coords-box {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
  border: 1px solid var(--border);
}

.dispatch-coords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.dispatch-coords-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-top: 5px;
  word-break: break-all;
}

.btn-pill-action {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-pill-action:hover {
  background: var(--bg-surface-raised, #1e293b);
  border-color: var(--text-muted);
}

.dispatch-msg-preview {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.dispatch-msg-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.dispatch-msg-content {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
  line-height: 1.45;
  max-height: 130px;
  overflow-y: auto;
}

.dispatch-sms-note-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.emergency-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dispatch-broadcast-section {
  margin-top: 14px;
}

.dispatch-quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-broadcast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.btn-broadcast:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-broadcast-sms {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-broadcast-wa {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.btn-broadcast-share {
  background: var(--bg-surface-raised, #1e293b);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.dispatch-contacts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 8px;
}

.dispatch-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
}

.dispatch-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  gap: 8px;
}

.dispatch-contact-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dispatch-contact-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-contact-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.dispatch-contact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-contact-wa {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-contact-wa:hover {
  background: #16a34a;
  color: #ffffff;
}

.btn-contact-sms {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-contact-sms:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-contact-call {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-contact-call:hover {
  background: #d97706;
  color: #ffffff;
}

/* 5-SECOND SOS COUNTDOWN OVERLAY */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 24, 40, 0.7);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.countdown-overlay.active {
  display: flex;
}

.countdown-modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--primary-border);
}

.countdown-warning-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.countdown-timer-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
}

.countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-circle-bg {
  fill: none;
  stroke: var(--primary-soft);
  stroke-width: 10;
}

.countdown-circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.countdown-digits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.countdown-alert-info {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 24px;
}

.btn-cancel-sos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: var(--text-primary);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-cancel-sos:hover {
  background: #1F2937;
}

/* FAKE INCOMING CALL OVERLAY */
.fake-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0B0F19;
  z-index: 2500;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 80px 24px 60px;
}

.fake-call-overlay.active {
  display: flex;
}

.call-info-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.caller-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1F2937;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
}

.caller-name {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
}

.caller-status {
  font-size: 15px;
  color: #9CA3AF;
  margin-top: 4px;
}

.call-actions-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.btn-call-action {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.btn-call-action:active {
  transform: scale(0.92);
}

.btn-call-decline { background: #EF4444; }
.btn-call-accept { background: #22C55E; }

/* PATTERN CANVAS WRAP */
.pattern-canvas-wrap {
  display: flex;
  justify-content: center;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 auto;
  width: fit-content;
}

#pattern-canvas-lock,
#pattern-canvas-setup {
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ==========================================================================
   DECOY VIEW (Duress Triggered Decoy Municipal Portal)
   ========================================================================== */
#view-decoy {
  display: none;
  background: #F8FAFC;
  min-height: 100vh;
  padding: 20px;
}

#view-decoy.active {
  display: block;
}

.decoy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 20px;
}

.btn-decoy-exit {
  padding: 6px 12px;
  background: #E2E8F0;
  color: #334155;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.decoy-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideToast 0.2s ease-out;
  min-width: 280px;
  max-width: 380px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--primary); }
.toast.info { border-left: 4px solid var(--info); }

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

/* Desktop Keyboard Shortcuts Bar */
.desktop-shortcuts-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.shortcut-kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Mobile Bottom Navigation (Hidden on desktop) */
.bottom-nav {
  display: none;
}

/* ==========================================================================
   OFFICIAL CITIZEN MEDICAL & EMERGENCY PROFILE
   ========================================================================== */
.profile-id-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   OFFICIAL GOVERNMENT PLATFORM FOOTER
   ========================================================================== */
.gov-footer {
  background: #0B132B;
  color: #CBD5E1;
  border-top: 1px solid #1E293B;
  margin-top: 48px;
  padding: 48px 0 24px;
}

.gov-footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.gov-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1.2fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #1E293B;
}

.gov-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.gov-footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.2);
  color: #EF4444;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.gov-footer-title {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.gov-footer-sub {
  font-size: 11.5px;
  color: #94A3B8;
  font-weight: 500;
}

.gov-footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #94A3B8;
  margin-bottom: 16px;
}

.gov-trust-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #38BDF8;
  font-weight: 600;
}

.gov-footer-heading {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.gov-footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gov-footer-link {
  font-size: 13px;
  color: #94A3B8;
  transition: color var(--transition-fast);
  display: block;
  line-height: 1.4;
}

.gov-footer-link strong {
  color: #FFFFFF;
}

.gov-footer-link:hover {
  color: #38BDF8;
}

.gov-footer-card {
  background: #141E33;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gov-protocol-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.gov-protocol-item strong {
  display: block;
  color: #FFFFFF;
  font-size: 12.5px;
  margin-bottom: 2px;
}

.gov-protocol-item p {
  font-size: 11.5px;
  color: #94A3B8;
  line-height: 1.45;
}

.gov-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
  margin-top: 4px;
}

.gov-dot-blue {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3B82F6;
  flex-shrink: 0;
  margin-top: 4px;
}

.gov-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 12px;
  color: #64748B;
  flex-wrap: wrap;
  gap: 12px;
}

.gov-footer-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gov-footer-badge {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  background: #141E33;
  border: 1px solid #1E293B;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Mobile Floating Quick 112 Call */
.floating-quick-112 {
  display: none;
}

/* ==========================================================================
   ACCESSIBILITY: HIGH CONTRAST & FONT SCALING
   ========================================================================== */
body.high-contrast {
  --bg-primary: #000000 !important;
  --bg: #000000 !important;
  --bg-surface: #0A0A0A !important;
  --bg-surface-elevated: #141414 !important;
  --bg-surface-soft: #1A1A1A !important;
  --bg-surface-hover: #262626 !important;
  --text-primary: #FFFFFF !important;
  --text: #FFFFFF !important;
  --text-secondary: #E5E5E5 !important;
  --text-muted: #D4D4D4 !important;
  --border: #FFFFFF !important;
  --border-subtle: #D4D4D4 !important;
  --border-strong: #FFFFFF !important;
  --color-sos: #FF1F1F !important;
  --color-safe: #00E676 !important;
  --color-whatsapp: #00E676 !important;
  --color-sms: #00B0FF !important;
  --color-warning: #FFD600 !important;
  background-color: #000000 !important;
  color: #FFFFFF !important;
}

body.high-contrast * {
  box-shadow: none !important;
}

body.high-contrast .btn-sos-main {
  background: #FF0000 !important;
  border: 6px solid #FFFFFF !important;
  color: #FFFFFF !important;
}

body.high-contrast .emergency-hotlines-card,
body.high-contrast .gps-status-card,
body.high-contrast .journey-card,
body.high-contrast .sos-hero,
body.high-contrast .modal-sheet,
body.high-contrast .gov-footer {
  border: 2px solid #FFFFFF !important;
}

body.font-large {
  font-size: 17px !important;
}
body.font-large .brand-name {
  font-size: 19px !important;
}
body.font-large .sos-text {
  font-size: 34px !important;
}
body.font-large .btn-action-title {
  font-size: 16px !important;
}
body.font-large .hotline-num {
  font-size: 20px !important;
}

body.font-xlarge {
  font-size: 19px !important;
}
body.font-xlarge .brand-name {
  font-size: 22px !important;
}
body.font-xlarge .sos-text {
  font-size: 36px !important;
}
body.font-xlarge .btn-action-title {
  font-size: 18px !important;
}
body.font-xlarge .hotline-num {
  font-size: 22px !important;
}

/* ==========================================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE SYSTEM
   ========================================================================== */

/* TABLETS (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .desktop-sos-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 20px;
  }
  .desktop-contacts-grid {
    grid-template-columns: 1.1fr 0.9fr !important;
    gap: 20px;
  }
  .desktop-journey-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
  }
  .app-content {
    padding: 20px 18px 48px;
  }
  .gov-footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px;
  }
}

/* SMARTPHONES & MOBILE (max-width: 860px) */
@media (max-width: 860px) {
  .desktop-nav,
  .desktop-shortcuts-bar {
    display: none !important;
  }

  .floating-quick-112 {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    right: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 95;
    background: #DC2626;
    color: #FFFFFF;
    padding: 7px 13px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    border: 2px solid #FFFFFF;
    text-decoration: none;
    transition: transform 0.15s ease;
  }
  .floating-quick-112:active {
    transform: scale(0.95);
  }

  .quick-112-badge {
    background: #FFFFFF;
    color: #DC2626;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
  }

  .desktop-sos-grid,
  .desktop-journey-grid,
  .desktop-map-grid,
  .desktop-contacts-grid,
  .desktop-tools-grid,
  .desktop-security-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .tool-card:nth-child(4) {
    grid-column: span 1;
  }

  .map-wrap {
    height: 380px;
  }

  .app-content {
    padding: 14px 14px calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    height: 58px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 16px;
  }

  /* Sticky Bottom Navigation with Safe Area */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(16, 24, 40, 0.04);
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    min-width: 48px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    min-height: 48px;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .nav-item.active {
    color: var(--text-primary);
    font-weight: 600;
  }

  .nav-item-sos {
    position: relative;
    top: -12px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(217, 45, 32, 0.35);
    border: 4px solid var(--bg-surface);
  }

  .nav-item-sos svg {
    width: 24px;
    height: 24px;
  }

  .nav-item-sos.active {
    background: var(--color-sos-dark);
  }

  .toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    left: 14px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  .gov-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }
}

/* COMPACT SMARTPHONES (< 480px, e.g. iPhone SE) */
@media (max-width: 480px) {
  .gov-top-ticker {
    display: none !important;
  }

  .gov-top-bar-inner {
    padding: 4px 12px;
  }

  .btn-sos-main {
    width: 164px;
    height: 164px;
    border-width: 6px;
  }

  .sos-text {
    font-size: 28px;
  }

  .sos-subtext {
    font-size: 9.5px;
  }

  .dispatch-actions-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-sheet {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ==========================================================================
   PATTERN LOCK FEATURE TEMPORARILY DISABLED
   ========================================================================== */
#pattern-lock-overlay,
#pattern-setup-modal,
[data-tab="security"],
#view-security {
  display: none !important;
}

