/* ── SOS Rescue — Flat white / red design system ── */

:root {
  --red: #E11D2E;
  --red-dark: #B91C1C;
  --red-soft: #FFF5F5;
  --red-muted: #FEE2E2;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --text: #0A0A0A;
  --muted: #737373;
  --muted-2: #A3A3A3;
  --green: #16A34A;
  --green-soft: #F0FDF4;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Prompt", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

html {
  height: -webkit-fill-available;
}

body {
  min-height: -webkit-fill-available;
}

/* ── Icons ── */
.hgi-stroke {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}
.icon-sm { font-size: 16px; }
.icon-md { font-size: 22px; }
.icon-lg { font-size: 28px; }

.icon-btn .hgi-stroke,
.quick-icon .hgi-stroke,
.bottom-nav .hgi-stroke,
.btn-line .hgi-stroke { display: inline-block; line-height: 1; }
.icon-btn .hgi-stroke { font-size: 20px; }
.quick-icon .hgi-stroke { font-size: 22px; }
.bottom-nav .hgi-stroke { font-size: 22px; }
.btn-line .hgi-stroke { font-size: 22px; }

/* ── Shell ── */
.app-shell {
  width: 100%;
  max-width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background: var(--surface);
  position: relative;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-left: max(0px, var(--safe-left));
  padding-right: max(0px, var(--safe-right));
  box-sizing: border-box;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.app-main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.app-main--status {
  padding-bottom: 0;
}

.app-main--home {
  padding-bottom: calc(88px + var(--safe-bottom));
}

.app-main--hospitals,
.app-main--profile {
  padding-bottom: calc(88px + var(--safe-bottom));
}

.app-main--login {
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* ── Layout helpers ── */
.page-section { padding: 0 20px; }
.page-section--top { padding-top: 4px; }
.page-section--bottom { padding-bottom: 32px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-muted-sm { font-size: 13px; color: var(--muted); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.hidden { display: none !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-10 { margin-bottom: 40px; }
.-mt-2 { margin-top: -8px; }
.w-full { width: 100%; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.leading-snug { line-height: 1.35; }
.opacity-50 { opacity: .5; }
.underline { text-decoration: underline; }

/* ── Icon button ── */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

/* ── Cards ── */
.card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 16px;
}

.card--white {
  background: var(--surface);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  padding: 6px max(8px, var(--safe-right)) calc(8px + var(--safe-bottom)) max(8px, var(--safe-left));
  border-top: 1px solid #F0F0F0;
  z-index: 30;
  box-sizing: border-box;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted-2);
  padding: 10px 0;
  border-radius: 16px;
  text-decoration: none;
  transition: color .15s, background .15s;
}

.bottom-nav a.active {
  color: var(--red);
  font-weight: 600;
  background: var(--red-soft);
}

/* ── SOS button ── */
.sos-button {
  position: relative;
  width: min(220px, 72vw);
  height: min(220px, 72vw);
  margin: 0 auto;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  max-width: 100%;
}

.sos-core {
  position: relative;
  z-index: 2;
  width: min(168px, 55vw);
  height: min(168px, 55vw);
  border-radius: var(--radius-full);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--red);
  transition: transform .12s ease, background .12s ease;
}

.sos-button:active .sos-core {
  transform: scale(.96);
  background: var(--red-dark);
}

.sos-label {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
}

.sos-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: .9;
}

.sos-rings::before,
.sos-rings::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--red);
  opacity: .25;
  animation: ring 2.4s ease-out infinite;
}

.sos-rings::after { animation-delay: 1.2s; }

@keyframes ring {
  0% { transform: scale(.75); opacity: .35; }
  100% { transform: scale(1.15); opacity: 0; }
}

.sos-button.sending .sos-core { opacity: .75; }

/* ── Home page (clean shell; SOS button unchanged) ── */
.hm-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px 8px;
  background: var(--surface);
}

.hm-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 18px;
  border-bottom: 1px solid #F0F0F0;
}

