/* ===================================================
   TotoHub — Design System v2
   Font: Poppins | Max-width: 500px | Mobile-first
   =================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* ==================== CSS VARIABLES ==================== */
:root {
  --primary: #5BB8F5;
  --primary-dark: #3A9AE0;
  --primary-soft: rgba(91,184,245,0.12);
  --secondary: #FF9EB5;
  --success: #3FAD72;
  --danger: #ef4444;
  --warning: #F5C842;
  --text: #1C1C2E;
  --text-light: #8E8E93;
  --bg: #F2F4F7;
  --card: #ffffff;
  --border: #E5E9F0;
  --mom: #FF9EB5;
  --dad: #5BB8F5;
  --dark-bg: #0E0E1A;
  --dark-card: #1A1A2E;
  --dark-text: #F0F0F7;
  --dark-text-light: #8E8E9A;
  --dark-border: #2A2A3E;
  --app-max-width: 500px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: 70px;
  --header-bg: linear-gradient(135deg, #5BB8F5, #3A9AE0);
  --nav-bg: #ffffff;
  --nav-active: #5BB8F5;
  --nav-inactive: #8E8E93;
  --radius-card: 24px;
  --radius-btn: 50px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-float: 0 8px 24px rgba(0,0,0,0.10);
}

/* ==================== THEME OVERRIDES ==================== */
[data-theme="default"] {
  --primary: #5BB8F5;
  --primary-dark: #3A9AE0;
  --primary-soft: rgba(91,184,245,0.12);
  --bg: #F0F6FF;
  --border: #D8E8F8;
  --header-bg: linear-gradient(135deg, #5BB8F5, #3A9AE0);
  --nav-active: #5BB8F5;
}

[data-theme="lilac"] {
  --primary: #B78FE8;
  --primary-dark: #9A6ED4;
  --primary-soft: rgba(183,143,232,0.12);
  --mom: #B78FE8;
  --bg: #F7F0FF;
  --border: #E8D8F8;
  --header-bg: linear-gradient(135deg, #B78FE8, #9A6ED4);
  --nav-active: #B78FE8;
}

[data-theme="yellow"] {
  --primary: #F5C842;
  --primary-dark: #D4A820;
  --primary-soft: rgba(245,200,66,0.12);
  --bg: #FFFBEC;
  --border: #F0E8C0;
  --text: #2C2410;
  --header-bg: linear-gradient(135deg, #F5C842, #D4A820);
  --nav-active: #A67C00;
}

[data-theme="purple"] {
  --primary: #7C5CBF;
  --primary-dark: #5E3FA3;
  --primary-soft: rgba(124,92,191,0.12);
  --dad: #7C5CBF;
  --bg: #F2EEFF;
  --border: #D8CCF0;
  --header-bg: linear-gradient(135deg, #7C5CBF, #5E3FA3);
  --nav-active: #7C5CBF;
}

[data-theme="sunset"] {
  --primary: #F0855A;
  --primary-dark: #D4623A;
  --primary-soft: rgba(240,133,90,0.12);
  --mom: #F0855A;
  --bg: #FFF4EE;
  --border: #F0DDD0;
  --header-bg: linear-gradient(135deg, #F0855A, #D4623A);
  --nav-active: #F0855A;
}

[data-theme="forest"] {
  --primary: #3FAD72;
  --primary-dark: #2A8A58;
  --primary-soft: rgba(63,173,114,0.12);
  --dad: #3FAD72;
  --bg: #EDFBF4;
  --border: #C8EADA;
  --header-bg: linear-gradient(135deg, #3FAD72, #2A8A58);
  --nav-active: #3FAD72;
}

/* ==================== DARK MODE ==================== */
body.dark-mode {
  --bg: var(--dark-bg);
  --card: var(--dark-card);
  --text: var(--dark-text);
  --text-light: var(--dark-text-light);
  --border: var(--dark-border);
}

/* ==================== BASE ==================== */
html {
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  transition: background-color 0.3s, color 0.3s;
  font-size: 0.9rem;
  line-height: 1.4;
}

h1, h2, h3 { font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p, li { font-size: 0.9rem; line-height: 1.4; }
.meta-text, .family-code-label, .ad-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ==================== ONBOARDING ==================== */
.onboarding-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onboarding-card {
  background: white;
  border-radius: 32px;
  padding: 32px;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.onboarding-logo {
  display: block;
  height: 130px;
  width: auto;
  max-width: 320px;
  margin: 0 auto 28px;
  object-fit: contain;
  animation: fadeIn 0.5s ease;
}
body.dark-mode .onboarding-logo {
  background: white;
  border-radius: 16px;
  padding: 10px 20px;
}

.onboarding-step { display: none; animation: fadeIn 0.3s; }
.onboarding-step.active { display: block; }

.step-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary);
}
.step-subtitle { color: var(--text-light); margin-bottom: 24px; font-size: 0.88rem; }

.step-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 4px;
  background: var(--border);
  transition: all 0.3s;
}
.step-dot.active { width: 24px; background: var(--primary); }
.step-dot.completed { background: var(--success); }

/* Role selector — skin-tone icon circles */
.role-selector { display: flex; gap: 15px; margin: 20px 0; }
.role-card {
  flex: 1;
  padding: 20px 12px;
  border-radius: 20px;
  border: 2px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}
.role-card.mum.selected { border-color: var(--mom); background: rgba(255,158,181,0.08); }
.role-card.dad.selected { border-color: var(--dad); background: var(--primary-soft); }

.role-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(186,143,98,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.role-icon-circle .role-emoji {
  font-size: 40px;
  line-height: 1;
}

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.88rem;
}
.form-control {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 0.95rem;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control.error { border-color: var(--danger); background: rgba(239,68,68,0.04); }

.error-message { color: var(--danger); font-size: 0.75rem; margin-top: 5px; display: none; }

/* ==================== GOOGLE G BUTTON (header) ==================== */
.google-g-btn {
  background: #4285F4;
  border: none;
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s, box-shadow 0.2s;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.google-g-btn:hover {
  background: #3367D6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.google-g-btn svg {
  display: block;
  flex-shrink: 0;
}
.google-g-btn .g-btn-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* ==================== GOOGLE SIGN-IN BRANDED BUTTON ==================== */
.btn-google {
  background: #4285F4;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  transition: box-shadow 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.btn-google:hover {
  background: #3367D6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.btn-google svg {
  flex-shrink: 0;
}
.btn-google .g-btn-text {
  color: #fff;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 14px 24px;
  border-radius: var(--radius-btn);
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  width: 100%;
  font-size: 0.95rem;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(91,184,245,0.28);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}
.btn-outline:hover { background: var(--primary-soft); }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px 0;
  font-family: 'Poppins', sans-serif;
}

/* ==================== MAIN APP ==================== */
#main-app {
  display: none;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
}

/* ==================== HEADER (slim app bar) ==================== */
header {
  background: var(--header-bg);
  color: white;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}

.header-logo {
  height: 72px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  flex-shrink: 0;
}
body.dark-mode .header-logo {
  background: white;
  border-radius: 10px;
  padding: 4px 10px;
  filter: none;
}

.header-controls { display: flex; gap: 8px; align-items: center; }

.points-badge {
  background: rgba(255,255,255,0.20);
  padding: 7px 13px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

.header-icon-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
  position: relative;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.28); }

/* Badge count dot on header badge icon */
.badge-count-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  pointer-events: none;
}
.badge-count-dot.hidden {
  display: none;
}

/* ==================== TOP-BAR (greeting card) ==================== */
.top-bar {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin: 16px 16px 0 16px;
}
.top-bar-left { flex: 1; min-width: 0; }
.top-bar-left h2 { font-size: 1.3rem; margin-bottom: 2px; }
.top-bar-left .family-code-label { font-size: 0.72rem; color: var(--text-light); }
.top-bar-settings {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.2s, color 0.2s;
}
.top-bar-settings:hover { background: var(--primary-soft); color: var(--primary); }

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
  display: none;
  padding: 16px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: fadeIn 0.25s;
}
.content-section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==================== CARDS ==================== */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.card-title { font-size: 1.1rem; font-weight: 600; flex: 1; }

/* Hero card */
.hero-card {
  background: var(--header-bg);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 16px;
  color: white;
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
}
.hero-card h3 { color: white; margin-bottom: 4px; }
.hero-card .meta { font-size: 0.8rem; opacity: 0.85; margin-bottom: 12px; }
.hero-card .hero-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.hero-card .hero-progress-fill {
  height: 100%;
  background: white;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.hero-card .link-btn { color: white; opacity: 0.9; font-size: 0.82rem; }

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s;
}
.stat-card:active { transform: scale(0.97); }
.stat-icon { font-size: 1.4rem; margin-bottom: 6px; opacity: 0.8; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { color: var(--text-light); font-size: 0.72rem; margin-top: 4px; }

/* ==================== SECTION LABEL ==================== */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 0 8px;
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: min(100%, var(--app-max-width));
  max-width: var(--app-max-width);
  margin: 0 auto;
  background: var(--nav-bg);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  min-height: var(--bottom-nav-height);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--nav-inactive);
  font-size: 0.6rem;
  line-height: 1.05;
  text-align: center;
  padding: 6px 2px 4px;
  border-radius: 12px;
  min-width: 0;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}
.nav-item span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.nav-item.active { color: var(--nav-active); }
.nav-item.active .nav-icon {
  font-variation-settings: 'FILL' 1;
}
/* Pill indicator under active nav item */
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--nav-active);
  border-radius: 2px;
}
.nav-icon { font-size: 20px; margin-bottom: 2px; }

