/* Seguridad: pantalla de una columna (paso 5 del rediseño). Estilos acotados a .safety-ref. */
.safety-ref {
  --sr-bg: #0F0D17; --sr-surface: #17141F; --sr-surface-2: #1D1927; --sr-surface-3: #25202F;
  --sr-border: rgba(205, 178, 226, .14); --sr-border-soft: rgba(194, 165, 216, .10);
  --sr-text: #F7F3FB; --sr-muted: #A197AA; --sr-purple: #7C3AED; --sr-purple-hover: #6D28D9;
  --sr-purple-light: #C48CF0; --sr-purple-soft: rgba(124, 58, 237, .16);
  --sr-green: #22C55E; --sr-amber: #F59E0B; --sr-red: #EF4444;
  --sr-ease: cubic-bezier(.22, 1, .36, 1);
  --violet: #8b5cf6; --violet-dark: #7c3aed;
  color: var(--sr-text);
  font-family: inherit;
}
.safety-ref *, .safety-ref *::before, .safety-ref *::after { box-sizing: border-box; }
.safety-ref button, .safety-ref input { font: inherit; }
.safety-ref button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.safety-ref h1, .safety-ref h2, .safety-ref p, .safety-ref ul, .safety-ref dl, .safety-ref dd { margin: 0; padding: 0; }
.safety-ref ul { list-style: none; }

body.safety-reference .main-content { padding: 0; }
.safety-ref .sr-col { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px 28px; }
@media (min-width: 768px) { .safety-ref .sr-col { padding-top: 12px; } }

.safety-ref .mobile-state { display: none; }
.safety-ref .mobile-state.is-visible { display: block; }
.safety-ref .mobile-state > * + * { margin-top: 20px; }
.safety-ref[data-view="contacts"] .sr-common { display: none; }
.safety-ref .sr-common { margin-top: 24px; display: grid; gap: 24px; }

/* Carga */
.safety-ref .sr-skeleton { display: grid; gap: 16px; padding-top: 18px; }
.safety-ref .sr-skeleton__bar { border-radius: 12px; background: var(--sr-surface); animation: sr-pulse 1.4s ease-in-out infinite; }
.safety-ref .sr-skeleton__bar--title { width: 45%; height: 34px; }
.safety-ref .sr-skeleton__bar--card { height: 220px; }
.safety-ref .sr-skeleton__bar--row { height: 56px; }
@keyframes sr-pulse { 50% { opacity: .55; } }
.safety-ref .alert { margin-top: 16px; }

/* Encabezado */
.safety-ref .sr-header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; margin: 0 -8px 0 0; }
.safety-ref .sr-header h1 { font-size: 1.75rem; line-height: 34px; font-weight: 700; }
.safety-ref .sr-header--back { justify-content: flex-start; gap: 4px; margin-left: -8px; }
.safety-ref .sr-header--back h1 { font-size: 1.25rem; line-height: 28px; }
.safety-ref .sr-icon-btn { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--sr-text); text-decoration: none; font-size: 1.15rem; }
.safety-ref .sr-icon-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* Tarjetas */
.safety-ref .sr-card { display: grid; gap: 14px; padding: 16px; border: .5px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface); }
.safety-ref .sr-card h2, .safety-ref .sr-section h2 { font-size: 1.125rem; line-height: 24px; font-weight: 700; }
.safety-ref .sr-muted { color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }
.safety-ref .sr-lead { margin-top: 0; }