.hm-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
}

.hm-title {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}

.hm-avatar-link {
  flex-shrink: 0;
  margin-top: 2px;
}

.hm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.hm-sos {
  padding: 28px 0 8px;
}

.hm-sos-hint {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  word-break: keep-all;
  line-break: strict;
}

.hm-gps {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.hm-gps--warn {
  color: #B45309;
  font-weight: 500;
}

.hm-actions {
  margin-top: 8px;
  border-top: 1px solid #F0F0F0;
}

.hm-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #F0F0F0;
  text-decoration: none;
  color: var(--text);
}

.hm-link:last-child {
  border-bottom: 0;
}

.hm-link:active {
  opacity: .7;
}

.hm-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hm-link-icon--blue {
  background: #EFF6FF;
  color: #2563EB;
}

.hm-link-icon--red {
  background: var(--red-soft);
  color: var(--red);
}

.hm-link-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hm-link-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
  word-break: keep-all;
  line-break: strict;
}

.hm-link-copy span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.hm-link-chevron {
  color: #D4D4D8;
  flex-shrink: 0;
}

.hm-line-banner {
  margin-top: 8px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #b4fecb 0%, #ffffff 100%);
}

.hm-line-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.hm-line-banner-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #06C755;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.hm-line-banner-dismiss {
  border: 0;
  background: transparent;
  color: #191919;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.hm-line-banner-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #000000;
}

.hm-line-banner-text {
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.25;
  color: #3a3a3a;
}

.hm-line-banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #06C755;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hm-line-banner-btn:active {
  opacity: .85;
}

.hm-line-banner-note {
  margin: 0;
  font-size: 12px;
  color: #6B7280;
}

.hm-profile {
  margin-top: 0;
  border-top: 1px solid #F0F0F0;
}

.hm-profile-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  text-decoration: none;
  color: var(--text);
}

.hm-profile-link:active {
  opacity: .7;
}

.hm-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.hm-profile-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hm-profile-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.hm-profile-copy span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

@media (min-width: 480px) {
  .hm-page {
    padding-left: 28px;
    padding-right: 28px;
  }
}

/* ── Quick cards ── */
.quick-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}

.quick-card:active { background: var(--red-muted); }

.quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.quick-icon--blue { background: #EFF6FF; color: #2563EB; }
.quick-icon--red { background: var(--red-soft); color: var(--red); }

/* ── Buttons ── */
.btn-primary,
.btn-danger,
.btn-ghost,
.btn-call,
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  transition: opacity .12s, background .12s;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:active { background: var(--red-dark); }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:active { background: var(--red-muted); }

.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:active { background: #EBEBEB; }

.btn-call { background: var(--text); color: #fff; }
.btn-call:active { opacity: .85; }

.btn-line { background: #06C755; color: #fff; font-size: 16px; }
.btn-line:active { opacity: .9; }

.btn-line.is-disabled { opacity: .45; cursor: not-allowed; }

/* ── Form fields ── */
.field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--red-soft);
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

/* ── Status page (clean single-content) ── */
.st-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  background: var(--surface);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.st-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0 14px;
  border-bottom: 1px solid #F0F0F0;
}

.st-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
}

.st-title {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
}

.st-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.st-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-muted);
  animation: st-dot 1.4s ease-in-out infinite;
}

.st-live.is-accepted .st-live-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px #DCFCE7;
  animation: none;
}

.st-live.is-closed .st-live-dot {
  background: #A3A3A3;
  box-shadow: 0 0 0 4px #F5F5F5;
  animation: none;
}

.st-live.is-accepted { color: var(--green); }
.st-live.is-closed { color: var(--muted); }

.st-hero {
  text-align: center;
  padding: 20px 4px 18px;
  border-bottom: 1px solid #F0F0F0;
}

.st-pulse {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: var(--radius-full);
  position: relative;
  display: grid;
  place-items: center;
}

