@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

/* ============================================
   복약 도우미 v3.0 - Premium SoriYaksok Theme
   ============================================ */

/* Mobile touch optimization */
button, .btn, .nav-btn, .slot-toggle-btn, .emergency-item, .monitor-avatar-item, .time-chip {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

:root {
  /* SoriYaksok Premium Warm Wellness Color Palette - Blue Theme */
  --primary: #1E6091; /* Deep Premium Ocean Blue */
  --primary-light: #E8F1F5; /* Soft Blue Tint */
  --primary-dark: #0F3A5F; /* Rich Dark Navy/Blue */
  --secondary: #4E5968; /* Slate/Toss Grey */
  --secondary-light: #8B95A1; /* Slate/Toss Soft Grey */
  --accent: #FF7F62; /* Warm Peach Coral */
  --accent-light: #FFF0EC; /* Soft Coral Tint */
  --accent-dark: #E05A3D;
  
  --bg-gradient: linear-gradient(180deg, #FDFDFB 0%, #F5F4F0 100%);

  /* Modern Glass & Rounded Cards */
  --bg-card: #FFFFFF;
  --bg-card-hover: #FCFAF7;
  --bg-input: #F1EFEA;
  --glass-blur: blur(20px);
  --glass-border: 1px solid rgba(30, 96, 145, 0.06);

  --text-primary: #2A3342; /* Warm Deep Slate Charcoal */
  --text-secondary: #4E5968; /* Warm Slate Gray */
  --text-muted: #8B95A1; /* Warm Soft Gray */
  --text-on-primary: #FFFFFF;

  --success: #2C6E49; /* Deep Warm Green */
  --success-bg: rgba(44, 110, 73, 0.08);
  --warning: #E28743; /* Soft Gold/Amber */
  --warning-bg: rgba(226, 135, 67, 0.08);
  --danger: #DF5B5B; /* Premium Crimson */
  --danger-bg: rgba(223, 91, 91, 0.08);

  --morning-gradient: linear-gradient(135deg, #FFB07C 0%, #FF7F62 100%);
  --afternoon-gradient: linear-gradient(135deg, #5E9ABF 0%, #1E6091 100%);
  --evening-gradient: linear-gradient(135deg, #7F7FA8 0%, #3F3F6D 100%);

  --shadow-sm: 0 2px 6px rgba(30, 96, 145, 0.02);
  --shadow-md: 0 10px 28px rgba(30, 96, 145, 0.04), 0 2px 6px rgba(30, 96, 145, 0.02);
  --shadow-lg: 0 20px 48px rgba(30, 96, 145, 0.06), 0 4px 12px rgba(30, 96, 145, 0.03);
  --shadow-glow: 0 8px 24px rgba(30, 96, 145, 0.12);
  --shadow-card: 0 10px 28px rgba(30, 96, 145, 0.04), 0 2px 6px rgba(30, 96, 145, 0.02);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 9999px;

  --font: 'Plus Jakarta Sans', 'Pretendard', -apple-system, sans-serif;
  --nav-height: 120px;
  --header-height: 120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: -0.025em; }
html { font-size: 16.48px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, textarea, button, select { font-family: inherit; font-size: inherit; letter-spacing: -0.4px; }
button { cursor: pointer; border: none; background: none; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }

/* ---- Shield Logo ---- */
.shield-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.shield-logo-sm {
  width: 34px; height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}
.section-header h2 {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.shield-logo-lg {
  width: 80px; height: 80px;
  object-fit: contain;
}
.shield-logo-xl {
  width: 100px; height: 100px;
  object-fit: contain;
}

/* ---- App Layout ---- */
#app {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  max-width: 480px; margin: 0 auto; position: relative;
}

/* ---- Senior Garden Header ---- */
.senior-garden-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 18px;
  background: linear-gradient(135deg, #EAF2EA 0%, #CDE8CD 100%); /* Default Morning */
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(46, 125, 50, 0.04), 0 2px 8px rgba(0, 0, 0, 0.01);
  border-bottom: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Time-of-day gradients */
.senior-garden-header.header-morning {
  background: linear-gradient(135deg, #EAF2EA 0%, #CDE8CD 100%) !important;
  box-shadow: 0 10px 30px rgba(46, 125, 50, 0.05), 0 2px 8px rgba(0, 0, 0, 0.01) !important;
}
.senior-garden-header.header-afternoon {
  background: linear-gradient(135deg, #EBF5F6 0%, #D8ECEE 100%) !important;
  box-shadow: 0 10px 30px rgba(28, 78, 80, 0.05), 0 2px 8px rgba(0, 0, 0, 0.01) !important;
}
.senior-garden-header.header-evening {
  background: linear-gradient(135deg, #F0F0F7 0%, #E3E3F2 100%) !important;
  box-shadow: 0 10px 30px rgba(63, 63, 109, 0.05), 0 2px 8px rgba(0, 0, 0, 0.01) !important;
}

/* ---- Ad Banner ---- */
.header-ad-banner {
  margin: -16px -20px 14px -20px !important;
  width: calc(100% + 40px) !important;
  padding: 0 16px;
  height: 75px; /* Enlarge banner height */
  background: #FFFDF0; /* Warm banner color */
  border: none !important;
  border-bottom: 1.5px solid rgba(234, 179, 8, 0.12) !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.ad-badge {
  background: #EAB308;
  color: #FFFFFF;
  font-size: 0.72rem;
  padding: 2.5px 5px;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
}
.ad-text-slider {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  margin-right: 6px;
}
.ad-text-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.95rem; /* Enlarge font size */
  font-weight: 700;
  color: #4B5563;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.5s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.ad-text-item.active {
  opacity: 1;
  transform: translateY(0);
}
.ad-text-item.exit {
  opacity: 0;
  transform: translateY(-100%);
}
.btn-close-ad {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  outline: none;
}
.exit-app-btn svg {
  width: 32px !important;
  height: 32px !important;
}
/* 1층 (.header-info-row) */
.header-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.header-date {
  font-size: 0.82rem;
  font-weight: 800;
  color: hsl(210, 15%, 50%);
  letter-spacing: -0.2px;
}
.header-welcome {
  font-size: 1.15rem;
  font-weight: 900;
  color: hsl(210, 25%, 15%);
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.5px;
}

/* 연동 상태 배지 (.connection-badge-wrap) */
.connection-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  border-radius: 50px;
  transition: all 0.25s ease;
}
.connection-badge-wrap #connection-status-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4E5968;
}
.connection-badge-wrap.connected {
  background: #FFFFFF !important;
  border: 1px solid rgba(34, 197, 94, 0.25) !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.06) !important;
}
.connection-badge-wrap.connected #connection-status-label {
  color: #166534 !important;
}
.connection-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #8E94A0; /* Offline gray */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
}
.connection-status.connected {
  background-color: #22C55E; /* Online green */
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

/* 2층 (.header-display-row-card) */
.header-display-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #E0F2FE 0%, #4D96F7 100%) !important;
  border-radius: 22px !important;
  padding: 12px 18px;
  box-shadow: 0 4px 16px rgba(49, 130, 246, 0.12) !important;
  border: none !important;
}

/* 좌측: 꽃 모양 출석부 */
.attendance-flower-zone {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flower-outer-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.12);
  animation: pulseScale 3s infinite ease-in-out;
}
.flower-icon {
  font-size: 1.15rem;
}
.attendance-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.attendance-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #1E40AF;
  letter-spacing: -0.1px;
}
.attendance-count {
  font-size: 0.95rem;
  font-weight: 900;
  color: #1E3A8A;
  letter-spacing: -0.3px;
}

/* 우측: 가족사진 미니 액자 버튼 */
.family-album-zone {
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 3px solid #C9A96E; /* 앤틱 골드 액자 테두리 */
  box-shadow:
    0 0 0 1px #E8D5A8,
    0 2px 5px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, #FFF8E7, #F5ECD7);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.family-album-zone:hover {
  transform: translateY(-2px);
}
.family-album-zone:active {
  transform: scale(0.95);
}
.family-album-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}
.camera-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.72rem;
  background: #FFFFFF;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  border: 1px solid #E2E8F0;
  z-index: 2;
}

/* ---- Main ---- */
#main-content {
  flex: 1; padding: 24px 20px calc(var(--nav-height) + 24px); overflow-y: auto;
}
.tab-section { display: none; animation: fadeSlideUp 0.35s ease; }
.tab-section.active { display: block; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.section-header { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }

/* ---- Bottom Nav ---- */
#bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05); z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 2px; border-radius: var(--radius-sm);
  transition: all 0.25s ease; min-width: 0; position: relative;
}
.nav-btn .nav-icon { font-size: 2.1rem; transition: transform 0.25s ease; display: flex; align-items: center; justify-content: center; }
.nav-btn .nav-icon svg { width: 32px; height: 32px; }
.nav-btn .nav-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.25s ease;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.nav-btn.active .nav-label { color: var(--primary); font-weight: 800; }
.nav-btn.active .nav-icon { transform: scale(1.1); }
.nav-btn.active::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 44px; height: 4px; background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* Emphasized Center FAB Button (복약) */
#bottom-nav .nav-center-fab {
  flex: none;
  position: relative;
  top: -28px;
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  background: var(--primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(28, 78, 80, 0.22);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 250;
  border: 5px solid #FFFFFF;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#bottom-nav .nav-center-fab .nav-center-text {
  color: #FFFFFF !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1;
}
#bottom-nav .nav-center-fab.active {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(28, 78, 80, 0.35);
}
#bottom-nav .nav-center-fab.active::after {
  display: none;
}