/* Botones */
.safety-ref .sr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-size: 1rem; font-weight: 600; color: #fff; background: transparent; transition: background .18s ease, border-color .18s ease, transform .18s var(--sr-ease), opacity .18s ease; }
.safety-ref .sr-btn:active { transform: scale(.98); }
.safety-ref .sr-btn:disabled { opacity: .6; cursor: default; }
.safety-ref .sr-btn--primary { background: var(--sr-purple); }
.safety-ref .sr-btn--primary:hover { background: var(--sr-purple-hover); }
.safety-ref .sr-btn--outline { border-color: #766B82; color: var(--sr-text); }
.safety-ref .sr-btn--outline:hover { background: rgba(255, 255, 255, .05); }
.safety-ref .sr-btn--block { width: 100%; }
.safety-ref .sr-link-btn { min-height: 44px; padding: 0 4px; border: 0; background: none; color: #A78BFA; font-size: .875rem; font-weight: 600; }
.safety-ref .sr-link-btn:hover { color: var(--sr-purple-light); }
.safety-ref .sr-link-btn--danger { color: #FCA5A5; }
.safety-ref button:focus-visible, .safety-ref a:focus-visible, .safety-ref input:focus-visible { outline: 2px solid var(--sr-purple-light); outline-offset: 2px; }
.safety-ref .sr-status { min-height: 0; color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }
.safety-ref .sr-status:empty { display: none; }
.safety-ref .sr-status[data-tone="error"] { color: #FCA5A5; }

/* Destino */
.safety-ref .sr-dest { display: flex; gap: 8px; align-items: stretch; }
.safety-ref .sr-dest__field { position: relative; flex: 1; min-width: 0; }
.safety-ref .sr-dest__shell { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface-2); color: var(--sr-muted); }
.safety-ref .sr-dest__shell:focus-within { border-color: var(--sr-purple-light); }
.safety-ref .sr-dest__shell.is-selected { color: var(--sr-purple-light); }
.safety-ref .sr-dest__input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: var(--sr-text); font-size: 1rem; outline: none; }
.safety-ref .sr-dest__input:focus-visible { outline: none; }
.safety-ref .sr-dest__input::placeholder { color: var(--sr-muted); }
.safety-ref .sr-dest__toggle { flex: none; width: 48px; border: 1px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface-2); color: var(--sr-muted); }
.safety-ref .sr-dest__toggle[aria-pressed="true"] { border-color: var(--sr-purple-light); background: var(--sr-purple-soft); color: var(--sr-purple-light); }
.safety-ref .destination-status-box { border-radius: 10px; }
.safety-ref .destination-helper { display: flex; align-items: flex-start; gap: 8px; color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }
.safety-ref .destination-status-box[data-theme="selected"] .destination-helper, .safety-ref .destination-status-box[data-theme="no-destination"] .destination-helper { color: var(--sr-purple-light); }
.safety-ref .destination-search-results { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface-3); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.safety-ref .destination-search-results[hidden] { display: none; }
.safety-ref .destination-search-results__head { padding: 10px 14px 6px; color: var(--sr-muted); font-size: .75rem; }
.safety-ref .destination-search-results__list { max-height: 260px; overflow-y: auto; }
.safety-ref .destination-search-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; border: 0; border-top: .5px solid var(--sr-border-soft); background: transparent; color: var(--sr-text); text-align: left; }
.safety-ref .destination-search-item:hover, .safety-ref .destination-search-item.is-active { background: var(--sr-purple-soft); }
.safety-ref .destination-search-item__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sr-surface-2); color: var(--sr-purple-light); }
.safety-ref .destination-search-item__copy { min-width: 0; }
.safety-ref .destination-search-item__title { font-size: .9375rem; font-weight: 600; }
.safety-ref .destination-search-item__meta { overflow: hidden; color: var(--sr-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.safety-ref .destination-search-empty { padding: 14px; color: var(--sr-muted); font-size: .875rem; }

/* Tiempo estimado */
.safety-ref .sr-eta { display: flex; flex-wrap: wrap; gap: 8px; }
.safety-ref .sr-pill { min-height: 44px; padding: 0 16px; border: 1px solid var(--sr-border); border-radius: 22px; background: transparent; color: var(--sr-text); font-size: .875rem; font-weight: 600; }
.safety-ref .sr-pill.is-active { border-color: var(--sr-purple-light); background: var(--sr-purple-soft); color: #fff; }

/* Trayecto en curso */
.safety-ref .sr-trip-card { padding: 0; gap: 0; overflow: hidden; }
.safety-ref .sr-trip-card__map { position: relative; height: 168px; background: #161320; }
.safety-ref .sr-live-map { position: absolute; inset: 0; }
.safety-ref .sr-live-map .leaflet-container { width: 100%; height: 100%; background: #161320; font: inherit; }
.safety-ref .sr-live-map .leaflet-tile-pane { filter: brightness(.84) saturate(.68) contrast(1.04); }
.safety-ref .sr-live-map .leaflet-control-attribution { font-size: 10px; background: rgba(15, 12, 22, .85); color: var(--sr-muted); }
.safety-ref .sr-live-map .leaflet-control-zoom { display: none; }
.safety-ref .sr-chip { position: absolute; z-index: 500; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: rgba(18, 16, 28, .9); font-size: .8125rem; font-weight: 600; }
.safety-ref .sr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sr-green); }
.safety-ref .sr-trip-card__body { display: grid; gap: 12px; padding: 12px 16px 16px; }
.safety-ref .sr-trip-card__body h2 { overflow-wrap: anywhere; }
.safety-ref .sr-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .875rem; line-height: 20px; }
.safety-ref .sr-facts dt { color: var(--sr-muted); }
.safety-ref .sr-facts dd { font-weight: 600; }
.safety-ref .sr-facts dd[data-tone="warn"] { color: var(--sr-amber); }
.safety-ref .sr-actions { display: flex; gap: 8px; }
.safety-ref .sr-actions .sr-btn--primary { flex: 1; }

/* Contactos */
.safety-ref .sr-section__head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.safety-ref .sr-people { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 4px; }
.safety-ref .sr-person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; padding: 0; border: 0; background: none; color: var(--sr-text); }
.safety-ref .sr-person__name { max-width: 100%; overflow: hidden; font-size: .8125rem; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.safety-ref .sr-person__avatar { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0; border: 0; border-radius: 50%; font-size: 1.125rem; font-weight: 700; color: #fff; }
.safety-ref .sr-person__avatar--add { border: 1.5px dashed #766B82; background: none; color: #A78BFA; font-size: 1rem; }
.safety-ref .avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; }
.safety-ref .avatar--violet { background: #4A2F5C; }
.safety-ref .avatar--rose { background: #5C2F45; }
.safety-ref .avatar--amber { background: #4A3A2F; }
.safety-ref .avatar--emerald { background: #2F4A5C; }
.safety-ref .sr-contact-list { display: grid; gap: 8px; }
.safety-ref .sr-contact-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px 14px; border: .5px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface); }
.safety-ref .contact-avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
.safety-ref .contact-avatar { width: 44px; height: 44px; font-size: 1rem; }
.safety-ref .sr-contact-card__name { font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.safety-ref .sr-contact-card__meta { color: var(--sr-muted); font-size: .8125rem; overflow-wrap: anywhere; }
.safety-ref .sr-contact-card__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.safety-ref .favorite-btn { position: relative; flex: none; width: 44px; height: 44px; margin-right: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.safety-ref .favorite-btn__outline, .safety-ref .favorite-btn__fill { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .18s ease, transform .18s ease; }
.safety-ref .favorite-btn__outline { color: var(--sr-muted); }
.safety-ref .favorite-btn__fill { color: var(--sr-amber); opacity: 0; transform: scale(.55); }
.safety-ref .favorite-btn.is-favorite .favorite-btn__outline { opacity: 0; }
.safety-ref .favorite-btn.is-favorite .favorite-btn__fill { opacity: 1; transform: scale(1); }
.safety-ref .sr-empty, .safety-ref .contact-list-empty { padding: 16px 0; color: var(--sr-muted); font-size: .875rem; }

/* Historial */
.safety-ref .sr-trips { margin-top: 4px; }
.safety-ref .sr-trip { border-top: .5px solid var(--sr-border-soft); }
.safety-ref .sr-trip__button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0; border: 0; background: none; color: var(--sr-text); text-align: left; }
.safety-ref .sr-trip__button:hover .sr-trip__title { color: var(--sr-purple-light); }
.safety-ref .sr-trip__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sr-surface-3); color: #A78BFA; font-size: .875rem; }
.safety-ref .sr-trip__copy { flex: 1; min-width: 0; display: grid; }
.safety-ref .sr-trip__title { font-size: .9375rem; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.safety-ref .sr-trip__meta { color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }
.safety-ref .sr-trip__status { flex: none; color: var(--sr-muted); font-size: .8125rem; }
.safety-ref .sr-trip__status--warn { color: var(--sr-amber); }
.safety-ref .sr-note { display: flex; gap: 8px; color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }

/* Ventanas */
.safety-ref .contact-modal-backdrop, .safety-ref .confirm-modal-backdrop, .safety-ref .summary-modal-backdrop { --summary-modal-top: 50%; --summary-modal-left: 50%; position: fixed; inset: 0; z-index: 3200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 6, 14, .72); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 260ms ease, visibility 0s linear 260ms; }
.safety-ref .contact-modal-backdrop.is-visible, .safety-ref .confirm-modal-backdrop.is-visible, .safety-ref .summary-modal-backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 260ms ease, visibility 0s linear 0s; }
.safety-ref .is-visible.is-closing { pointer-events: none; }
.safety-ref .contact-modal, .safety-ref .confirm-modal, .safety-ref .summary-modal { position: relative; display: grid; gap: 16px; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; border: .5px solid var(--sr-border); border-radius: 16px; background: var(--sr-surface); box-shadow: 0 28px 60px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(14px) scale(.98); transition: opacity 320ms var(--sr-ease), transform 320ms var(--sr-ease); }
.safety-ref .confirm-modal { width: min(440px, 100%); }
.safety-ref .is-visible > .contact-modal, .safety-ref .is-visible > .confirm-modal, .safety-ref .is-visible > .summary-modal { opacity: 1; transform: none; }
.safety-ref .is-visible.is-closing > .contact-modal, .safety-ref .is-visible.is-closing > .confirm-modal, .safety-ref .is-visible.is-closing > .summary-modal { opacity: 0; transform: translateY(10px) scale(.99); }
.safety-ref .summary-modal__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.safety-ref .section-label { margin: 0 0 4px; color: var(--sr-purple-light); font-size: .75rem; font-weight: 600; }
.safety-ref .summary-modal__title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 24px; overflow-wrap: anywhere; }
.safety-ref .summary-modal__meta, .safety-ref .summary-modal__body { color: var(--sr-muted); font-size: .875rem; line-height: 20px; }
.safety-ref .topbar-btn { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; border: 0; border-radius: 12px; background: transparent; color: var(--sr-text); }
.safety-ref .summary-modal__metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.safety-ref .summary-modal__metric { padding: 10px 12px; border: .5px solid var(--sr-border-soft); border-radius: 10px; background: var(--sr-surface-2); }
.safety-ref .summary-modal__metric-label { color: var(--sr-muted); font-size: .75rem; }
.safety-ref .summary-modal__metric-value { margin-top: 2px; font-size: .9375rem; font-weight: 600; }
.safety-ref .summary-route-map { position: relative; height: 220px; overflow: hidden; border: .5px solid var(--sr-border); border-radius: 12px; background: #161320; }
.safety-ref .summary-route-live-map .leaflet-tile-pane { filter: brightness(.84) saturate(.68) contrast(1.04); }
.safety-ref .contact-form { display: grid; gap: 14px; }
.safety-ref .contact-field { display: grid; gap: 6px; }
.safety-ref .contact-field label { color: var(--sr-muted); font-size: .8125rem; font-weight: 600; }
.safety-ref .contact-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--sr-border); border-radius: 12px; background: var(--sr-surface-2); color: var(--sr-text); font-size: 1rem; }
.safety-ref .contact-field input:focus { border-color: var(--sr-purple-light); outline: none; }
.safety-ref .avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.safety-ref .avatar-picker__option { width: 44px; height: 44px; border: 2px solid transparent; border-radius: 50%; color: #fff; font-size: .8125rem; font-weight: 700; }
.safety-ref .avatar-picker__option.is-active { outline: 2px solid var(--sr-purple-light); outline-offset: 2px; }
.safety-ref .contact-modal__actions, .safety-ref .confirm-modal__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.safety-ref .primary-btn, .safety-ref .neutral-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-size: 1rem; font-weight: 600; color: #fff; }
.safety-ref .primary-btn { flex: 1; background: var(--sr-purple); }
.safety-ref .primary-btn:hover { background: var(--sr-purple-hover); }
.safety-ref #contactDeleteConfirm { background: #DC2626; }
.safety-ref #contactDeleteConfirm:hover { background: #B91C1C; }
.safety-ref .neutral-btn { border-color: #766B82; background: transparent; color: var(--sr-text); }
body.violeta-backdrop-open { overflow: hidden; }

/* Emergencia */
.safety-ref a.sr-btn, .safety-ref a.sr-call, .safety-ref a.sr-row-link { text-decoration: none; }
.safety-ref .sr-header--bar { min-height: 56px; margin: 0 -8px 0 -12px; border-bottom: .5px solid var(--sr-border-soft); }
.safety-ref .sr-header--bar h1 { font-size: 1.125rem; line-height: 24px; }
.safety-ref .sr-emergency__body { display: grid; gap: 20px; padding-top: 20px; }
.safety-ref .sr-emergency__title { font-size: 1.75rem; line-height: 34px; font-weight: 700; }
.safety-ref .sr-emergency__lead { margin-top: 6px; color: var(--sr-muted); font-size: .9375rem; line-height: 22px; }
.safety-ref .sr-call { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 80px; border-radius: 16px; background: #E54861; color: #fff; font-size: 1.375rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); transition: background .18s ease, transform .18s var(--sr-ease); }
.safety-ref .sr-call i { font-size: 1.5rem; }
.safety-ref .sr-call:hover { background: #D43B54; color: #fff; }
.safety-ref .sr-call:active { transform: scale(.985); }
.safety-ref .sr-emergency__copy { margin-top: 4px; font-size: .875rem; line-height: 20px; }
.safety-ref .sr-emergency__people { display: flex; align-items: center; gap: 8px; min-width: 0; }
.safety-ref .sr-emergency__avatar { flex: none; width: 36px; height: 36px; font-size: .9375rem; }
.safety-ref .sr-emergency__names { margin-left: 4px; font-size: .875rem; overflow-wrap: anywhere; }
.safety-ref .sr-emergency__confirm { display: grid; gap: 10px; padding: 12px; border: .5px solid var(--sr-border); border-radius: 10px; background: var(--sr-surface-2); }
.safety-ref .sr-emergency__confirm[hidden] { display: none; }
.safety-ref .sr-emergency__confirm p { font-size: .9375rem; font-weight: 600; }
.safety-ref .sr-emergency__confirm .sr-actions .sr-btn { flex: 1; }
.safety-ref #emergencyStatus[data-tone="ok"] { color: #4ADE80; }
.safety-ref #emergencyStatus[data-tone="warn"] { color: #FBBF24; }
.safety-ref #emergencyStatus[data-tone="error"] { color: #FCA5A5; }
.safety-ref #emergencyStatus p { margin: 8px 0 12px; }
.safety-ref .sr-emergency__others { margin-bottom: 4px; font-size: 1rem; line-height: 22px; font-weight: 700; }
.safety-ref .sr-row-link { display: flex; align-items: center; gap: 12px; min-height: 60px; border-top: .5px solid var(--sr-border-soft); color: var(--sr-text); }
.safety-ref .sr-row-link:hover .sr-row-link__copy strong { color: var(--sr-purple-light); }
.safety-ref .sr-row-link__copy { flex: 1; display: grid; }
.safety-ref .sr-row-link__copy strong { font-size: .9375rem; font-weight: 600; line-height: 20px; }
.safety-ref .sr-row-link__copy span { color: var(--sr-muted); font-size: .8125rem; line-height: 18px; }
.safety-ref .sr-row-link i { color: var(--sr-muted); font-size: .875rem; }

@media (prefers-reduced-motion: reduce) {
  .safety-ref *, .safety-ref *::before, .safety-ref *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 420px) {
  .safety-ref .summary-modal__metrics { grid-template-columns: 1fr; }
}

/* Marcadores y mapas reutilizados */
.safety-ref .summary-route-live-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.safety-ref .summary-route-live-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: transparent;
  font: inherit;
}

.safety-ref .summary-route-live-map .leaflet-control-zoom {
  display: none;
}
.safety-ref .summary-route-live-map .leaflet-control-attribution { font-size: 10px; background: rgba(15, 12, 22, .85); color: var(--sr-muted); }
.safety-ref .leaflet-control-attribution a { color: var(--sr-purple-light); }

.safety-ref .summary-route-live-map .leaflet-tile-pane {
  filter: brightness(.84) saturate(.68) contrast(1.04);
}

.safety-ref .summary-route-status {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 16, 28, .9);
  border: 1px solid rgba(139, 92, 246, 0.14);
  color: var(--sr-muted);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(19, 17, 28, 0.08);
}

.safety-ref .summary-route-status[data-tone="success"] {
  color: #4ADE80;
}

.safety-ref .summary-route-status[data-tone="warning"] {
  color: #FBBF24;
}

.safety-ref .summary-route-status[data-tone="danger"] {
  color: #FCA5A5;
}

@keyframes safety-live-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.52);
    opacity: 0.32;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.45);
    opacity: 0.02;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.68);
    opacity: 0;
  }
}