@media (max-width: 390px) {
  .nav-item { font-size: 0.55rem; padding: 6px 1px 4px; }
  .nav-icon { font-size: 18px; }
}

/* ==================== CHILD SELECTOR ==================== */
.child-selector-dropdown { position: relative; margin-bottom: 16px; }
.child-selector-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
}
.child-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.child-dropdown.show { display: block; }
.child-dropdown-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}
.child-dropdown-item:last-child { border-bottom: none; }

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  overscroll-behavior: contain;
}
.modal-content {
  background: var(--card);
  border-radius: 28px;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  max-width: 450px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ==================== SETTINGS DRAWER ==================== */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}
.settings-overlay.open { opacity: 1; pointer-events: all; }

.settings-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(100%, var(--app-max-width));
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 0 20px calc(28px + var(--safe-bottom));
  z-index: 1900;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.14);
}
.settings-drawer.open { transform: translateX(-50%) translateY(0); }

.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 14px auto 20px;
}
.settings-drawer h3 { margin-bottom: 20px; font-size: 1.15rem; }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 0.9rem; font-weight: 500; }
.settings-row-meta { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(22px); }

/* ==================== PROGRESS BARS ==================== */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.3s; border-radius: 4px; }

/* ==================== CHIPS ==================== */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* Base chip */
.chip {
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* Category tints */
.chip, .chip-default       { background: var(--primary-soft); color: var(--primary); }
.chip-care, .chip-pregnancy { background: rgba(255,158,181,0.15); color: #c45a7a; }
.chip-nutrition             { background: rgba(245,200,66,0.18); color: #9A7410; }
.chip-health                { background: rgba(63,173,114,0.15); color: #2A8A58; }
.chip-danger                { background: rgba(239,68,68,0.10); color: #c0392b; }
.chip-tip                   { background: var(--primary-soft); color: var(--primary); }
.chip.active-chip           { background: var(--primary); color: white; }

/* ==================== THEME SWATCHES ==================== */
.theme-swatches {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.theme-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.theme-swatch:hover { transform: scale(1.18); }
.theme-swatch.selected { border-color: var(--text); transform: scale(1.12); }

/* ==================== MOOD ROW ==================== */
.mood-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}
.mood-btn {
  font-size: 1.75rem;
  background: none;
  border: 2.5px solid transparent;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mood-btn:hover, .mood-btn.selected {
  transform: scale(1.2);
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ==================== WEEK NAV ==================== */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: 20px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.week-nav-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.week-nav-btn:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.week-nav-btn:disabled { opacity: 0.3; cursor: default; }
.week-nav-label { text-align: center; flex: 1; }
.week-nav-label .wk-num { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.week-nav-label .wk-here { font-size: 0.68rem; color: var(--text-light); display: block; margin-top: 2px; }

/* ==================== ANC RECORDS ==================== */
.anc-visit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.anc-record {
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--card);
}
.anc-record summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.anc-record[open] summary { margin-bottom: 12px; color: var(--primary); }
.anc-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.anc-field {
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
}
.anc-field strong { display: block; color: var(--text-light); font-size: 0.68rem; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ==================== TIP BOX ==================== */
.tip-box {
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ==================== CARE SECTION ==================== */
.care-section { margin-bottom: 14px; }
.care-title { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; font-size: 0.92rem; }

/* ==================== VIDEO ==================== */
.video-banner {
  background: linear-gradient(135deg, #FF9EB5, #FF6B8B);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-weight: 500;
}
.video-group { margin-top: 16px; }
.group-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.episode-card { border: 1.5px solid var(--border); border-radius: 20px; overflow: hidden; margin-bottom: 12px; background: var(--card); }
.episode-video { width: 100%; aspect-ratio: 16/9; background: #111; }
.episode-video iframe, .episode-video img { width: 100%; height: 100%; display: block; border: 0; object-fit: cover; }
.episode-info { padding: 14px; }
.episode-title { font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.episode-desc { color: var(--text-light); font-size: 0.82rem; margin-bottom: 10px; }

/* ==================== AD SLOT & SLIDER ==================== */
#ad-slot { padding: 0 12px; margin-bottom: 4px; }

.ad-slider {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  margin: 0 0 8px;
}
.ad-slider::-webkit-scrollbar { display: none; }
.ad-slide { min-width: 100%; flex-shrink: 0; scroll-snap-align: start; }

/* BabyMigo-style card: large image top, content below */
.ad-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}
.ad-card:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0,0,0,0.07); }

.ad-card-img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
  min-height: 148px;
  background: var(--header-bg);
}
.ad-card-img-fallback {
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 148px;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
}
.ad-card-body {
  padding: 14px 16px 16px;
}
.ad-card-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text);
}
.ad-card-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.45;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-cta-pill {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.ad-sponsored-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(0,0,0,0.42);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ad-slider-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 0; }
.ad-slider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); transition: width 0.2s, background 0.2s;
}
.ad-slider-dot.active { background: var(--primary); width: 16px; border-radius: 4px; }

/* ==================== CAROUSEL CARDS (Vaccines, Milestones) ==================== */
.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 12px;
  padding: 4px 0 8px;
}
.carousel-container::-webkit-scrollbar { display: none; }

.carousel-card {
  scroll-snap-align: start;
  flex: 0 0 85%;
  min-width: 260px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.carousel-card:active { transform: scale(0.98); }

.carousel-card .card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.carousel-card .card-badge.completed { background: #e8f5e9; color: #2e7d32; }
.carousel-card .card-badge.upcoming { background: #e3f2fd; color: #1565c0; }
.carousel-card .card-badge.due { background: #fff3e0; color: #e65100; }
.carousel-card .card-badge.overdue { background: #ffebee; color: #c62828; }
.carousel-card .card-badge.clinic-review { background: #fce4ec; color: #880e4f; }
.carousel-card .card-badge.planned { background: #e8f5e9; color: #2e7d32; }

.carousel-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.carousel-card .card-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}
.carousel-card .card-desc {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.carousel-card .card-action {
  margin-top: 4px;
}
.carousel-card .card-action .btn-sm {
  font-size: 0.78rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}
.carousel-card .card-action .btn-sm:hover {
  background: var(--primary);
  color: white;
}
.carousel-card .card-action .btn-sm.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 0;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: width 0.2s, background 0.2s;
}
.carousel-dot.active {
  background: var(--primary);
  width: 16px;
  border-radius: 4px;
}

/* ==================== CHART TABS ==================== */
.chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px;
}
.chart-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}
.chart-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.chart-tab:hover:not(.active) {
  color: var(--text);
}

/* ==================== MISC COMPONENTS ==================== */
.checklist-item { display: flex; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); gap: 12px; }
.vaccine-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.milestone-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.badge-progress-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }

/* ==================== ICON BTN ==================== */
.icon-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-light);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.icon-btn.bookmarked { color: var(--primary); border-color: rgba(91,184,245,0.4); background: var(--primary-soft); }

/* ==================== PRIVACY CARD ==================== */
.privacy-card { background: var(--primary-soft); border-left: 4px solid var(--primary); }

/* ==================== PRIVACY SWIPER ==================== */
.privacy-swiper {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 12px; padding: 4px 0;
}
.privacy-swiper::-webkit-scrollbar { display: none; }
.privacy-slide {
  scroll-snap-align: start; flex: 0 0 100%; min-width: 0;
  padding: 16px; background: var(--bg); border-radius: 16px; text-align: center; box-sizing: border-box;
}
.privacy-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-light); opacity: 0.4; transition: opacity 0.3s; }
.privacy-dot.active { opacity: 1; background: var(--primary); }

/* ==================== THEME SELECTOR (legacy header) ==================== */
.theme-selector { position: relative; cursor: pointer; display: flex; align-items: center; }
.theme-menu {
  position: absolute; top: 100%; right: 0;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 16px;
  padding: 4px; z-index: 1000; min-width: 140px;
  box-shadow: var(--shadow-float); margin-top: 8px;
}
.theme-option { padding: 8px 12px; cursor: pointer; border-radius: 8px; font-size: 0.85rem; white-space: nowrap; }
.theme-option:hover { background: var(--bg); }

/* ==================== FOCUS VISIBLE ==================== */
.points-badge:focus-visible,
.header-icon-btn:focus-visible,
.top-bar-settings:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.vaccine-item:focus-visible, .milestone-item:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px;
}

/* ==================== HANDBOOK ENTRIES ==================== */
.handbook-entry {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  transition: box-shadow 0.2s;
}
.handbook-entry[open] {
  box-shadow: var(--shadow-card);
}
.handbook-entry summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}
.handbook-entry summary::-webkit-details-marker {
  display: none;
}
.handbook-entry summary::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-light);
  transition: transform 0.2s;
}
.handbook-entry[open] summary::after {
  transform: rotate(180deg);
}
.handbook-content {
  padding: 0 16px 16px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}