/* ---- Progress Card ---- */
.progress-card {
  display: flex; align-items: center; gap: 16px;
  background: #FFFFFF !important;
  color: var(--text-primary); padding: 20px 24px;
  border-radius: 18px !important; margin-bottom: 16px;
  border: none;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
  position: relative; overflow: hidden;
}
.progress-card.alert-red {
  background: #FFF5F5 !important;
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 24px rgba(240, 68, 82, 0.05) !important;
}
.progress-card.alert-red .progress-info h2,
.progress-card.alert-red .progress-detail,
.progress-card.alert-red .progress-text {
  color: var(--danger) !important;
}
.progress-card.alert-red .progress-ring-fill {
  stroke: var(--danger) !important;
}
.progress-card.alert-red .progress-ring-bg {
  stroke: rgba(240, 68, 82, 0.08) !important;
}
.progress-ring-container { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.progress-ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: rgba(49, 130, 246, 0.08); stroke-width: 8; }
.progress-ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1s ease;
}
.progress-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: var(--primary);
  white-space: nowrap;
}
.progress-percent { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.progress-unit { font-size: 0.75rem; font-weight: 700; margin-left: 1px; }
.progress-info h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.progress-detail { font-size: 0.82rem; color: var(--text-secondary); }

/* ============================
   BIG MEDICATION CARDS
   ============================ */
.big-med-cards { display: flex; flex-direction: column; gap: 16px; }

.big-med-card {
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 18px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin-bottom: 16px;
}
.big-med-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(149, 157, 165, 0.22) !important;
}

/* State-based 포인트 컬러 */
.big-med-card.untaken {
  background: #FFFFFF !important;
  border-left: 5px solid hsl(210, 100%, 65%) !important;
}
.big-med-card.taken {
  background: #FFFFFF !important;
  border-left: 5px solid hsl(145, 65%, 45%) !important;
  opacity: 0.55;
}
.big-med-card.taken .big-med-card-name {
  color: #8B95A1 !important;
  font-weight: 700;
  text-decoration: line-through;
}
.big-med-card.taken .big-med-card-dosage,
.big-med-card.taken .big-med-card-memo {
  color: #8B95A1 !important;
}
.big-med-card.overdue {
  background: #FFFFFF !important;
  border-left: 5px solid hsl(10, 95%, 65%) !important;
}