.st-pulse::before,
.st-pulse::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--red);
  opacity: .2;
  animation: st-ring 2.2s ease-out infinite;
}

.st-pulse::after {
  animation-delay: 1.1s;
}

.st-pulse-core {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--red);
  box-shadow: 0 0 0 8px var(--red-muted);
  display: grid;
  place-items: center;
  animation: st-blink 1.15s ease-in-out infinite;
}

.st-pulse-icon {
  display: none;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  position: relative;
  z-index: 1;
}

.st-hero.pending .st-pulse-icon--pending,
.st-hero.accepted .st-pulse-icon--accepted,
.st-hero.closed .st-pulse-icon--closed {
  display: inline-block;
}

.st-hero.accepted .st-pulse::before,
.st-hero.accepted .st-pulse::after {
  border-color: var(--green);
}

.st-hero.accepted .st-pulse-core {
  background: var(--green);
  box-shadow: 0 0 0 10px #DCFCE7;
}

.st-hero.closed .st-pulse::before,
.st-hero.closed .st-pulse::after {
  border-color: #A3A3A3;
  animation: none;
}

.st-hero.closed .st-pulse-core {
  background: #737373;
  box-shadow: 0 0 0 10px #F5F5F5;
  animation: none;
}

.st-hero-title {
  margin: 0 auto;
  max-width: 18em;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.45;
  color: var(--text);
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}