.handbook-content ol,
.handbook-content ul {
  margin-top: 6px;
  margin-bottom: 10px;
}
.handbook-content li {
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ==================== MASCOT STYLES ==================== */
.mascot-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.mascot-container.mama {
  border-left: 4px solid var(--mom);
}
.mascot-container.baba {
  border-left: 4px solid var(--dad);
}
.mascot-container.baby {
  border-left: 4px solid var(--primary);
}
.mascot-img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  padding: 4px;
}
.mascot-speech {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}
.mascot-speech strong {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mascot-speech .mascot-message {
  font-style: italic;
}
.mascot-speech .mascot-message::before {
  content: "\201C";
}
.mascot-speech .mascot-message::after {
  content: "\201D";
}

/* Mascot in onboarding */
.onboarding-mascot {
  text-align: center;
  margin-bottom: 20px;
}
.onboarding-mascot img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.onboarding-mascot .mascot-greeting {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

/* Mascot floating helper */
.mascot-float {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 500;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.mascot-float:hover {
  transform: scale(1.1);
}
.mascot-float img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  padding: 4px;
  box-shadow: var(--shadow-float);
  border: 2px solid var(--primary);
}
.mascot-float .mascot-float-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== PREGNANCY WEEK CARD ==================== */
.pregnancy-week-card {
  border-left: 4px solid var(--mom);
  padding: 16px;
}

.preg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.preg-icon {
  font-size: 2rem;
  color: var(--mom);
  background: rgba(255, 158, 181, 0.12);
  padding: 8px;
  border-radius: 12px;
}

.preg-baby-size {
  background: rgba(91, 184, 245, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preg-baby-size .material-symbols-outlined {
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}

.preg-section {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.5;
}

.preg-section:last-of-type {
  border-bottom: none;
}

.preg-section .material-symbols-outlined {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--mom);
}

.preg-section > div {
  flex: 1;
}

/* ==================== GENDER PROMPT ==================== */
.gender-prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f0f7ff;
  border: 2px dashed var(--primary);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.gender-prompt-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.gender-prompt-content {
  flex: 1;
}
.gender-prompt-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.gender-prompt-content p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}
.gender-prompt-buttons {
  display: flex;
  gap: 10px;
}
.gender-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}
.gender-option:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}
.gender-option:active,
.gender-option.selected {
  border-color: var(--primary);
  background: #e3f2fd;
  color: var(--primary);
}
.gender-option-icon {
  font-size: 1.3rem;
}