.safety-ref .summary-route-svg,
.safety-ref .desktop-mini-map__route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.safety-ref .summary-route-base,
.safety-ref .desktop-mini-map__route-base {
  fill: none;
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safety-ref .summary-route-path,
.safety-ref .desktop-mini-map__route-path {
  fill: none;
  stroke: rgba(124, 58, 237, 0.96);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safety-ref .summary-route-path {
  stroke-dasharray: var(--route-length, 420);
  stroke-dashoffset: var(--route-length, 420);
}

.safety-ref .summary-route-path.is-animating {
  animation: summary-route-draw 2.4s ease forwards;
}

@keyframes summary-route-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.safety-ref .summary-route-marker,
.safety-ref .summary-route-dot,
.safety-ref .desktop-mini-map__dot {
  position: absolute;
  border-radius: 999px;
  z-index: 3;
  box-shadow: 0 8px 18px rgba(19, 17, 28, 0.14);
}

.safety-ref .summary-route-marker {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 3px solid var(--violet-dark);
  transform: translate(-50%, -50%);
}

.safety-ref .summary-route-marker--end {
  border-color: #ef4444;
}

.safety-ref .summary-route-dot {
  width: 16px;
  height: 16px;
  background: var(--violet);
  border: 3px solid #fff;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.safety-ref .summary-route-dot.is-visible {
  opacity: 1;
}

.safety-ref .summary-route-label {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(18, 16, 28, .9);
  border: 1px solid rgba(139, 92, 246, 0.12);
  color: var(--sr-muted);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(19, 17, 28, 0.08);
}

.safety-ref .summary-route-label--start {
  left: 14px;
  bottom: 14px;
}

.safety-ref .summary-route-label--end {
  right: 14px;
  top: 14px;
}

.safety-ref .safety-live-user-marker,
.safety-ref .safety-live-destination-marker {
  background: transparent;
  border: 0;
}

.safety-ref .safety-live-user-marker__inner,
.safety-ref .safety-live-destination-marker__inner {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
}

.safety-ref .safety-live-user-marker__pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.22);
  animation: safety-live-pulse 1.8s ease-out infinite;
}