/* Status Badges */
.big-med-card-badge-row {
  padding: 22px 24px 0 24px;
  display: flex;
  justify-content: flex-start;
}
.med-status-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.med-status-badge.waiting {
  background: #F2F4F6;
  color: #4E5968;
}
.med-status-badge.taken {
  background: #E8F3FF;
  color: #3182F6;
}
.med-status-badge.overdue {
  background: #FFF0F0;
  color: #FF3B3B;
}

.big-med-card-header {
  padding: 12px 24px 14px 24px;
  display: flex; align-items: center; gap: 14px;
}
.big-med-card-icon-wrapper {
  width: 48px; height: 48px; border-radius: 14px !important;
  background: rgba(49, 130, 246, 0.08);
  color: #3182F6;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.3s ease;
}
.big-med-card-icon-svg { display: block; }
.big-med-card-text { flex: 1; }
.big-med-card-name { font-size: 1.2rem; font-weight: 700; color: #191F28; letter-spacing: -0.4px; }
.big-med-card-dosage { font-size: 0.88rem; color: #6B7684; margin-top: 2px; }
.big-med-card-memo { font-size: 0.82rem; color: #8B95A1; font-style: italic; margin-top: 2px; }

.big-med-card-slots { display: flex; gap: 10px; padding: 0 24px 24px 24px; }

.slot-toggle-btn {
  flex: 1;
  min-height: 84px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #EAECEF;
  background: #FFFFFF;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 14px 10px;
}
.slot-toggle-btn:hover {
  background: #F8F9FA;
}
.slot-toggle-btn .slot-t-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333D4B;
}
.slot-toggle-btn .slot-t-status {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  display: inline-block;
  margin-top: 4px;
}
.slot-toggle-btn .slot-t-status.waiting {
  background: #F2F4F6;
  color: #4E5968;
}
.slot-toggle-btn .slot-t-status.overdue {
  background: #FFF0F0;
  color: #FF3B3B;
}
.slot-toggle-btn.taken {
  background: #FFFFFF;
  border: 1px solid #3182F6;
}
.slot-toggle-btn.taken .slot-t-status {
  background: #E8F3FF;
  color: #3182F6;
}
.slot-toggle-btn.not-scheduled { display: none; }
.slot-cancel-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #FFFFFF;
  color: var(--danger);
  border: 1px solid #F3D0D3;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.slot-cancel-btn:hover {
  background: var(--danger-bg);
}

/* ============================
   SIMPLIFIED ELEGANT MEDICATION CHECKLIST CARDS
   (Ref: 오늘의 복약 리스트)
   ============================ */
.med-list-section-header {
  margin: 8px 0 16px 4px;
  text-align: left;
}
.med-list-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
}
.med-list-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748B;
  margin: 0;
}

.simplified-med-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.simplified-med-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(148, 163, 184, 0.08);
  border: 1.5px solid #E2E8F0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  user-select: none;
}
.simplified-med-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.16);
}

/* Card States */
.simplified-med-card.state-taken {
  background: #FFFFFF !important;
  border: 2px solid #4ADE80 !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.12) !important;
}

.simplified-med-card.state-waiting {
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
}

.simplified-med-card.state-overdue {
  background: #FEF2F2 !important;
  border: 2px solid #FCA5A5 !important;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.12) !important;
}

/* Left Circle Checkmark Avatar */
.med-check-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.25s ease;
}
.med-check-circle.state-taken {
  background: #16A34A;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.med-check-circle.state-waiting {
  background: #F1F5F9;
  border: 3px solid #CBD5E1;
  color: #94A3B8;
}
.med-check-circle.state-overdue {
  background: #DC2626;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.med-pill-badge-icon {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  background: #16A34A;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

/* Middle Column Info */
.med-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  overflow: hidden;
}
.med-time-label {
  font-size: 1.18rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.3px;
}
.med-pill-names {
  font-size: 1.0rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Status Column */
.med-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}
.med-status-text {
  font-size: 0.9rem;
  font-weight: 800;
}
.med-status-text.taken {
  color: #16A34A;
}
.med-status-text.waiting {
  color: #64748B;
}
.med-status-text.overdue {
  color: #DC2626;
}
.med-status-time {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E293B;
}

.med-cancel-action-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
}
.med-cancel-action-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* ============================
   GUARDIAN MONITORING
   ============================ */
