/* ============================================
   HealthGuard AI — Design System
   品牌色: Blue (#3b82f6 → #2563eb)
   ============================================ */

/* ====== Reset & Base ====== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, 'Inter', system-ui, sans-serif;
  background: #f3f4f6;
  display: flex; justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app-root {
  width: 100%; max-width: 430px;
  min-height: 100vh;
  background: #f8fafc;
  position: relative;
  overflow-x: hidden;
}

/* ====== Page ====== */
.page { display: block; padding: 0 0 100px; min-height: 100vh; }

/* AI chat page uses fixed layout — no bottom padding, no tab bar interference */
.ai-chat-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;
}

/* ====== Page Top Bar (shared by all sub-pages) ====== */
.page-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 14px;
}
.page-top-bar-left {
  width: 36px; height: 36px; border-radius: 12px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.page-top-bar-left:active { background: #e2e8f0; }
.page-top-bar-left i { font-size: 15px; color: #374151; }

/* ====== Modal Close Button ====== */
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 10px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
}
.modal-close i { font-size: 14px; color: #6b7280; }
.modal-content { position: relative; }

/* ====== Top Bar ====== */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
  background: transparent;
  position: relative; z-index: 10;
}
.top-bar-left i, .top-bar-right i { font-size:18px; color:#1f2937; cursor:pointer; }
.top-bar-center {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; padding: 4px 10px;
  background: white; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.location-pin { font-size: 12px; color: #3b82f6; }
.city-name { font-size: 13px; font-weight: 600; color: #1f2937; }
.city-arrow { font-size: 10px; color: #9ca3af; margin-left: 2px; }

/* ====== Hero Section (compact) ====== */
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 40%, #f0f9ff 100%);
  padding: 14px 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  position: relative; overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(59,130,246,0.06);
  border-radius: 50%;
}
.hero-content { flex: 1; z-index: 1; }
.hero-title { font-size: 22px; line-height: 1.2; color: #111827; font-weight: 800; }
.title-main { }
.title-highlight { display: none; }
.hero-subtitle {
  font-size: 11px; color: #6b7280; line-height: 1.45;
  margin-top: 4px;
}
.hero-illustration {
  width: 85px; height: 85px; flex-shrink: 0; margin-left: 6px;
}
.hero-svg { width: 100%; height: 100%; }

/* ====== Action Buttons ====== */
.action-buttons { padding: 0 16px; margin-bottom: 10px; }
.action-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px; border-radius: 20px;
  cursor: pointer; transition: all 0.2s;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.action-btn:active { transform: scale(0.98); }
.action-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.action-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.action-icon-wrap {
  width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.action-icon-wrap i { font-size: 20px; color: white; }
.action-text { flex: 1; }
.action-text h3 { font-size: 16px; font-weight: 700; color: white; margin-bottom: 1px; }
.action-text p { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 500; }
.action-arrow { color: white; font-size: 16px; opacity: 0.8; }

/* ====== Disclaimer ====== */
.disclaimer-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin: 0 16px 14px;
  background: #f8fafc; border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.disclaimer-bar i { color: #94a3b8; font-size: 14px; }
.disclaimer-bar span { font-size: 11px; color: #64748b; font-weight: 500; }

/* ====== Section Header ====== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; margin-bottom: 10px;
}
.section-title-wrap { display: flex; align-items: center; gap: 6px; }
.section-emoji { font-size: 17px; }
.section-title-wrap strong { font-size: 15px; color: #1f2937; }

/* ====== Hospital Hero Card (image height halved) ====== */
.hospital-hero-card {
  margin: 0 16px 18px; background: white;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  cursor: pointer; border: 1px solid #f1f5f9;
  transition: all 0.2s;
}
.hospital-hero-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.hospital-hero-img {
  width: 100%; height: 100px;
  background-color: #e5e7eb;
  background-size: cover; background-position: center;
}
.hospital-hero-body { padding: 14px 16px 16px; }
.hosp-hero-title-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap;
}
.hosp-hero-name { font-size: 17px; font-weight: 700; color: #1f2937; line-height: 1.3; }
/* Hospital grade badge */
.hosp-grade-badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.grade-3a { background: #fef3c7; color: #d97706; }
.grade-intl { background: #dbeafe; color: #2563eb; }
.grade-3b { background: #eff6ff; color: #2563eb; }
.hosp-hero-name-cn { font-size: 12px; color: #9ca3af; margin-top: 2px; margin-bottom: 8px; }
.hosp-hero-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #6b7280; margin-bottom: 10px;
  flex-wrap: nowrap;
}
.hosp-hero-meta i { color: #f59e0b; margin-right: 3px; font-size: 11px; }
.hosp-hero-meta span { white-space: nowrap; }
.hosp-hero-meta a {
  color: #2563eb; text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; white-space: nowrap;
}
.hosp-hero-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.hosp-distance-badge {
  display: flex; align-items: center; gap: 5px;
  background: #eff6ff; border-radius: 999px;
  padding: 5px 12px 5px 7px;
}
.hosp-distance-badge i { color: #3b82f6; font-size: 12px; }
.hosp-distance-badge span { font-size: 12px; font-weight: 700; color: #3b82f6; }
.hosp-rating { display: flex; align-items: center; gap: 3px; }
.hosp-rating i { color: #f59e0b; font-size: 12px; }
.hosp-rating span { font-size: 13px; font-weight: 700; color: #1f2937; }
.hosp-rating .rating-count { font-size: 11px; color: #9ca3af; font-weight: 400; }
.hosp-hero-actions {
  display: flex; gap: 10px;
}
.btn-hosp-call {
  flex: 1; padding: 10px; border-radius: 14px;
  border: 2px solid #3b82f6; background: white;
  color: #3b82f6; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 5px;
  transition: all 0.2s;
}
.btn-hosp-call:active { background: #eff6ff; }
.btn-hosp-call i { font-size: 14px; }
.btn-hosp-navigate {
  flex: 1; padding: 10px; border-radius: 14px;
  border: none; background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 5px;
  box-shadow: 0 6px 16px rgba(37,99,235,0.25);
  transition: all 0.2s;
}
.btn-hosp-navigate:active { transform: scale(0.98); }
.btn-hosp-navigate i { font-size: 14px; }

/* ====== Health Article Card ====== */
.health-article-card {
  display: flex; align-items: center; gap: 14px;
  margin: 0 16px 14px; padding: 12px;
  background: white; border-radius: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer; border: 1px solid #f1f5f9;
  transition: all 0.2s;
}
.health-article-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.06); }
.article-thumb {
  width: 72px; height: 56px; border-radius: 12px;
  flex-shrink: 0;
}
.article-content { flex: 1; min-width: 0; position: relative; }
.article-content h4 { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.35; }
.article-content p { font-size: 11px; color: #6b7280; margin-top: 3px; line-height: 1.4; }
.article-arrow { color: #d1d5db; font-size: 12px; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }

/* ====== Emergency Modal ====== */
.emergency-option {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 14px; margin-bottom: 8px;
  background: #f8fafc; border-radius: 18px;
  cursor: pointer; transition: all 0.15s;
}
.emergency-option:active { background: #f1f5f9; transform: scale(0.98); }
.emergency-icon-wrap {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.emergency-icon-wrap i { font-size: 20px; color: white; }
.emergency-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.emergency-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.emergency-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.emergency-green { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.emergency-divider { height: 1px; background: #f1f5f9; margin: 8px 0; }

/* ====== City Picker ====== */
.city-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; margin-bottom: 6px;
  background: #f8fafc; border-radius: 14px;
  cursor: pointer; font-size: 16px; font-weight: 500; color: #1f2937;
  transition: all 0.15s;
}
.city-option:active { background: #eff6ff; }
.city-option.active { background: #eff6ff; color: #3b82f6; font-weight: 700; }
.text-brand { color: #3b82f6; font-size: 16px; }

/* ====== Tab Bar (Glass effect) ====== */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 100;
}
.tab-item {
  display:flex; flex-direction:column; align-items:center;
  color:#9ca3af; font-size:10px; cursor:pointer; padding:6px 0;
  transition: color 0.2s; position:relative;
}
.tab-item.active { color:#3b82f6; }
.tab-item i { font-size:22px; margin-bottom:3px; }
.tab-badge {
  position:absolute; top:-2px; right:-10px; background:#ef4444; color:white;
  font-size:10px; font-weight:700; min-width:18px; height:18px; line-height:18px;
  text-align:center; border-radius:9px; padding:0 5px;
  box-shadow: 0 2px 4px rgba(239,68,68,.3);
}

/* ====== Cards ====== */
.card {
  background: white; border-radius: 22px; padding: 18px;
  margin-bottom: 16px; border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.card-sm { padding: 14px; border-radius: 18px; }

/* ====== Record Card ====== */
.record-card {
  background: white; border-radius: 18px; padding: 0;
  margin-bottom: 6px; border: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  cursor: pointer; transition: all .2s;
  overflow: hidden;
}
.record-card:active { transform: scale(.98); }

/* Header row: date + hospital + chevron */
.record-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.record-card-header:active { background: #f1f5f9; }
.record-header-left {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.record-date-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #3b82f6; font-weight: 700;
  background: #eff6ff; padding: 5px 12px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.record-hospital {
  font-size: 18px; font-weight: 700; color: #1f2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Collapsed body: notes preview */
.record-card-body-collapsed {
  padding: 14px 18px;
}
.record-notes-preview {
  font-size: 13px; color: #6b7280; line-height: 1.5;
  display: block;
}

/* Expanded body: full notes */
.record-card-body-expanded {
  padding: 0 18px 16px;
}
.record-notes-full {
  padding: 14px 16px; background: #eff6ff; border-radius: 12px;
  font-size: 14px; color: #374151; line-height: 1.6;
  border-left: 3px solid #3b82f6;
}

/* ====== Buttons ====== */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white; padding: 15px 24px; border-radius: 18px;
  text-align: center; font-weight: 600; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(37,99,235,0.25);
  transition: all 0.2s;
  border: none; width: 100%; display: block;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.95; }
.btn-danger {
  background: #fef2f2; color: #dc2626; padding: 15px 24px; border-radius: 18px;
  text-align: center; font-weight: 600; font-size: 15px; cursor: pointer;
  border: none; width: 100%; display: block; transition: all 0.2s;
}
.btn-danger:active { background: #fee2e2; }

/* ====== Modals ====== */
.modal-overlay {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(0,0,0,0.45); z-index:200; display:none;
  justify-content:center; align-items:flex-end;
}
.modal-overlay.open { display:flex; }
.modal-content {
  background:white; width:100%; max-width:430px;
  border-radius: 36px 36px 0 0; padding: 28px 24px;
  max-height:82vh; overflow-y:auto;
  animation:slideUp .35s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.1);
}
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }

/* ====== Form ====== */
.input {
  width:100%; padding:14px 16px; border:1.5px solid #e5e7eb;
  border-radius:14px; margin-bottom:12px; font-size:15px; outline:none;
  box-sizing:border-box; background:#f9fafb; transition:border-color .2s;
}
.input:focus { border-color:#3b82f6; background:#fff; }
select.input { appearance:auto; }
textarea.input { resize:vertical; min-height:100px; }

/* ====== Filter Select (dropdown for hospital filters) ====== */
.filter-select {
  width: 100%; padding: 10px 14px;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; color: #4b5563;
  font-size: 13px; font-weight: 500;
  cursor: pointer; outline: none;
  appearance: auto; transition: border-color .2s;
}
.filter-select:focus { border-color: #3b82f6; background: #fff; }

/* ====== Filter Tags ====== */
.filter-tag {
  padding:9px 18px; border-radius:999px; background:#f8fafc; color:#64748b;
  font-size:13px; white-space:nowrap; cursor:pointer;
  border:1px solid #e2e8f0; display:inline-block; margin:0 5px 5px 0;
  transition:all .2s; font-weight:500;
}
.filter-tag.active { background:#3b82f6; color:white; border-color:#3b82f6; }

/* ====== Welcome Card ====== */
.welcome-card {
  background: white; border-radius: 28px; padding: 22px 20px;
  margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.03);
  border: 1px solid #f1f5f9;
}

/* ====== Quick Actions ====== */
.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:20px; }
.quick-card {
  padding: 22px 18px; border-radius: 26px; cursor: pointer;
  border: 1.5px solid; transition: all .2s;
  position: relative; overflow: hidden;
}
.quick-card:active { transform: scale(.98); }
.quick-card.ai-card { background: #eff6ff; border-color: #bfdbfe; }
.quick-card.ai-card:hover { background: #dbeafe; }
.quick-card.records-card { background: #eff6ff; border-color: #bfdbfe; }
.quick-card.records-card:hover { background: #dbeafe; }
.quick-card .icon-circle {
  width: 44px; height: 44px; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; margin-bottom: 10px;
  font-size: 20px;
}
.quick-card.ai-card .icon-circle { background: #dbeafe; color: #3b82f6; }
.quick-card.records-card .icon-circle { background: #dbeafe; color: #2563eb; }

/* ====== Hospital Card (legacy) ====== */
.hosp-card {
  background: white; border-radius: 22px; padding: 18px;
  margin-bottom: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.04);
  cursor: pointer; border: 1px solid #f1f5f9; transition: all .2s;
}
.hosp-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.hosp-header { display:flex; gap:14px; align-items:flex-start; margin-bottom:12px; }
.hosp-img {
  width: 72px; height: 72px; border-radius: 16px; flex-shrink:0;
  background: #e5e7eb; background-size: cover; background-position: center;
}
.hosp-info { flex:1; min-width:0; }
.hosp-name { font-size:16px; font-weight:700; color:#1f2937; line-height:1.3; }
.hosp-name-cn { font-size:12px; color:#9ca3af; margin-top:2px; }
.hosp-badge { display:inline-block; padding:2px 8px; border-radius:6px; font-size:11px; font-weight:600; margin-top:4px; }
.hosp-badge.grade-a { background:#fef3c7; color:#d97706; }
.hosp-badge.intl { background:#dbeafe; color:#2563eb; }
.hosp-distance { font-size:13px; color:#3b82f6; font-weight:700; white-space:nowrap; }
.hosp-details {
  border-top:1px solid #f3f4f6; padding-top:12px;
  font-size:12px; color:#6b7280; line-height:1.9;
}
.hosp-details a { color:#3b82f6; text-decoration:none; font-weight:600; }
.hosp-details a:hover { text-decoration:underline; }

/* ====== Medical ID Card (blue tone) ====== */
.med-id-card {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color:white; border-radius:22px; padding:24px; margin-bottom:18px;
  position:relative; overflow:hidden;
  box-shadow: 0 8px 24px rgba(37,99,235,.25);
}
.med-id-card::before {
  content:''; position:absolute; top:-40px; right:-40px;
  width:130px; height:130px; background:rgba(255,255,255,.12); border-radius:50%;
}
.med-id-card::after {
  content:''; position:absolute; bottom:-20px; left:-20px;
  width:80px; height:80px; background:rgba(255,255,255,.08); border-radius:50%;
}
.med-id-badge {
  font-size:10px; opacity:.8; font-weight:700; letter-spacing:1.5px;
  text-transform: uppercase;
}
.med-id-name { font-size:22px; font-weight:700; margin-top:8px; position:relative; z-index:1; }
.med-id-detail { font-size:12px; opacity:.85; margin-top:6px; position:relative; z-index:1; }

/* ====== Chat Bubbles ====== */
.msg-bubble {
  padding:14px 18px; border-radius:20px; margin-bottom:8px;
  max-width:82%; font-size:14px; line-height:1.55; word-break:break-word;
}
.msg-bubble.ai { background:#eff6ff; color:#1e3a8a; }
.msg-bubble.user {
  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:white; margin-left:auto;
}

/* ====== AI Guide Header ====== */
.ai-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 32px 24px; border-radius: 28px; margin-bottom: 16px;
  color: white; box-shadow: 0 8px 24px rgba(37,99,235,.2);
}
.ai-disclaimer {
  background: #fff7ed; border: 1px solid #fdba74; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 16px; font-size: 13px;
  display: flex; gap: 10px; color: #c2410c; line-height: 1.5;
}

/* ====== Body Area Grid ====== */
.body-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.body-card {
  background: white; border-radius: 22px; padding: 24px 16px;
  text-align: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.04); border: 1px solid #f1f5f9;
  transition: all .2s;
}
.body-card:active { transform: scale(.97); background: #eff6ff; border-color: #bfdbfe; }
.body-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.body-name { font-size: 14px; font-weight: 700; color: #1f2937; display: block; }
.body-name-cn { font-size: 11px; color: #9ca3af; margin-top: 2px; display: block; }

/* ====== Profile Menu ====== */
.menu-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  cursor: pointer; transition: opacity .15s;
}
.menu-row:active { opacity: .7; }
.menu-row + .menu-row { border-top: 1px solid #f3f4f6; }

/* ====== Notification Card ====== */
.notif-card {
  background: white; border-radius: 20px; padding: 16px 18px;
  margin-bottom: 10px; border-left: 3px solid transparent;
}
.notif-card.unread { border-left-color: #3b82f6; background: #f8faff; }

/* ====== Login ====== */
.auth-tab {
  font-size: 18px; font-weight: 500; color: #9ca3af;
  cursor: pointer; padding-bottom: 8px; border-bottom: 2px solid transparent;
  transition: all .2s;
}
.auth-tab.active { color: #3b82f6; font-weight: 700; border-bottom-color: #3b82f6; }
.btn-wechat {
  background: #f0fdf4; color: #16a34a; padding: 14px; border-radius: 16px;
  text-align: center; font-weight: 600; font-size: 15px; cursor: pointer;
}

/* ====== Utilities ====== */
.link { color: #3b82f6; font-weight: 600; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top:8px; } .mb-3 { margin-bottom:16px; } .mb-4 { margin-bottom:20px; }
.text-xs { font-size:12px; } .text-sm { font-size:13px; }
.text-muted { color: #6b7280; }
.empty-state { text-align: center; padding: 90px 0; color: #9ca3af; font-size:15px; line-height:1.8; }
.empty-state .icon { font-size: 56px; display: block; margin-bottom: 12px; }

/* ====== Emergency Help Page ====== */
.emergency-page { padding-bottom: 0; }
.emergency-banner {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 20px 16px 24px;
}
.emergency-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.emergency-number-card {
  background: rgba(255,255,255,0.2); border-radius: 12px; padding: 14px 12px;
  text-align: center; cursor: pointer; transition: all .15s;
  backdrop-filter: blur(10px); color: white;
}
.emergency-number-card:active { background: rgba(255,255,255,0.35); transform: scale(.97); }
.emergency-number-label { font-size: 11px; opacity: .9; font-weight: 600; letter-spacing: .5px; color: white; }
.emergency-number-value { font-size: 32px; font-weight: 800; margin: 4px 0; color: white; }
.emergency-number-icon { font-size: 18px; opacity: .8; margin-top: 4px; color: white; }

.emergency-section {
  background: white; margin: 12px 16px; border-radius: 18px; padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.emergency-section-title {
  font-size: 15px; font-weight: 700; color: #1f2937; margin-bottom: 14px;
}
.emergency-hospital-card {
  border: 2px solid #e3f2fd; border-radius: 14px; padding: 16px; background: #fafafa;
}
.emergency-hospital-name { font-size: 17px; font-weight: 700; color: #1976d2; margin-bottom: 4px; }
.emergency-hospital-address { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.emergency-hospital-phone { font-size: 14px; color: #dc2626; margin-bottom: 6px; }
.emergency-hospital-phone a { color: #dc2626; text-decoration: none; font-weight: 600; }
.emergency-hospital-distance { font-size: 12px; color: #3b82f6; font-weight: 600; margin-bottom: 10px; }
.emergency-hospital-actions { display: flex; gap: 8px; }
.emergency-call-big {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 10px; transition: all .15s;
  letter-spacing: .5px;
}
.emergency-call-big:active { transform: scale(.97); opacity: .9; }
.emergency-action-btn {
  flex: 1; padding: 10px; border-radius: 12px; text-align: center; font-size: 13px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; transition: all .15s;
}
.emergency-call-btn { border: 2px solid #3b82f6; color: #3b82f6; background: white; }
.emergency-call-btn:active { background: #eff6ff; }
.emergency-nav-btn { border: none; background: linear-gradient(135deg,#3b82f6,#2563eb); color: white; }
.emergency-nav-btn:active { transform: scale(.97); }

.emergency-phrase-card {
  background: #f8fafc; padding: 12px 14px; border-radius: 10px; margin-bottom: 8px;
  border-left: 3px solid #3b82f6;
}
.emergency-phrase-en { font-size: 14px; font-weight: 600; color: #333; line-height: 1.4; }

.emergency-doc-item {
  display: flex; align-items: center; gap: 10px; padding: 12px; background: #fffef5;
  border-radius: 10px; margin-bottom: 8px;
}
.emergency-doc-icon { font-size: 24px; }
.emergency-doc-text { font-size: 13px; color: #374151; font-weight: 500; }

/* ====== Typing Indicator ====== */
.typing-indicator span {
  width: 8px; height: 8px; border-radius: 50%; background: #3b82f6;
  display: inline-block; margin-right: 4px;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ====== Progress Bar ====== */
.progress-bar {
  width: 100%; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.3s ease; border-radius: 2px;
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 0; }

/* ====== AI Chat Page Styles ====== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.welcome-message {
  text-align: center;
  padding: 8px 20px 4px;
}
.welcome-icon {
  margin-bottom: 6px;
}
.welcome-icon svg {
  filter: drop-shadow(0 2px 8px rgba(59,130,246,0.3));
}
.welcome-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
  line-height: 1.3;
}
.welcome-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 0;
  line-height: 1.3;
}
.welcome-hint {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.3;
  margin-top: 1px;
}
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.message-row.user {
  flex-direction: row-reverse;
}
.message-row .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
}
.message-row.user .msg-bubble {
  margin-left: auto;
}
.msg-bubble {
  max-width: calc(100% - 44px);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.msg-bubble.ai {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #dbeafe;
}
.msg-bubble.user {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}
.input-area {
  flex-shrink: 0;
  padding: 10px 16px 16px;
  background: white;
  border-top: 1px solid #f1f5f9;
}
.chip-group-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 4px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid transparent;
  display: inline-block;
  user-select: none;
}
.chip:active {
  transform: scale(0.95);
  opacity: 0.8;
}
.chip-duration {
  background: #eff6ff;
  color: #3b82f6;
  border-color: #bfdbfe;
}
.chip-severity {
  border-color: transparent;
}
.chip-low {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.chip-mid {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.chip-high {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.chip-symptom {
  background: #eff6ff;
  color: #3b82f6;
  border-color: #bfdbfe;
}
.chat-input {
  resize: none;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  min-height: 120px;
  max-height: 180px;
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #e5e7eb;
  background: #f8fafc;
  font-family: inherit;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.chat-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
}
.send-btn {
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  cursor: default;
  background: #e5e7eb;
  color: #9ca3af;
  transition: all 0.2s;
  gap: 8px;
}
.send-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.send-btn.active:active {
  transform: scale(0.98);
}
.send-btn i {
  font-size: 16px;
}
.progress-bar-wrap {
  padding: 0 16px;
  flex-shrink: 0;
}

/* ====== AI Diagnosis Result ====== */
.result-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  background: white;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.result-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: white;
}
.result-btn:active { transform: scale(0.96); }
.result-hospital {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 3px 10px rgba(37,99,235,0.25);
}
.result-card {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 3px 10px rgba(20,184,166,0.25);
}
.result-new {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}