.safety-ref .safety-live-user-marker__dot,
.safety-ref .safety-live-destination-marker__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 24px rgba(19, 17, 28, 0.18);
}

.safety-ref .safety-live-user-marker__dot {
  width: 18px;
  height: 18px;
}

/* ACTUALIZACIÓN 5 (SeguridadInicio, Seguridad, SeguridadContactos): solo la página /safety.
   Emergencia comparte este archivo y no cambia. */
#safetyRedesignPage { --s5-card: #1A1825; --s5-raised: #262335; --s5-input: #12101C; --s5-line: #766B82; --s5-muted: #A9A1B3; --s5-text: #E9E3EF; --s5-violet: #7C3AED; --s5-violet-light: #A78BFA; }
#safetyRedesignPage .sr-header { min-height: 72px; margin: 0; padding-top: 8px; }
#safetyRedesignPage .sr-header--back { min-height: 64px; }
#safetyRedesignPage .mobile-state > * + * { margin-top: 20px; }
#safetyRedesignPage .sr-card { gap: 14px; padding: 20px; border: 0; border-radius: 28px; background: var(--s5-card); }
#safetyRedesignPage .sr-card h2 { font-size: 1.25rem; line-height: 1.3; }
#safetyRedesignPage .sr-card > .sr-muted { margin-top: -10px; font-size: .9375rem; line-height: 1.5; color: var(--s5-muted); }
#safetyRedesignPage .sr-field-label { display: block; margin-bottom: 6px; color: var(--s5-text); font-size: .875rem; font-weight: 600; }