/* ==================== PERCENTILE EXPLANATION ==================== */
.percentile-explanation {
  margin-top: 12px;
}
.percentile-explanation-inner {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ==================== MARKETPLACE ==================== */
.marketplace-header {
  margin-bottom: 16px;
}
.marketplace-item {
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.marketplace-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  border-bottom: 1px solid var(--border);
}
.marketplace-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.marketplace-item-info {
  flex: 1;
  min-width: 0;
}
.marketplace-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.marketplace-item-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}
.coming-soon-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FFF3E0;
  color: #E65100;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.coming-soon-body {
  padding: 16px;
  background: var(--card);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.coming-soon .marketplace-item-header {
  border-bottom: none;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.coming-soon .marketplace-item-header + .coming-soon-body {
  border-top: 1px solid var(--border);
}

/* ==================== SPLASH SCREEN ==================== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  width: 160px;
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
.splash-loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: splashSpin 0.8s linear infinite;
}
@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

/* ==================== APK INSTALL BANNER ==================== */
.apk-install-banner {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  position: relative;
}
.apk-install-banner .apk-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.apk-install-banner .apk-text {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}
.apk-install-banner .apk-text strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.apk-install-banner .apk-btn {
  background: #4285F4;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
  font-family: 'Poppins', sans-serif;
}
.apk-install-banner .apk-btn:hover {
  background: #3367D6;
}
.apk-install-banner .apk-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.apk-install-banner .apk-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ==================== OFFLINE INDICATOR ==================== */
.offline-indicator {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  z-index: 900;
  box-shadow: 0 2px 10px rgba(239,68,68,0.3);
  display: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  animation: fadeIn 0.3s ease;
}
.offline-indicator.show {
  display: flex;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
}
.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}
.empty-state p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state .btn {
  width: auto;
  display: inline-flex;
}

