/* ==========================================================================
   GoldenTime Care - Ultra-Clean Mobile Responsive Design System
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #0f172a;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;

  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0b1120;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   Header & Location Bar
   ========================================================================== */

.app-header {
  background-color: var(--bg-header);
  color: var(--text-light);
  padding: calc(var(--safe-top) + 14px) 16px 14px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-pulse {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.logo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.header-source-pill {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.header-source-pill:hover,
.header-source-pill:active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-0.5px);
}

.btn-pill-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-pill-action:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* Location Bar (Unified with Radius Dropdown) */
.location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  margin-bottom: 12px;
  gap: 8px;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.loc-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.loc-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-arrow {
  font-size: 0.72rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.loc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.radius-select-badge {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radius-select-badge:hover,
.radius-select-badge:focus-within {
  background: rgba(37, 99, 235, 0.4);
  border-color: #60a5fa;
}

.radius-select-badge select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 700;
  padding-right: 14px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.radius-select-badge select option {
  background: #1e293b;
  color: #ffffff;
}

.badge-arrow {
  position: absolute;
  right: 6px;
  font-size: 0.65rem;
  color: #93c5fa;
  pointer-events: none;
}

.btn-refresh {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease, transform 0.3s ease;
}

.btn-refresh:active {
  color: #ffffff;
  transform: rotate(180deg);
}

/* Quick Filter Pills */
.quick-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-pill .pill-icon {
  font-size: 0.9rem;
}

.filter-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Content & Summary Banner
   ========================================================================== */

.app-main {
  flex: 1;
  padding: 14px 16px 16px 16px;
}

.live-summary-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.summary-icon {
  font-size: 1.1rem;
}

.summary-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.summary-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ==========================================================================
   Facility Cards
   ========================================================================== */

.facilities-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-facility {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-facility:active {
  transform: scale(0.995);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.facility-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.tag-night {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.tag-moonlight {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.tag-pediatric {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.facility-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.facility-distance {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  background: var(--primary-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* Status & Bed Widget */
.status-widget-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #edf2f7;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.status-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.status-pill-badge.green {
  background: var(--success-bg);
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-pill-badge.yellow {
  background: var(--warning-bg);
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill-badge.red {
  background: var(--danger-bg);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.bed-status-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.bed-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.bed-pill.green {
  background: #d1fae5;
  color: #065f46;
}

.bed-pill.yellow {
  background: #fef3c7;
  color: #92400e;
}

.facility-notice {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}

.facility-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Action Buttons (2-Tap Big Buttons) */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-action-call,
.btn-action-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px; /* 48px touch target */
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-call {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.btn-action-call:active {
  background: #1d4ed8;
  transform: scale(0.97);
}

.btn-action-map {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-light);
}

.btn-action-map:active {
  background: #e2e8f0;
  transform: scale(0.97);
}

/* Loading & Empty State */
.loading-state,
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 14px auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Modals (Bottom Sheet)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(var(--safe-bottom) + 24px) 20px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* Preset Location Grid */
.preset-location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preset-loc-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.preset-loc-btn:hover,
.preset-loc-btn:active {
  background: var(--primary-light);
  border-color: #bfdbfe;
}

.preset-loc-btn .name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.preset-loc-btn .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Drug Helper Items */
.drug-notice-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #1e40af;
  line-height: 1.4;
  margin-bottom: 14px;
}

.drug-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drug-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drug-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drug-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
}

.drug-ingredient {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.drug-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.drug-badge.shortage {
  background: #fee2e2;
  color: #b91c1c;
}

.drug-badge.warning {
  background: #fef3c7;
  color: #b45309;
}

.drug-generics {
  font-size: 0.78rem;
  background: #ffffff;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  color: #475569;
}

.drug-generics strong {
  color: #2563eb;
}

.btn-drug-inquiry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.btn-drug-inquiry:active {
  background: #059669;
}

/* Call Guide Sheet */
.call-guide-sheet {
  text-align: center;
  padding-top: 24px;
}

.guide-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

#guide-target-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 6px;
  margin-bottom: 16px;
}

.call-guide-script-box {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.script-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.script-bubble {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}

.call-guide-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-call-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #10b981;
  color: #ffffff;
  text-decoration: none;
  min-height: 52px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-call-confirm:active {
  background: #059669;
}

.btn-cancel {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
}

/* ==========================================================================
   Service Tabs Switcher
   ========================================================================== */
.service-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 10px 14px 4px 14px;
  gap: 4px;
}

.service-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.service-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Floating Action Button (FAB): Map / List Switcher
   ========================================================================== */
.fab-container {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  pointer-events: none;
}

.btn-floating-view {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35), 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-floating-view:hover {
  background: #1e293b;
  transform: scale(1.03);
}

.btn-floating-view:active {
  transform: scale(0.96);
  background: #334155;
}

.btn-floating-view .toggle-icon {
  font-size: 1.05rem;
}

.btn-floating-view .toggle-text {
  letter-spacing: -0.3px;
}

/* ==========================================================================
   Leaflet Interactive Map Container
   ========================================================================== */
.map-view-container {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  z-index: 10;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.4;
}

.map-popup-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.map-popup-status {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.map-popup-status.green { color: #059669; }
.map-popup-status.yellow { color: #d97706; }
.map-popup-status.red { color: #dc2626; }

.map-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.map-popup-btn {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.map-popup-btn.call {
  background: #2563eb;
  color: #ffffff;
}

.map-popup-btn.route {
  background: #f1f5f9;
  color: #1e293b;
}

/* ==========================================================================
   Non-payment Section & Cards
   ========================================================================== */
.nonpay-filter-scroll {
  display: flex;
  gap: 8px;
  padding: 6px 14px 12px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nonpay-filter-scroll::-webkit-scrollbar {
  display: none;
}

.nonpay-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.nonpay-pill.active {
  background: #8b5cf6;
  border-color: #a78bfa;
  color: #ffffff;
}

.nonpay-summary-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  font-size: 0.86rem;
  color: #334155;
}

.nonpay-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nonpay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.nonpay-item-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.nonpay-hosp-name {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

.nonpay-price-badge {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2563eb;
  text-align: right;
}

.nonpay-price-badge .unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

.nonpay-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px dashed #f1f5f9;
  padding-top: 8px;
}

.nonpay-save-badge {
  background: #ecfdf5;
  color: #059669;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
}

/* ==========================================================================
   Data Source & Legal Disclaimer Bar (Top Header)
   ========================================================================== */
.disclaimer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 4px 14px 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.disclaimer-bar:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.disclaimer-bar-content {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.disclaimer-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.disclaimer-text {
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.disclaimer-badge-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #93c5fd;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  flex-shrink: 0;
  cursor: pointer;
  margin-left: 6px;
}

/* ==========================================================================
   Disclaimer Modal & Sheet
   ========================================================================== */
.disclaimer-modal-sheet {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.disclaimer-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.disclaimer-source-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px;
}

.disclaimer-source-card h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.source-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.source-list li {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #475569;
  padding-left: 12px;
  position: relative;
}

.source-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-weight: bold;
}

.source-list strong {
  color: #1e293b;
  font-weight: 700;
}

.source-list span {
  font-size: 0.74rem;
  color: #64748b;
}

.disclaimer-warning-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 14px;
}

.disclaimer-warning-box h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 8px;
}

.warning-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.warning-list li {
  font-size: 0.78rem;
  color: #78350f;
  line-height: 1.45;
}

.warning-list strong {
  color: #b45309;
  font-weight: 800;
}

.btn-disclaimer-confirm {
  width: 100%;
  min-height: 48px;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.btn-disclaimer-confirm:active {
  background: #334155;
}

/* ==========================================================================
   Bottom Footer (Solid Block Mobile Layout)
   ========================================================================== */
.app-footer {
  margin-top: auto;
  width: 100%;
  padding: 28px 16px calc(var(--safe-bottom) + 84px) 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.footer-inner {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.footer-sources-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.source-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.footer-notice {
  font-size: 0.73rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
  text-align: center;
  word-break: keep-all;
}

.footer-notice strong {
  color: #b45309;
  font-weight: 700;
}

.footer-legal-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.footer-legal-btn:active {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(0.98);
}

.footer-legal-btn .chevron {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1;
}

.footer-copy {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 2px;
}