/* Destino: cápsula de 52 px */
#safetyRedesignPage .sr-dest { display: block; }
#safetyRedesignPage .sr-dest__shell { min-height: 52px; padding: 0 18px; gap: 12px; border: 1px solid var(--s5-line); border-radius: 26px; background: var(--s5-input); color: var(--s5-violet-light); }
#safetyRedesignPage .sr-dest__shell:focus-within { border-color: var(--s5-violet-light); box-shadow: inset 0 0 0 1px var(--s5-violet-light); }
#safetyRedesignPage .sr-dest__shell.is-disabled { opacity: .6; }
#safetyRedesignPage .sr-dest__input { height: 50px; color: var(--s5-text); }
#safetyRedesignPage .destination-status-box { margin-top: -6px; padding: 0 4px; }
#safetyRedesignPage .destination-helper { color: var(--s5-muted); }
#safetyRedesignPage .destination-search-results { border-radius: 22px; }

/* "Salir sin destino": interruptor con etiqueta visible (el botón conserva id, data-* y aria-pressed) */
#safetyRedesignPage .sr-dest__toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 0 6px 0 16px; border: 0; border-radius: 24px; background: var(--s5-raised); color: var(--s5-text); font-size: .9375rem; font-weight: 600; text-align: left; }
#safetyRedesignPage .sr-dest__toggle-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
#safetyRedesignPage .sr-dest__toggle-label i { width: 20px; color: var(--s5-muted); text-align: center; }
#safetyRedesignPage .sr-switch { flex: none; display: flex; align-items: center; width: 44px; height: 36px; padding: 3px; border-radius: 18px; background: #3A3550; transition: background .18s ease; }
#safetyRedesignPage .sr-switch__knob { width: 30px; height: 30px; border-radius: 50%; background: var(--s5-text); transition: transform .18s var(--sr-ease); }
#safetyRedesignPage .sr-dest__toggle[aria-pressed="true"] { border: 0; background: var(--s5-raised); color: var(--s5-text); }
#safetyRedesignPage .sr-dest__toggle[aria-pressed="true"] .sr-switch { background: var(--s5-violet); }
#safetyRedesignPage .sr-dest__toggle[aria-pressed="true"] .sr-switch__knob { transform: translateX(8px); background: #fff; }
#safetyRedesignPage .sr-dest__toggle[aria-pressed="true"] .sr-dest__toggle-label i { color: var(--s5-violet-light); }

