/*
 * assets/css/fds-sos.css — 3.50.20 · the roles release (🔒 Paul, 26 Oct)
 * The red phone, the two-step panel, the service row, card and pages.
 * Mock-ups: FDS_MOCKUP_EMERGENCY_HELP_PANEL_v3 · …_BUTTON_PLACEMENT_v1 (④).
 *
 * WITHOUT JAVASCRIPT the button is a link to #fds-sos: the panel opens on
 * :target with BOTH screens stacked (the chooser and the back arrows are for
 * the script), so 000 and 132 500 are always one tap from the map.
 * WITH JAVASCRIPT (html.fds-sos-js) the panel is [data-step]: 1 = the chooser,
 * emergency | help = that screen.
 */
:root {
  --sos-red: #B91C1C; --sos-red2: #FEF2F2; --sos-redline: #FECACA;
  --sos-blue: #1D4ED8; --sos-ink: #1F4D2E; --sos-g: #2C5D3A; --sos-muted: #4A5568; --sos-line: #EEF1EA;
}

/* ── E1 · the button: a white phone on red, no words, 44 px ─────────────── */
.fds-sos-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; box-sizing: border-box;
  border-radius: 50%; background: var(--sos-red); color: #fff; border: 0; text-decoration: none;
  box-shadow: 0 4px 12px rgba(127, 29, 29, .35); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.fds-sos-btn:hover { background: #991B1B; }
.fds-sos-btn:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 3px; }
.fds-sos-btn svg { display: block; }

/* E2 (option ④) · Just a Map: bottom-left, opposite locate. BOTH round buttons sit
   88 px up (was 76): a 24 px clear gap over the 64 px dock (Paul). Above an open card
   the script lifts both, keeping the gap. The list sheet and the category panel cover
   it; back to the map shows it again (accepted). */
.fds-sos-btn--justamap { position: absolute; left: 12px; bottom: calc(var(--jm-safe-bottom, 0px) + 88px); z-index: 1000; transition: bottom .2s ease; }

/* E8 · the other maps: beside "Full map". Without the script, top-right of the map box. */
.fds-map-container { position: relative; }
.fds-map-container > .fds-sos-btn--map { position: absolute; top: 10px; right: 10px; z-index: 800; }
.leaflet-control.fds-sos-ctl { clear: none !important; margin-top: 10px; margin-right: 8px; background: none; border: 0; box-shadow: none; }
.leaflet-control.fds-sos-ctl .fds-sos-btn { position: static; }