/* ==================== HEALTH FACILITIES ==================== */
.facilities-card {
    margin-top: 0;
}
.facility-card {
    background: #f8faff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}
.facility-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.facility-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.facility-type-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.facility-card-info {
    flex: 1;
    min-width: 0;
}
.facility-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 2px;
}
.facility-type {
    font-size: 0.78rem;
    color: var(--text-light);
}
.facility-distance {
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    margin-top: 2px;
}
.facility-phone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 4px;
    padding: 2px 0;
}
.facility-phone:hover {
    text-decoration: underline;
}
.facility-address {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 6px;
    line-height: 1.4;
}
.facility-directions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #34A853;
    text-decoration: none;
    padding: 6px 12px;
    background: #E8F5E9;
    border-radius: 8px;
    margin-top: 4px;
}
.facility-directions:hover {
    background: #C8E6C9;
}

/* ==================== MEDICAL DISCLAIMER ==================== */
.medical-disclaimer {
  padding: 12px 16px;
  margin-top: 16px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 12px;
  font-size: 0.72rem;
  color: #795548;
  line-height: 1.5;
}
.medical-disclaimer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
}
.medical-disclaimer p {
  margin-bottom: 4px;
}
.medical-disclaimer p:last-child {
  margin-bottom: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 500px) {
  #main-app { box-shadow: 0 0 48px rgba(0,0,0,0.10); }
}