/* Tiempo estimado: control segmentado */
#safetyRedesignPage .sr-eta { display: flex; flex-wrap: nowrap; gap: 4px; padding: 4px; border-radius: 26px; background: var(--s5-raised); }
#safetyRedesignPage .sr-pill { flex: 1; min-width: 0; min-height: 44px; padding: 0 8px; border: 0; border-radius: 22px; background: transparent; color: var(--s5-text); font-size: .9375rem; }
#safetyRedesignPage .sr-pill.is-active { border: 0; background: var(--s5-violet); color: #fff; }

/* Botones en cápsula de 52 px */
#safetyRedesignPage .sr-btn { min-height: 52px; padding: 0 24px; border: 0; border-radius: 26px; }
#safetyRedesignPage .sr-btn--outline { background: var(--s5-raised); color: var(--s5-text); }
#safetyRedesignPage .sr-btn--outline:hover { background: #2E2A42; }

/* Trayecto en curso */
#safetyRedesignPage .sr-trip-card { padding: 0; gap: 0; }
#safetyRedesignPage .sr-trip-card__map { height: 150px; }
#safetyRedesignPage .sr-chip { left: 12px; top: 12px; height: 30px; padding: 0 14px; border-radius: 15px; gap: 8px; }
#safetyRedesignPage .sr-trip-card__body { gap: 14px; padding: 18px 20px 20px; }
#safetyRedesignPage .sr-trip-card__body .sr-muted { margin-top: 4px; font-size: .875rem; line-height: 1.5; color: var(--s5-muted); }
#safetyRedesignPage .sr-facts { grid-template-columns: 76px 1fr; gap: 10px 12px; font-size: .9375rem; line-height: 1.45; }
#safetyRedesignPage .sr-facts dt { font-size: .875rem; color: var(--s5-muted); }