.patient-monitor-card {
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 18px !important;
  padding: 24px !important; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
}
.monitor-patient-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid rgba(49,130,246,0.08);
}
.monitor-patient-avatar { font-size: 2.2rem; }
.monitor-patient-name { font-size: 1.2rem; font-weight: 800; color: #191F28; }
.monitor-med-item {
  background: #F5F6F8;
  border-radius: 16px;
  padding: 14px 16px; margin-bottom: 10px;
  border: none;
}
.monitor-med-name {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  color: #191F28;
}
.monitor-med-icon { width: 28px; height: 28px; object-fit: contain; }
.monitor-slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.monitor-slot-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 30px;
  font-size: 0.9rem; font-weight: 700;
}
.monitor-slot-badge.taken { background: linear-gradient(135deg, #D2E6FF, #DDE8FF); color: #1B64DA; }
.monitor-slot-badge.missed { background: linear-gradient(135deg, #FFF0F0, #FFE8E8); color: #E53535; }
.monitor-slot-badge.pending { background: #EAECF0; color: #4E5968; }
.btn-remind {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px;
  background: #3182F6;
  color: #fff; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700;
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.2);
  transition: all 0.2s ease;
}
.btn-remind:hover { box-shadow: 0 8px 20px rgba(49, 130, 246, 0.3); transform: translateY(-2px); }

/* ---- Reminder Banner ---- */
#reminder-banner {
  background: rgba(255, 244, 230, 0.95);
  backdrop-filter: blur(8px);
  border-left: 5px solid var(--warning);
  margin: 0 16px 12px; padding: 14px 16px;
  border-radius: var(--radius-sm);
  animation: fadeSlideUp 0.4s ease;
  box-shadow: var(--shadow-sm);
}
.reminder-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.95rem; font-weight: 500; }
.reminder-item + .reminder-item { border-top: 1px solid rgba(0,0,0,0.06); }
.reminder-dismiss { margin-left: auto; background: var(--warning); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }

/* ---- Feedback Banner ---- */
.feedback-banner {
  background: rgba(255, 244, 246, 0.95);
  backdrop-filter: blur(8px);
  border-left: 5px solid #FF3B3B;
  margin: 0 16px 12px; padding: 14px 16px;
  border-radius: var(--radius-sm);
  animation: fadeSlideUp 0.4s ease;
  box-shadow: 0 4px 16px rgba(255, 59, 59, 0.05);
  display: flex;
}

/* ============================
   CONSENT FORM
   ============================ */
#onboard-step-consent .onboarding-icon {
  display: none;
}
.consent-list {
  text-align: left;
  margin: 10px 0;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 6px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
}
/* Style scrollbar for consent list */
.consent-list::-webkit-scrollbar {
  width: 6px;
}
.consent-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.02);
  border-radius: 3px;
}
.consent-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}
.consent-all-label {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #EBF3FF;
  border-radius: var(--radius-md); cursor: pointer;
  border: 2px solid #3182F6;
}
.consent-all-label input[type="checkbox"] { width: 28px; height: 28px; accent-color: #3182F6; flex-shrink: 0; cursor: pointer; }
.consent-all-text { font-size: 1.1rem; font-weight: 800; color: #1B64DA; }
.consent-divider { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 10px 0; }
.consent-item { padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.consent-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.82rem; line-height: 1.45; }
.consent-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.consent-label strong { color: var(--danger); }
.consent-detail-toggle { display: block; margin: 3px 0 0 28px; font-size: 0.78rem; color: var(--primary); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; }
.consent-detail-toggle:hover { text-decoration: underline; }
.consent-detail { display: none; margin: 6px 0 4px 28px; padding: 10px 12px; background: rgba(240,248,245,0.8); border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.consent-detail.open { display: block; animation: fadeSlideUp 0.25s ease; }

/* ---- Med List (Tab Meds) ---- */
.med-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 80px; }
.med-card {
  background: #ffffff !important;
  border: none !important;
  border-radius: 18px !important;
  padding: 24px !important;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.med-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(149, 157, 165, 0.22) !important;
}
.med-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.med-card[data-color="#FF8A80"]::before { background: #FF8A80; }
.med-card[data-color="#FFD180"]::before { background: #FFD180; }
.med-card[data-color="#B9F6CA"]::before { background: #B9F6CA; }
.med-card[data-color="#82B1FF"]::before { background: #82B1FF; }
.med-card[data-color="#EA80FC"]::before { background: #EA80FC; }
.med-card[data-color="#FFFFFF"]::before { background: #3182F6; }
.med-card-icon { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; margin-top: 2px; }
.med-card-body { flex: 1; min-width: 0; }
.med-card-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; color: #191F28; }
.med-card-dosage { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 6px; }
.med-card-schedule { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.schedule-tag { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; color: #fff; }
.schedule-tag.morning { background: linear-gradient(135deg, #FF9500, #FFB03B); }
.schedule-tag.afternoon { background: linear-gradient(135deg, #3182F6, #63A1FF); }
.schedule-tag.evening { background: linear-gradient(135deg, #5856D6, #7E7CFF); }
.med-card-memo { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.med-card-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.med-action-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: all 0.2s ease;
}
.med-action-btn.edit { background: var(--warning-bg); }
.med-action-btn.edit:hover { background: var(--warning); color: #fff; }
.med-action-btn.delete { background: var(--danger-bg); }
.med-action-btn.delete:hover { background: var(--danger); color: #fff; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-state-logo { width: 72px; height: 72px; object-fit: contain; margin-bottom: 16px; opacity: 0.65; }
.empty-state p { font-size: 1.125rem; font-weight: 800; color: var(--primary-dark); }
.empty-hint { font-size: 1.05rem !important; margin-top: 8px; font-weight: 800 !important; color: var(--primary-dark) !important; text-shadow: 0 1px 1px rgba(255,255,255,0.8); }

/* ---- FAB ---- */
.fab {
  position: fixed; bottom: calc(var(--nav-height) + 20px); right: calc(50% - 210px);
  width: 60px; height: 60px; border-radius: var(--radius-full);
  background: #3182F6;
  color: #fff; font-size: 2.2rem; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(49, 130, 246, 0.25); z-index: 150;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.95); }
@media (max-width: 480px) { .fab { right: 20px; } }

/* ---- History ---- */
.week-navigator { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.week-nav-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: #FFFFFF;
  border: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-secondary); transition: all 0.2s ease;
}
.week-nav-btn:hover { background: #3182F6; color: #fff; }
.week-label { font-size: 1rem; font-weight: 700; min-width: 160px; text-align: center; color: #191F28; }
.week-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px; }
.day-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 14px;
  background: #FFFFFF;
  border: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  cursor: pointer; transition: all 0.2s ease;
}
.day-cell.selected { box-shadow: 0 0 0 2.5px #3182F6 !important; }
.day-cell.today { background: linear-gradient(135deg, #3182F6, #63A1FF); color: #fff; }
.day-cell.future { opacity: 0.4; }
.day-label { font-size: 0.65rem; font-weight: 500; color: var(--text-muted); }
.day-cell.today .day-label { color: rgba(255,255,255,0.8); }
.day-number { font-size: 1rem; font-weight: 700; }
.day-indicator { width: 8px; height: 8px; border-radius: var(--radius-full); }
.day-indicator.perfect { background: #00B57A; }
.day-indicator.partial { background: #FF9500; }
.day-indicator.missed { background: #F04452; }
.day-indicator.none { background: transparent; }
.daily-detail {
  background: #FFFFFF;
  border: none;
  border-radius: 18px !important;
  padding: 20px; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
}
.daily-detail h3 { margin-bottom: 12px; font-size: 1rem; font-weight: 800; color: #191F28; }
.detail-slot-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.detail-slot-row + .detail-slot-row { border-top: 1px solid rgba(0,0,0,0.05); }
.detail-slot-icon { font-size: 1.25rem; }
.detail-slot-name { flex: 1; font-weight: 700; font-size: 0.95rem; color: #191F28; }
.detail-slot-status { font-size: 0.78rem; font-weight: 700; padding: 6px 14px; border-radius: 50px; }
.detail-slot-status.taken { background: linear-gradient(135deg, #D2E6FF, #DDE8FF); color: #1B64DA; }
.detail-slot-status.missed { background: linear-gradient(135deg, #FFF0F0, #FFE8E8); color: #E53535; }
.detail-slot-status.pending { background: #EAECF0; color: #4E5968; }
.detail-slot-status.no-med { color: var(--text-muted); }
.detail-med-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.9rem; }
.detail-med-row + .detail-med-row { border-top: 1px solid rgba(0,0,0,0.03); }
.detail-med-dot { width: 10px; height: 10px; border-radius: var(--radius-full); flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); }
.detail-med-name { flex: 1; font-weight: 500; }
.detail-med-status { font-weight: 700; }
.detail-med-status.ok { color: var(--success); }
.detail-med-status.no { color: var(--danger); }
.stats-card {
  background: var(--bg-card); backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-card);
}
.stats-card h3 { margin-bottom: 16px; text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 1.75rem; font-weight: 900; color: var(--primary); }
.stat-value.highlight { color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

/* ---- Profile ---- */
.profile-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: var(--radius-full);
  background: #F2F4F6;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0; overflow: hidden;
}
.profile-avatar img { width: 48px; height: 48px; object-fit: contain; }
.profile-info { flex: 1; }
.profile-info h3 { font-size: 1.2rem; margin-bottom: 2px; color: #191F28; }
.profile-info p { font-size: 0.85rem; color: var(--text-secondary); }
.profile-role-badge {
  display: inline-block; margin-top: 4px; font-size: 0.75rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  background: #3182F6;
  color: #fff;
}
.card {
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 18px !important;
  padding: 24px !important;
  margin-bottom: 16px !important;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15) !important;
}
.card h3 { margin-bottom: 8px; color: var(--primary-dark); font-weight: 800; font-size: 1.15rem; }
.card-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.sync-code-display {
  display: flex; align-items: center; gap: 10px;
  background: rgba(240,248,245,0.8); padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(43,108,176,0.1);
}
.sync-code {
  font-size: 1.75rem; font-weight: 900; letter-spacing: 6px; color: var(--primary); flex: 1; text-align: center;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all 0.2s ease;
}
html.zoom-12 .sync-code {
  font-size: 1.45rem;
  letter-spacing: 4px;
}
html.zoom-15 .sync-code {
  font-size: 1.25rem;
  letter-spacing: 2px;
}
.connect-input-group {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; width: 100%; box-sizing: border-box;
}
.connect-input-group input {
  flex: 1; min-width: 0; padding: 12px 14px; font-size: 0.95rem;
  border: 2px solid var(--border-color, #E2E8F0); border-radius: var(--radius-sm);
  background: var(--bg-input, #F1F5F9); color: var(--text-primary); box-sizing: border-box;
}
.connect-input-group .btn {
  flex-shrink: 0; padding: 12px 16px; font-size: 0.95rem; height: 48px; box-sizing: border-box;
}
.emergency-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: rgba(240,248,245,0.7); border-radius: var(--radius-sm); margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.5);
}
.emergency-item-info { flex: 1; }
.emergency-item-name { font-weight: 600; font-size: 0.95rem; }
.emergency-item-phone { font-size: 0.85rem; color: var(--primary); }
.emergency-item-relation { font-size: 0.75rem; color: var(--text-muted); }
.emergency-call-btn { width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--success); color: #fff; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; }
.emergency-delete-btn { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--danger-bg); color: var(--danger); font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
.app-info-card { text-align: center; }
.app-version { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 700; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
}
.btn:active {
  transform: scale(0.96);
}
.btn-large { padding: 16px 32px; font-size: 1.15rem; border-radius: var(--radius-md); }
.btn-small { padding: 8px 16px; font-size: 0.9rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(28, 78, 80, 0.12);
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(28, 78, 80, 0.2); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(255, 127, 98, 0.2); }
.btn-accent:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 127, 98, 0.3); }
.btn-outline { border: 1.5px solid rgba(28, 78, 80, 0.15); color: var(--text-secondary); background: #FFFFFF; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-card-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.95; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 14px 16px; border: 1.5px solid transparent;
  border-radius: var(--radius-md); background: var(--bg-input);
  font-size: 1.05rem; color: var(--text-primary);
  transition: all 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background: #FFFFFF; box-shadow: 0 0 0 4px rgba(28, 78, 80, 0.1); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-actions .btn { flex: 1; }
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 16px; border: 3px solid rgba(28, 78, 80, 0.05); border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.85); transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}
.role-btn:active { transform: scale(0.97); }
.role-btn.active { border-color: var(--primary); background: var(--primary-light); box-shadow: var(--shadow-md); }
.role-icon { font-size: 2.2rem; }
.role-label { font-size: 1rem; font-weight: 600; }
.schedule-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.schedule-chip { cursor: pointer; }
.schedule-chip input { display: none; }
.schedule-chip span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 16px; border: 2px solid rgba(240,248,245,0.8); border-radius: 30px;
  font-size: 0.95rem; font-weight: 500; background: rgba(255,255,255,0.7); transition: all 0.2s ease;
}
.schedule-chip input:checked + span { border-color: var(--primary); background: rgba(43,108,176,0.08); color: var(--primary); font-weight: 700; }
.color-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.color-dot { width: 36px; height: 36px; border-radius: var(--radius-full); transition: all 0.2s ease; border: 3px solid transparent !important; }
.color-dot.active { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(43,108,176,0.2); transform: scale(1.1); }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 46, 59, 0.5); backdrop-filter: blur(6px);
  z-index: 500; display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
}
/* Onboarding modal uses center alignment for better native app display */
#modal-onboarding.modal-overlay {
  align-items: center;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: rgba(255,255,255,0.96); backdrop-filter: blur(16px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s ease;
  border-top: var(--glass-border);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-onboarding-content {
  border-radius: var(--radius-lg); margin: auto; max-width: 420px;
  text-align: center; animation: scaleIn 0.35s ease; max-height: 92vh;
  overflow-y: auto !important; padding: 20px 20px 28px !important;
}
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.25rem; color: var(--primary-dark); }
.modal-close {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: rgba(240,248,245,0.8); font-size: 1rem; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; transition: background 0.2s ease;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-confirm-content { border-radius: var(--radius-lg); margin: auto; max-width: 360px; text-align: center; animation: scaleIn 0.3s ease; }
.confirm-message { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.5; white-space: pre-line; }

.onboarding-icon { margin-bottom: 6px; }
.onboarding-icon img { width: 64px; height: 64px; object-fit: contain; }
.modal-onboarding-content h1 { font-size: 1.35rem; color: var(--primary-dark); margin-bottom: 2px; }
.onboarding-subtitle { color: var(--text-secondary); margin-bottom: 12px; font-size: 0.9rem; }
.onboard-step { animation: fadeSlideUp 0.3s ease; }

/* Onboarding Tighter Form & Selectors */
.modal-onboarding-content .form-group { margin-bottom: 12px; }
.modal-onboarding-content .form-group label { margin-bottom: 4px; font-size: 0.85rem; }
.modal-onboarding-content .role-selector { max-width: 240px; margin: 0 auto; gap: 12px !important; }



/* ---- Toast ---- */
#toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 400px; width: 90%;
}
.toast {
  background: var(--text-primary); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 500;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(8px);
  animation: toastIn 0.35s ease; pointer-events: auto; text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-20px); } }

/* ---- Install Banner ---- */
#install-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  background: #3182F6;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideDown 0.4s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.install-banner-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.install-banner-text { flex: 1; color: #fff; }
.install-banner-text strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.install-banner-text span { font-size: 0.85rem; opacity: 0.9; }
#install-banner .btn { white-space: nowrap; padding: 10px 20px; font-size: 1rem; background: #fff; color: var(--primary); font-weight: 800; box-shadow: none; }
.install-dismiss { color: rgba(255,255,255,0.7); font-size: 1.2rem; padding: 8px; }

/* ---- Responsive ---- */
@media (min-width: 481px) {
  body { background: #E2EAF4; }
  #app {
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    background: #f8f9fa;
  }
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

/* QR Code Container and styling */
#qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
  min-height: 200px;
}
#qr-container img {
  max-width: 100%;
  height: auto;
  border: 6px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 63, 111, 0.15);
}

/* Custom Time Picker & Chips */
.time-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.time-picker-row select {
  flex: 1;
  background: var(--bg-input);
  border: 2px solid transparent;
  padding: 12px 10px !important;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.time-picker-row select:focus {
  border-color: var(--primary);
}
.selected-times-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 36px;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.time-chip {
  background: #E8F3FF;
  color: #3182F6;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
}
.time-chip-delete {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}
.time-chip-delete:hover {
  background: rgba(0, 0, 0, 0.18);
}

/* Edit & Delete Action Buttons (Text Label version) */
.med-action-btn.btn-text {
  width: auto;
  height: auto;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: none;
  border: none;
}
.med-action-btn.btn-text.edit {
  background: #F2F4F6;
  color: #4E5968;
}
.med-action-btn.btn-text.edit:hover {
  background: #E5E8EB;
  color: #191F28;
}
.med-action-btn.btn-text.delete {
  background: #FFF0F0;
  color: #FF3B3B;
}
.med-action-btn.btn-text.delete:hover {
  background: #FFE0E0;
  color: #E53535;
}

/* ---- Daily Greeting Modal ---- */
.modal-daily-greeting-content {
  background-color: #FFFFFF !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-lg);
  margin: auto;
  max-width: 380px;
  width: 90%;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.35s ease;
  border: 1px solid #E2E8F0;
}
.daily-greeting-message {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.8;
  margin-bottom: 24px;
  word-break: keep-all;
}
.daily-greeting-message .text-accent {
  color: var(--primary) !important;
  font-weight: 900;
}

.empty-state-grandparents {
  width: 140px;
  height: auto;
  object-fit: contain;
  margin-bottom: 16px;
}

/* ---- Safety Alert Banner (안심 무반응 감지) ---- */
.safety-alert-banner {
  background: #FFF5F5;
  border: 1px solid #FFA3A3;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: pulseRedBorder 2s ease-in-out infinite;
}
.safety-alert-icon {
  font-size: 2rem;
  flex-shrink: 0;
  animation: shakeAlert 0.6s ease-in-out infinite;
}
.safety-alert-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 800;
  color: #991B1B;
  line-height: 1.5;
  word-break: keep-all;
}
.safety-alert-text strong {
  color: #DC2626;
}
.btn-alert-call {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 18px;
  background: #F04452;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(240, 68, 82, 0.15);
  transition: transform 0.2s ease;
}
.btn-alert-call:hover { transform: scale(1.05); }
.btn-alert-call:active { transform: scale(0.95); }

@keyframes pulseRedBorder {
  0%, 100% { border-color: rgba(220, 38, 38, 0.5); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
  50% { border-color: rgba(220, 38, 38, 0.9); box-shadow: 0 0 12px 2px rgba(220, 38, 38, 0.2); }
}
@keyframes shakeAlert {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}

/* No-response danger badge */
.monitor-slot-badge.no-response {
  background: #FF3B3B !important;
  color: #fff !important;
  font-weight: 800;
  border: none !important;
}
/* Active but missed (지각 미복용) badge */
.monitor-slot-badge.active-missed {
  background: #FF9500 !important;
  color: #fff !important;
  font-weight: 800;
  border: none !important;
}
@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---- Premium Report Tab Styles ---- */
.premium-paywall {
  text-align: center;
  padding: 40px 20px;
  background: #F2F4F6;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(49, 130, 246, 0.3);
}
.premium-paywall .paywall-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
}
.premium-paywall h3 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.premium-paywall p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  word-break: keep-all;
}
.premium-paywall .paywall-features {
  text-align: left;
  max-width: 280px;
  margin: 0 auto 24px;
}
.premium-paywall .paywall-features li {
  padding: 6px 0;
  font-size: 0.93rem;
  color: var(--text-secondary);
  list-style: none;
}
.premium-paywall .paywall-features li::before {
  content: '✅ ';
}
.btn-premium-subscribe {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #3182F6;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(49, 130, 246, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-premium-subscribe:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(49, 130, 246, 0.35); }
.btn-premium-subscribe:active { transform: scale(0.97); }
.paywall-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Premium Report Dashboard */
.report-month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.report-month-selector button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.report-month-selector button:hover { background: var(--primary); color: #fff; }
.report-month-selector .month-label {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.report-summary-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.report-summary-ring svg {
  width: 160px; height: 160px;
}
.ring-center-text {
  font-size: 2.2rem;
  font-weight: 900;
}
.ring-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.report-stat-card {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
.report-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #3182F6;
}
.report-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #191F28;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-weekly-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 4px;
  height: 140px;
  padding: 0 8px;
  margin-bottom: 24px;
  background: #FFFFFF;
  border-radius: 18px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  padding-top: 16px;
  padding-bottom: 12px;
}
.chart-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 4px;
}
.chart-bar.high { background: linear-gradient(180deg, #00B57A, #009664); }
.chart-bar.mid  { background: linear-gradient(180deg, #FF9500, #E08400); }
.chart-bar.low  { background: linear-gradient(180deg, #F04452, #D83A47); }
.chart-bar.inactive { background: #E5E7EB; }
.chart-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.chart-bar-value {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.report-vulnerable-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.report-vulnerable-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 12px 16px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
.vuln-icon { font-size: 1.4rem; flex-shrink: 0; }
.vuln-info { flex: 1; }
.vuln-time { font-weight: 800; font-size: 0.95rem; color: #191F28; }
.vuln-count { font-size: 0.8rem; color: var(--text-muted); }
.vuln-bar-bg {
  flex-shrink: 0;
  width: 60px; height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.vuln-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #EF4444, #F97316);
}

.report-med-ranking {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.report-med-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 14px 16px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
.rank-number {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  width: 28px;
  text-align: center;
}
.rank-info { flex: 1; }
.rank-name { font-weight: 800; font-size: 0.95rem; color: var(--text-primary); }
.rank-detail { font-size: 0.8rem; color: var(--text-muted); }
.rank-rate {
  font-size: 1.2rem;
  font-weight: 900;
}
.rank-rate.high { color: #22C55E; }
.rank-rate.mid  { color: #F59E0B; }
.rank-rate.low  { color: #EF4444; }

.btn-download-report {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: #3182F6;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(49, 130, 246, 0.2);
  transition: transform 0.2s;
  margin-bottom: 16px;
}
.btn-download-report:hover { transform: translateY(-2px); }
.btn-download-report:active { transform: scale(0.97); }

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #3182F6;
  color: #fff;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: 8px;
  vertical-align: middle;
}

.report-patient-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.report-patient-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: #F2F4F6;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: #4E5968;
}
.report-patient-btn.active {
  background: #3182F6;
  color: #fff;
  border: none;
}

/* ---- Guardian Monitor Top Selector Bar ---- */
.guardian-monitor-selector {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: none;
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  align-items: center;
}
.monitor-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  width: 60px;
}
.monitor-avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.monitor-avatar-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
/* Active State */
.monitor-avatar-item.active .monitor-avatar-circle {
  border-color: #3182F6;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(49,130,246,0.15);
  transform: translateY(-2px);
}
.monitor-avatar-item.active .monitor-avatar-name {
  color: #3182F6;
  font-weight: 800;
}
/* Add Button Styling */
.monitor-avatar-item.add-btn .monitor-avatar-circle {
  background: rgba(0,0,0,0.02);
  border: 2px dashed var(--border-color);
  color: var(--text-muted);
  font-weight: bold;
  font-size: 1.4rem;
}
.monitor-avatar-item.add-btn:hover .monitor-avatar-circle {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245,158,11,0.06);
}

/* Image-based selector buttons (Role & Gender Selection) */
.role-btn-image, .gender-btn-image {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  border: 3.5px solid var(--border-color) !important;
  border-radius: 16px !important;
  background: none !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
}
.role-btn-image img, .gender-btn-image img {
  width: 100% !important;
  display: block !important;
  object-fit: cover !important;
  transition: opacity 0.22s ease !important;
}
.role-btn-image.active, .gender-btn-image.active {
  border-color: var(--primary) !important;
  box-shadow: 0 8px 24px rgba(45, 125, 154, 0.2) !important;
  transform: translateY(-3px) !important;
}
.role-btn-image:not(.active) img, .gender-btn-image:not(.active) img {
  opacity: 0.65 !important;
}
.role-btn-image.active img, .gender-btn-image.active img {
  opacity: 1 !important;
}

/* ---- Voice Guide Banner & Recording Buttons ---- */
.voice-guide-banner {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  word-break: keep-all;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transition: all 0.25s ease;
}

.pulse-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.25);
  animation: pulseScale 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
  z-index: 1;
}
#voice-pulse-ring2 {
  animation-delay: 0.6s;
}
@keyframes pulseScale {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}
.btn-record-main:hover {
  transform: scale(1.05);
}
.btn-record-main:active {
  transform: scale(0.95);
}

/* ---- Voice Messages List Style ---- */
.voice-msg-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.voice-msg-card:active {
  transform: scale(0.98);
}
.voice-msg-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.voice-msg-sender {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-msg-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.voice-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}

/* ---- Remote Medications List Style ---- */
.remote-med-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.remote-med-info {
  flex: 1;
}
.remote-med-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.remote-med-time {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 2px;
}

/* ---- Anomaly Telemetry Report Style ---- */
.anomaly-section {
  background: rgba(239, 68, 68, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}
.anomaly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.anomaly-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--danger-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.anomaly-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  background: var(--danger);
  color: #fff;
  border-radius: 12px;
}
.anomaly-commentary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: keep-all;
  margin: 0;
  text-align: left;
}

/* ---- Pull to Refresh Styles ---- */
#pull-to-refresh-indicator {
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translate(-50%, 0) scale(0.8);
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: transform 0.15s ease, opacity 0.15s ease, top 0.1s ease-out;
  opacity: 0;
  pointer-events: none;
}
#pull-to-refresh-indicator.visible {
  opacity: 1;
}
#pull-to-refresh-indicator .refresh-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(45, 125, 154, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rotateSpinner 0.8s linear infinite;
  display: none;
}
#pull-to-refresh-indicator .refresh-arrow {
  font-size: 1.1rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  display: block;
}
#pull-to-refresh-indicator.refreshing .refresh-arrow {
  display: none;
}
#pull-to-refresh-indicator.refreshing .refresh-spinner {
  display: block;
}

@keyframes rotateSpinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body.pulling {
  user-select: none;
}

/* ---- Family Album Styles ---- */
.album-slide-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid #E2E8F0;
}
.album-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  animation: fadeIn 0.4s ease;
}
.album-img.active {
  display: block;
}
.album-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}
.album-nav:hover { background: #FFFFFF; }
.album-nav:active { transform: translateY(-50%) scale(0.9); }
.album-nav.prev { left: 10px; }
.album-nav.next { right: 10px; }

.album-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 12;
  transition: transform 0.2s, background 0.2s;
}
.album-delete-btn:hover { background: #DC2626; }
.album-delete-btn:active { transform: scale(0.9); }

.album-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.album-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  cursor: pointer;
  transition: background 0.2s;
}
.album-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 4px;
}



/* ---- Watermark Logo (Tab Sections) ---- */
.tab-watermark-logo {
  display: none !important;
}
#tab-home, #tab-meds, #tab-history {
  position: relative;
  overflow: visible;
}

/* ---- Monitor Header Shield Logo ---- */
.monitor-header-shield {
  width: 26px;
  height: 26px;
  opacity: 0.5;
  margin-left: auto;
  filter: grayscale(30%);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ==========================================
   INTERACTIVE TUTORIAL STYLES
   ========================================== */
#interactive-tutorial-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  max-width: 460px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  padding: 20px 24px;
  border-radius: 20px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.3);
  z-index: 999999;
  text-align: center;
  font-size: 1.22rem;
  font-weight: 800;
  border: 3px solid var(--accent);
  box-sizing: border-box;
  animation: slideInDown 0.4s ease;
  line-height: 1.55;
}

@keyframes slideInDown {
  from { transform: translate(-50%, -100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.tutorial-highlight {
  position: relative !important;
  z-index: 1000000 !important;
  outline: 6px solid #F59E0B !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 25px #F59E0B !important;
  animation: pulseHighlight 1.5s infinite alternate !important;
  transition: all 0.3s ease !important;
}

@keyframes pulseHighlight {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

.tutorial-pulse-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #F59E0B;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000001;
  box-shadow: 0 0 12px #F59E0B;
  animation: pulseDot 1.2s infinite ease-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Font Size Accessibility Zoom Controls */
.zoom-action-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #FFFFFF;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 15px !important; /* Fixed pixel size to prevent scaling */
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.zoom-action-btn:active:not(:disabled) {
  transform: scale(0.9);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.zoom-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Root font scaling configurations */
html.zoom-12 {
  font-size: 116% !important; /* Scale text by 1.16x */
}
html.zoom-15 {
  font-size: 132% !important; /* Scale text by 1.32x */
}

/* ---- Smart Review Prompt Modal ---- */
.review-prompt-modal-content {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5FBF6 100%);
  border-radius: var(--radius-lg, 24px);
  padding: 32px 24px 24px 24px;
  max-width: 360px;
  width: 90%;
  margin: auto;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  border-top: 6px solid var(--primary, #2D6A4F);
  animation: scaleIn 0.3s ease;
  position: relative;
}

.review-prompt-icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: bounce 2s infinite;
}

.review-prompt-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-primary, #1E293B);
  margin-bottom: 8px;
  word-break: keep-all;
  line-height: 1.4;
}

.review-prompt-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #64748B);
  line-height: 1.55;
  margin-bottom: 24px;
  word-break: keep-all;
}

.review-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-close-link {
  background: transparent;
  border: none;
  color: var(--text-muted, #94A3B8);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  margin-top: 4px;
  text-decoration: underline;
  transition: color 0.2s;
}

.review-close-link:hover {
  color: var(--text-secondary, #64748B);
}



