/* ── Emergency Contacts Section ─────────────────────────── */

/* Header — red theme (urgency) */
.em-header {
  position: relative;
  background: linear-gradient(135deg, #C62828 0%, #8E1B1B 100%);
  color: #fff;
  /* side padding clears the fixed ☰ (left) and ↻ (right) buttons */
  padding: 18px 60px 18px;
  text-align: center;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.em-header-ta {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}
.em-header-en {
  font-size: 0.82rem;
  opacity: 0.9;
  margin: 4px 0 0;
}
.em-header-note {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}
.em-refresh-btn {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.em-refresh-btn.spinning { animation: em-spin 0.5s linear; }
@keyframes em-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ── Category PANEL — one white card per category, rows inside ──
   --cat / --cat-tint are set inline per category (red medical, blue
   police, orange fire, amber power, purple other). */
.em-panel {
  margin: 14px 12px 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(20, 30, 70, 0.07);
  overflow: hidden;
}
.em-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--cat-tint, #F5F5F5);
  border-bottom: 2px solid var(--cat, #5E35B1);
}
.em-panel-ic {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.em-panel-titles { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.em-panel-ta {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #1A1A1A;
  line-height: 1.15;
}
.em-panel-en { font-size: 0.7rem; color: #757575; }
.em-panel-count {
  flex-shrink: 0;
  min-width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--cat, #5E35B1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
}

/* Rows inside the panel — whole row is the call link */
.em-rows { display: flex; flex-direction: column; }
.em-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  border-bottom: 1px solid #F2F2F4;
  -webkit-tap-highlight-color: transparent;
}
.em-row:last-child { border-bottom: none; }
.em-row:active { background: var(--cat-tint, #F7F7F7); }
.em-row-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.em-row-ta {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.3;
}
.em-row-en {
  font-size: 0.72rem;
  color: #8A8A8E;
  margin-top: 1px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.em-row-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.em-row-phone {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--cat, #C62828);
  letter-spacing: 0.3px;
}
.em-row-call {
  background: #16A34A;
  color: #fff;
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.em-badge {
  font-size: 0.6rem;
  padding: 1px 7px;
  border-radius: 7px;
  font-weight: 700;
  font-family: 'Noto Sans Tamil', sans-serif;
}
.em-badge-nat { background: #E3F2FD; color: #1565C0; }

/* Empty / spacer at bottom so last card clears the nav bar */
.em-empty {
  text-align: center;
  padding: 48px 24px;
  color: #888;
}
.em-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.em-empty-ta { font-family: 'Noto Sans Tamil', sans-serif; font-size: 1.05rem; font-weight: 600; margin: 0; }
.em-empty-en { font-size: 0.8rem; margin: 4px 0 0; }

#section-emergency { padding-bottom: 90px; }

/* ── About sheet — village stats grid (ported from APK) ──── */
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.about-stat {
  background: #F7F7F7;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.about-stat-emoji { font-size: 1.4rem; }
.about-stat-val {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1A1A1A;
  margin-top: 4px;
}
.about-stat-label {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.78rem;
  color: #666;
  margin-top: 2px;
}
.about-cardamom {
  margin-top: 14px;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  border-radius: 12px;
  padding: 14px;
}
.about-cardamom-title {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #2E7D32;
  margin: 0;
}
.about-cardamom-en { font-size: 0.74rem; color: #757575; margin: 2px 0 8px; }
.about-cardamom-text {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  margin: 0;
}
.about-disclaimer {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFFDE7 100%);
  border: 1px solid #F0D58A;
  border-radius: 12px;
  padding: 14px;
}
.about-disclaimer-title {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  color: #8A6D00;
  margin: 0 0 6px;
}
.about-disclaimer-en {
  font-family: 'Roboto', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: #A98A2C;
  margin-left: 6px;
}
.about-disclaimer-text {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.88rem;
  color: #5C4A12;
  line-height: 1.55;
  margin: 0;
}

/* About sheet — device id (for admin stats labelling) */
.about-device-id {
  font-family: var(--font-latin);
  font-size: 0.72rem;
  color: var(--color-muted);
  text-align: center;
  margin: 0;
}
.about-device-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  background: rgba(0,0,0,0.05);
  padding: 2px 7px;
  border-radius: 6px;
  user-select: all;
  -webkit-user-select: all;
}