/* Contactos de confianza */
#safetyRedesignPage .sr-section__head { min-height: 40px; padding: 0 4px; }
#safetyRedesignPage .sr-section h2 { font-size: 1.125rem; line-height: 1.35; }
#safetyRedesignPage .sr-link-btn { font-size: .9375rem; }
#safetyRedesignPage .sr-people { padding: 4px 4px 0; }
#safetyRedesignPage .sr-person__avatar { width: 56px; height: 56px; }
#safetyRedesignPage .sr-lead { padding: 0 4px; font-size: .9375rem; line-height: 1.5; color: var(--s5-muted); }
#safetyRedesignPage .sr-contact-list { gap: 10px; }
#safetyRedesignPage .sr-contact-card { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; border: 0; border-radius: 28px; background: var(--s5-card); }
#safetyRedesignPage .sr-contact-card__top { display: flex; align-items: center; gap: 14px; }
#safetyRedesignPage .contact-avatar { width: 56px; height: 56px; font-size: 1.125rem; }
#safetyRedesignPage .sr-contact-card__copy { flex: 1; min-width: 0; }
#safetyRedesignPage .sr-contact-card__name { font-size: 1.0625rem; line-height: 1.35; }
#safetyRedesignPage .sr-contact-card__meta { font-size: .875rem; line-height: 1.45; color: var(--s5-muted); }
#safetyRedesignPage .favorite-btn { margin: 0; background: var(--s5-raised); }
#safetyRedesignPage .favorite-btn.is-favorite { background: rgba(245, 158, 11, .16); }
#safetyRedesignPage .sr-contact-card__actions { display: flex; gap: 8px; }
#safetyRedesignPage .sr-capsule-btn { flex: 1; min-height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: var(--s5-raised); color: var(--s5-text); font-size: .9375rem; font-weight: 600; }
#safetyRedesignPage .sr-capsule-btn:hover { background: #2E2A42; }
#safetyRedesignPage .sr-capsule-btn--danger { background: rgba(239, 68, 68, .12); color: #FCA5A5; }
#safetyRedesignPage .sr-capsule-btn--danger:hover { background: rgba(239, 68, 68, .2); }

/* Trayectos anteriores: filas redondeadas */
#safetyRedesignPage .sr-trips { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
#safetyRedesignPage .sr-trip { border-top: 0; }
#safetyRedesignPage .sr-trip__button { min-height: 64px; padding: 8px 10px; border-radius: 22px; }
#safetyRedesignPage .sr-trip__button:hover { background: var(--s5-raised); }
#safetyRedesignPage .sr-trip__button:hover .sr-trip__title { color: var(--s5-text); }
#safetyRedesignPage .sr-trip__icon { width: 44px; height: 44px; background: var(--s5-raised); color: var(--s5-violet-light); font-size: 1rem; }
#safetyRedesignPage .sr-trip__title { font-size: 1rem; line-height: 1.35; }
#safetyRedesignPage .sr-trip__meta { color: var(--s5-muted); }
#safetyRedesignPage .sr-trip__status { color: var(--s5-muted); }
#safetyRedesignPage .sr-trip__status--warn { color: #F59E0B; }
#safetyRedesignPage .sr-note { padding: 0 8px; color: var(--s5-muted); line-height: 1.5; }