.st-hero-sub {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

.st-section {
  padding: 16px 0;
  border-bottom: 1px solid #F0F0F0;
}

.st-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.st-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.st-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.st-team {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.officer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 0;
  border-top: 1px solid #F5F5F5;
}

.officer-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.officer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.officer-row-body {
  min-width: 0;
  flex: 1;
}

.officer-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.officer-role,
.officer-empty {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.officer-empty {
  padding: 4px 0;
}

.officer-call-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.st-address {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -.01em;
}

.st-map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.st-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 0 4px;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.st-btn--danger {
  background: transparent;
  color: var(--red);
  min-height: 44px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.st-btn--ghost {
  background: var(--surface-2);
  color: var(--text);
}

.st-btn--ghost:active {
  background: #EBEBEB;
}

.st-btn--call {
  background: var(--text);
  color: #fff;
}

.st-btn--call:active {
  opacity: .88;
}

@keyframes st-blink {
  50% { transform: scale(.86); opacity: .72; }
}

@keyframes st-ring {
  0% { transform: scale(.55); opacity: .35; }
  100% { transform: scale(1.25); opacity: 0; }
}

@keyframes st-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

@media (min-width: 480px) {
  .st-page {
    padding: 20px 28px calc(28px + var(--safe-bottom));
  }

  .st-hero {
    padding: 24px 8px 20px;
  }
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: grid;
  place-items: end center;
  z-index: 50;
  padding: 0;
}

.modal.hidden { display: none; }

.modal-card {
  width: min(430px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px calc(24px + var(--safe-bottom));
}

.modal-card--confirm {
  text-align: center;
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.modal-icon .hgi-stroke {
  font-size: 24px;
  line-height: 1;
}

.modal-icon.danger {
  background: var(--red-soft);
  color: var(--red);
}

.modal-icon--location {
  background: #EFF6FF;
  color: #2563EB;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.modal-text {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}

.modal-text--pre {
  white-space: pre-line;
  text-align: left;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.modal-actions--single {
  grid-template-columns: 1fr;
}

/* ── User profile page ── */
.pf-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  background: var(--surface);
  min-height: 100%;
}

.pf-page--setup {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.pf-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0 18px;
  border-bottom: 1px solid #F0F0F0;
}

.pf-back {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.pf-kicker {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
}

.pf-title {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
  word-break: keep-all;
  line-break: strict;
}

.pf-top-sub {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  word-break: keep-all;
  line-break: strict;
}

.pf-form {
  display: flex;
  flex-direction: column;
}

.pf-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 0 20px;
  border-bottom: 1px solid #F0F0F0;
  text-align: center;
}

.pf-avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-2);
}

.pf-avatar-name {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.pf-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.pf-section {
  padding: 20px 0 8px;
  border-bottom: 1px solid #F0F0F0;
}

.pf-section-label {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.pf-field {
  display: block;
  margin: 0 0 14px;
}

.pf-field:last-child {
  margin-bottom: 8px;
}

.pf-field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 400;
  color: #71717A;
}

.pf-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #E8E8EA;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  appearance: none;
}

.pf-textarea {
  min-height: 72px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

.pf-input::placeholder {
  color: #A1A1AA;
  font-weight: 400;
}

.pf-input:focus {
  border-color: #18181B;
}

.pf-field-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  word-break: keep-all;
  line-break: strict;
}

.pf-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 0 4px;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.pf-btn--primary {
  background: var(--red);
  color: #fff;
}

.pf-btn--primary:active {
  background: var(--red-dark);
}

.pf-btn--ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  min-height: 42px;
  font-size: 14px;
}

@media (min-width: 480px) {
  .pf-page {
    padding-left: 28px;
    padding-right: 28px;
  }
}

/* ── Hospital page (clean list) ── */
.hp-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  background: var(--surface);
  min-height: 100%;
}

.hp-page--sos {
  min-height: 100dvh;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.hp-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0 18px;
  border-bottom: 1px solid #F0F0F0;
}

.hp-back {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.hp-kicker {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
}

.hp-title {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
}

.hp-hint {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.hp-list {
  display: flex;
  flex-direction: column;
}

.hp-row {
  padding: 18px 0;
  border-bottom: 1px solid #F0F0F0;
}

.hp-row:last-child {
  border-bottom: 0;
}

.hp-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hp-row-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.hp-rank {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin: 1px 0 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hp-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}

.hp-addr {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}

.hp-row-meta {
  flex-shrink: 0;
  text-align: right;
}

.hp-dist {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.hp-open,
.hp-closed {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
}

.hp-open { color: var(--green); }
.hp-closed { color: var(--muted); }

.hp-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-left: 40px;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  background: transparent;
}

.hp-btn--primary {
  color: var(--red);
}

.hp-btn--call {
  color: var(--text);
}

.hp-btn--disabled {
  color: var(--muted-2);
  cursor: default;
}

.hp-empty {
  margin: 24px 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  word-break: keep-all;
  line-break: strict;
}

.hp-empty--err {
  color: var(--red);
}

.hp-skel {
  height: 108px;
  margin: 12px 0;
  border-radius: 16px;
  background: linear-gradient(90deg, #F5F5F5 25%, #EFEFEF 37%, #F5F5F5 63%);
  background-size: 400% 100%;
  animation: hp-shimmer 1.2s ease infinite;
}

@keyframes hp-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (min-width: 480px) {
  .hp-page {
    padding-left: 28px;
    padding-right: 28px;
  }
}

/* legacy hospital cards (kept for safety) */
.hospital-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 16px;
}

.hospital-name {
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  font-size: 15px;
}

.hospital-addr {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.hospital-dist {
  font-weight: 800;
  color: var(--red);
  font-size: 15px;
  margin: 0;
}

.hospital-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

/* ── Toast ── */
.toast-root {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(390px, calc(100% - 24px - var(--safe-left) - var(--safe-right)));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  animation: toast-in .25s ease;
  font-size: 14px;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red-dark); }
.toast.info { background: #404040; }
.toast.sos { background: var(--red); }

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.toast-icon .hgi-stroke {
  font-size: 16px;
  line-height: 1;
}

@keyframes toast-in {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Skeleton ── */
.skeleton {
  height: 100px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--red-soft), var(--surface-2));
  background-size: 200% 100%;
  animation: shine 1.2s linear infinite;
}

@keyframes shine {
  to { background-position: -200% 0; }
}

/* ── Login page (match home SOS style) ── */
.lg-page {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: calc(20px + var(--safe-bottom));
  box-sizing: border-box;
}

.lg-head {
  text-align: center;
  padding: 12px 0 28px;
}

.lg-head-title {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
}

.lg-head-sub {
  margin: 8px auto 0;
  max-width: 260px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

.lg-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lg-brand-panel {
  padding: 36px 24px 28px;
  border-radius: 22px;
  text-align: center;
}

.lg-brand {
  position: relative;
  width: min(200px, 58vw);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  user-select: none;
  pointer-events: none;
}

.lg-brand-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lg-brand-rings::before,
.lg-brand-rings::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--red);
  opacity: .14;
  animation: ring 2.8s ease-out infinite;
}

.lg-brand-rings::after {
  inset: 0;
  animation-delay: 1.4s;
  opacity: .1;
}

.lg-brand-word {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(56px, 16vw, 72px);
  font-weight: 800;
  letter-spacing: .20em;
  line-height: 1;
  color: var(--red);
  text-indent: .16em;
}

.lg-brand-tag {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  padding-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.lg-brand-tag::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 32px;
  height: 1px;
  transform: translateX(-50%);
  background: #E5E5E5;
}

.lg-lead {
  margin: 24px auto 0;
  max-width: 280px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}

.lg-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lg-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.lg-flash .hgi-stroke {
  flex-shrink: 0;
  margin-top: 1px;
}

.lg-flash--err {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.lg-flash--warn {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.lg-flash-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lg-line-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: #06C755;
  color: #fff;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
  margin-top: -2rem;
}

.lg-line-btn:active {
  transform: scale(.985);
  opacity: .94;
}

.lg-line-btn.is-disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.lg-line-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lg-line-logo {
  width: 28px;
  height: 28px;
  display: block;
  color: #fff;
}

.lg-line-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.lg-line-btn-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.lg-line-btn-copy span {
  font-size: 12px;
  font-weight: 500;
  opacity: .88;
}

.lg-line-btn-arrow {
  flex-shrink: 0;
  opacity: .75;
}

.lg-staff {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  justify-content: center;
}

.lg-staff-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #A3A3A3;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
  background: #F5F5F5;
}

.lg-staff-link .hgi-stroke {
  font-size: 14px;
  line-height: 1;
}

.lg-staff-link:active,
.lg-staff-link:hover {
  color: #525252;
  background: #e7e7e7;
}

.lg-footer {
  margin: 20px 0 0;
  padding-top: 4px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.5;
}

.lg-login-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.alert {
  background: var(--red-soft);
  color: var(--red-dark);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

@media (min-width: 430px) {
  .lg-head {
    padding-top: 20px;
  }

  .lg-brand-panel {
    padding: 44px 32px 32px;
  }
}

/* ── Profile avatar ── */
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.profile-avatar--sm {
  width: 48px;
  height: 48px;
}

.link-muted {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
  text-decoration: none;
}

.link-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.link-map {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--red);
  text-decoration: none;
}

/* ── Install page ── */
.install-page {
  width: 100%;
  max-width: min(560px, 100%);
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.install-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  margin: 0 auto 16px;
}

.install-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.install-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 0;
}

.alert--ok {
  background: var(--green-soft);
  color: #15803d;
}

.install-form {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 24px;
}

.install-form h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.install-form h2 + h2,
.install-form .install-divider { margin-top: 20px; }

.install-field {
  display: block;
  margin-bottom: 12px;
}

.install-field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.install-field input[type="text"],
.install-field input[type="password"],
.install-field input[type="url"] {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
}

.install-field input:focus {
  outline: none;
  background: var(--red-soft);
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.install-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 8px 0 4px;
}

.install-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.install-actions a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.install-actions .btn-app { background: var(--red); color: #fff; }
.install-actions .btn-admin { background: var(--text); color: #fff; }

.install-code {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  margin-top: 8px;
}

.install-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -8px 0 12px;
  line-height: 1.45;
}

.install-code code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}