/* ── the panel ─────────────────────────────────────────────────────────── */
.fds-sos { display: none; position: fixed; inset: 0; z-index: 100000; background: rgba(17, 24, 39, .35); }
.fds-sos:target, .fds-sos.is-open { display: block; }
.fds-sos.is-peek { display: none !important; }
.fds-sos__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 56px; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .25);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px); font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #2D3748;
}
.fds-sos__screen { display: block; }
.fds-sos__screen + .fds-sos__screen { border-top: 6px solid #F3F4EF; }
/* without the script: no chooser, no back arrows (both screens stacked) */
html:not(.fds-sos-js) .fds-sos__screen--choose,
html:not(.fds-sos-js) .fds-sos__back { display: none; }
/* with the script: one screen at a time */
.fds-sos-js .fds-sos[data-step] .fds-sos__screen { display: none; }
.fds-sos-js .fds-sos[data-step="1"] .fds-sos__screen--choose,
.fds-sos-js .fds-sos[data-step="emergency"] .fds-sos__screen--e,
.fds-sos-js .fds-sos[data-step="help"] .fds-sos__screen--h { display: block; border-top: 0; }
.fds-sos-js .fds-sos[data-step="1"] .fds-sos__sheet { top: auto; max-height: calc(100% - 56px); }

.fds-sos__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px; background: #fff; border-bottom: 1px solid #F3D4D4; }
.fds-sos__screen--choose .fds-sos__head { border-bottom: 0; }
.fds-sos__head strong { flex: 1; font-family: Fraunces, Georgia, serif; font-size: 19px; color: var(--sos-red); }
.fds-sos__screen--choose .fds-sos__head strong { color: var(--sos-ink); }
.fds-sos__head--h { border-bottom-color: #BFDBFE; }
.fds-sos__head--h strong { color: var(--sos-blue); }
.fds-sos__back {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: #F3F4F6; color: var(--sos-ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none;
}
.fds-sos__back:focus-visible, .fds-sos__choice:focus-visible, .fds-sos a:focus-visible, .fds-sos button:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }

/* step 1: two big buttons */
.fds-sos__choices { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.fds-sos__choice {
  display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 16px 18px; border-radius: 18px; border: 0;
  color: #fff; text-align: left; font: inherit; cursor: pointer; width: 100%;
}
.fds-sos__choice--e { background: var(--sos-red); }
.fds-sos__choice--h { background: var(--sos-blue); }
.fds-sos__choice b { font-size: 22px; display: block; }
.fds-sos__choice span span { font-size: 14px; }
.fds-sos__ci { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 26px; font-weight: 800; }

/* step 2 */
.fds-sos__body { padding: 0 0 16px; }
.fds-sos__call0, .fds-sos__call1 { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.fds-sos__call0 { margin: 12px 16px 8px; padding: 16px; border-radius: 16px; background: var(--sos-red); color: #fff; min-height: 72px; }
.fds-sos__call0 b { font-size: 30px; letter-spacing: .5px; line-height: 1.1; }
.fds-sos__call0 span span, .fds-sos__call1 span span { font-size: 13px; display: block; }
.fds-sos__call1 { margin: 0 16px 10px; padding: 12px 16px; border-radius: 14px; background: #FFF7ED; border: 1.5px solid #FDBA74; color: #7C2D12; min-height: 56px; }
.fds-sos__call1 b { font-size: 18px; }
.fds-sos__ph { margin-left: auto; font-size: 24px; }
.fds-sos__grp { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sos-muted); padding: 12px 16px 4px; margin: 0; font-family: inherit; }
.fds-sos__line { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--sos-line); }
.fds-sos__lt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fds-sos__ln { font-size: 15px; font-weight: 600; color: #1F2937; text-decoration: none; overflow-wrap: anywhere; }
.fds-sos__lm { font-size: 12.5px; color: var(--sos-muted); }
.fds-sos__tel {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--sos-g); color: var(--sos-ink); font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; background: #fff;
}
.fds-sos__lnk { font: inherit; font-size: 13px; font-weight: 600; color: var(--sos-g); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; min-height: 24px; }
.fds-sos__ed { margin: 4px 16px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #E2E8F0; display: flex; flex-direction: column; gap: 2px; }
.fds-sos__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fds-sos__btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--sos-g); background: #fff; color: var(--sos-ink); font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.fds-sos__btn--solid { background: var(--sos-g); color: #fff; }
.fds-sos__warn { font-size: 12.5px; color: #7C2D12; background: #FFF7ED; border-radius: 8px; padding: 4px 8px; margin-top: 4px; display: inline-block; align-self: flex-start; }
.fds-sos__tog { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 16px; padding: 10px 14px; border-radius: 12px; background: #F8FAF6; border: 1px solid #E2E8F0; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.fds-sos__tog[hidden] { display: none; }
.fds-sos__tog small { display: block; font-weight: 400; font-size: 12.5px; color: var(--sos-muted); }
.fds-sos__sw { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #CBD5E0; position: relative; flex-shrink: 0; margin: 0; cursor: pointer; }
.fds-sos__sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s ease; }
.fds-sos__sw:checked { background: var(--sos-g); }
.fds-sos__sw:checked::after { left: 21px; }
.fds-sos__empty, .fds-sos__note { padding: 8px 16px; font-size: 13px; color: var(--sos-muted); margin: 0; }
.fds-sos__banner, .fds-svc-banner { margin: 12px 16px; padding: 10px 14px; border-radius: 12px; background: var(--sos-red2); border: 1px solid var(--sos-redline); color: #7F1D1D; font-size: 14px; }
.fds-sos__banner a, .fds-svc-banner a { color: inherit; }

/* "Emergency services on · ×" — the map with the pins, the panel set aside */
.fds-sos-chip { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 112px); z-index: 99999; display: inline-flex; align-items: center; border-radius: 999px; background: var(--sos-red); color: #fff; box-shadow: 0 4px 12px rgba(127, 29, 29, .35); font: 600 14px/1 Inter, -apple-system, sans-serif; }
.fds-sos-chip[hidden] { display: none; }
.fds-sos-chip button { background: none; border: 0; color: inherit; font: inherit; min-height: 40px; padding: 0 12px; cursor: pointer; }
.fds-sos-chip button + button { border-left: 1px solid rgba(255, 255, 255, .35); font-size: 18px; }

/* an emergency pin (E3): red, with its symbol; its card has no status */
.fds-sos-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--sos-red); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); display: flex; align-items: center; justify-content: center; }
.fds-sos-pin span { transform: rotate(45deg); font-size: 14px; line-height: 1; }

/* ── frame F · the search group ────────────────────────────────────────── */
.fds-svc-group { margin: 0 0 16px; border: 1px solid var(--sos-redline); border-radius: 14px; overflow: hidden; background: #fff; }
.fds-svc-group__h { margin: 0; padding: 10px 16px 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sos-red); font-family: inherit; }
.fds-svc-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--sos-line); }
.fds-svc-row__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sos-red); flex-shrink: 0; }
.fds-svc-row--helpline .fds-svc-row__dot { background: var(--sos-blue); }
.fds-svc-row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fds-svc-row__n { font-weight: 600; color: #1F2937; text-decoration: none; }
.fds-svc-row__m { font-size: 13px; color: var(--sos-muted); }
.fds-svc-row__tel { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--sos-red); color: var(--sos-red); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }

/* ── E7 · the pages (frames G and H) ───────────────────────────────────── */
.fds-svc-page__in { max-width: 640px; padding-top: 8px; padding-bottom: 32px; }
.fds-svc-page__bar { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--sos-line); margin-bottom: 14px; }
.fds-svc-page__bar span { font-size: 14px; font-weight: 600; color: var(--sos-muted); }
.fds-svc-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--sos-redline); background: var(--sos-red2); color: var(--sos-red); }
.fds-svc-tag--h { color: #1E40AF; background: #EFF6FF; border-color: #BFDBFE; }
.fds-svc-page__h { font-family: Fraunces, Georgia, serif; color: var(--sos-ink); font-size: 26px; margin: 8px 0 4px; }
.fds-svc-page__m { margin: 2px 0; color: var(--sos-muted); font-size: 15px; }
.fds-svc-page__about { font-size: 15px; margin: 10px 0 4px; }
.fds-svc-page .fds-svc-banner, .fds-svc-page .fds-sos__banner { margin: 14px 0; }
.fds-svc-call { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 12px 0; border-radius: 999px; background: var(--sos-g); color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.fds-svc-page__map { margin: 12px 0; border-radius: 14px; overflow: hidden; }
.fds-svc-page__acts { display: flex; flex-wrap: wrap; gap: 8px; }

@media (prefers-reduced-motion: reduce) { .fds-sos-btn--justamap, .fds-sos__sw::after { transition: none; } }
.fds-svc-minimap { height: 220px; background: #E9ECE3; }