/* Modales de la página: esquinas de 28 px y botones en cápsula */
#safetyRedesignPage .contact-modal, #safetyRedesignPage .confirm-modal, #safetyRedesignPage .summary-modal { border: 0; border-radius: 28px; background: var(--s5-card); }
#safetyRedesignPage .primary-btn, #safetyRedesignPage .neutral-btn { min-height: 52px; border-radius: 26px; }
#safetyRedesignPage .neutral-btn { border: 0; background: var(--s5-raised); }
/* Mapa del resumen: el aviso de estado no tapa la etiqueta "Destino" (arriba a la derecha) */
#safetyRedesignPage .summary-route-status { max-width: calc(100% - 128px); border-radius: 16px; line-height: 1.35; }
#safetyRedesignPage .contact-field input { min-height: 52px; border-color: var(--s5-line); border-radius: 26px; background: var(--s5-input); }

/* Orden en móvil: estado, contactos, historial y nota beta (la nota vive en .sr-main para escritorio) */
#safetyRedesignPage .sr-layout { display: flex; flex-direction: column; }
#safetyRedesignPage .sr-main { display: contents; }
#safetyRedesignPage .sr-main > .mobile-state { order: 0; }
#safetyRedesignPage .sr-aside { order: 1; }
#safetyRedesignPage .sr-main > .sr-note { order: 2; margin-top: 24px; }
#safetyRedesignPage[data-view="contacts"] .sr-main > .sr-note { display: none; }

/* Escritorio (SeguridadEscritorio, SeguridadEscritorioInicio): columna principal y columna derecha */
@media (min-width: 1024px) {
  #safetyRedesignPage .sr-layout { display: grid; grid-template-columns: minmax(0, 680px) minmax(280px, 360px); justify-content: center; align-items: start; column-gap: 24px; max-width: 1080px; padding: 20px 32px 48px; }
  #safetyRedesignPage .sr-main { display: block; grid-column: 1; min-width: 0; }
  #safetyRedesignPage .sr-main > .sr-note { margin-top: 16px; }
  #safetyRedesignPage .sr-aside { grid-column: 2; margin-top: 92px; gap: 16px; }
  #safetyRedesignPage .sr-aside .sr-section { padding: 20px 20px 22px; border-radius: 28px; background: var(--s5-card); }
  #safetyRedesignPage .sr-aside .sr-section[aria-labelledby="srHistoryTitle"] { padding: 20px 12px 12px; }
  #safetyRedesignPage .sr-aside .sr-section[aria-labelledby="srHistoryTitle"] h2 { margin: 0 8px; }
  #safetyRedesignPage .sr-aside .sr-section h2 { font-size: 1.0625rem; }
  #safetyRedesignPage .sr-header { min-height: 72px; padding-top: 0; }
  #safetyRedesignPage .sr-card { padding: 28px; gap: 18px; }
  #safetyRedesignPage .sr-card h2 { font-size: 1.375rem; }
  #safetyRedesignPage .sr-trip-card { padding: 0; gap: 0; }
  #safetyRedesignPage .sr-trip-card__map { height: 260px; }
  #safetyRedesignPage .sr-chip { left: 16px; top: 16px; height: 32px; padding: 0 16px; border-radius: 16px; font-size: .875rem; }
  #safetyRedesignPage .sr-trip-card__body { gap: 16px; padding: 22px 28px 28px; }
  #safetyRedesignPage .sr-facts { grid-template-columns: 84px 1fr; font-size: 1rem; line-height: 1.5; }
  #safetyRedesignPage .sr-actions { gap: 10px; }
  #safetyRedesignPage .sr-actions .sr-btn--outline { padding: 0 32px; }
}

/* Personas bloqueadas y silenciadas */
#safetyRedesignPage .sr-blocked > .sr-muted { margin: 4px 4px 8px; font-size: .875rem; line-height: 1.45; color: var(--s5-muted); }
#safetyRedesignPage .sr-blocked__list { display: flex; flex-direction: column; gap: 2px; }
#safetyRedesignPage .sr-blocked__row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 10px; border-radius: 22px; }
#safetyRedesignPage .sr-blocked__avatar { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--s5-raised); color: var(--s5-muted); font-weight: 700; }
#safetyRedesignPage .sr-blocked__copy { display: grid; flex: 1; min-width: 0; }
#safetyRedesignPage .sr-blocked__name { overflow: hidden; font-size: 1rem; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
#safetyRedesignPage .sr-blocked__state { color: var(--s5-muted); font-size: .8125rem; line-height: 1.4; }
#safetyRedesignPage .sr-blocked__action { flex: none; min-width: 120px; }
#safetyRedesignPage .sr-blocked__action:disabled { opacity: .6; cursor: default; }
#safetyRedesignPage .sr-blocked [hidden] { display: none; }
@media (min-width: 1024px) {
  #safetyRedesignPage .sr-aside .sr-blocked { padding: 20px 12px 12px; }
  #safetyRedesignPage .sr-aside .sr-blocked h2, #safetyRedesignPage .sr-aside .sr-blocked > p { margin-left: 8px; margin-right: 8px; }
}
