:root {
  --color-bg: #f8fbfb;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-overlay: #f0fafa;
  --color-text-main: #2d3748;
  --color-text-muted: #718096;

  /* Calming Medical / Support Palette */
  --color-primary: #319795;
  --color-primary-light: #e6fffa;
  --color-secondary: #3182ce;
  --color-secondary-light: #ebf8ff;
  --color-accent: #805ad5;
  --color-accent-light: #faf5ff;
  --color-success: #48bb78;
  --color-success-light: #f0fff4;
  --color-warning: #f6ad55;
  --color-warning-light: #fffff0;
  --color-info: #63b3ed;
  --color-info-light: #ebf8ff;
  --color-error: #e53e3e;
  --color-error-light: #fed7d7;
  --color-background-app: #f7fafc;

  /* Warm accent */
  --color-warm-accent: #f6ad55;
  --color-warm-accent-light: #fffbf0;

  --color-border: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow-primary:
    0 0 20px rgba(49, 151, 149, 0.15), 0 4px 12px rgba(49, 151, 149, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-primary:
    0 8px 25px rgba(49, 151, 149, 0.25), 0 3px 8px rgba(49, 151, 149, 0.15);
  --shadow-warm: 0 8px 25px rgba(246, 173, 85, 0.25);

  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Transition tokens */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 48px;
  --space-12: 96px;

  /* Type scale */
  --text-xs: 0.72rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-md: 1.05rem;
  --text-lg: 1.15rem;
  --text-xl: 1.3rem;
  --text-2xl: 1.6rem;
  --text-3xl: 2.2rem;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #319795 0%, #2c7a7b 100%);
  --gradient-warm: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
  --gradient-purple: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
  --gradient-cool: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
  --gradient-hero: linear-gradient(
    135deg,
    #0d1b2a 0%,
    #1a365d 50%,
    #2a4a7f 100%
  );

  /* Ambient background gradients */
  --bg-ambient-1: radial-gradient(
    ellipse at 15% 40%,
    rgba(49, 151, 149, 0.07) 0%,
    transparent 55%
  );
  --bg-ambient-2: radial-gradient(
    ellipse at 85% 15%,
    rgba(128, 90, 213, 0.05) 0%,
    transparent 50%
  );
  --bg-ambient-3: radial-gradient(
    ellipse at 50% 90%,
    rgba(49, 130, 206, 0.04) 0%,
    transparent 45%
  );
}

body.dark-theme {
  /* 3-Layer Elevation System — Modern Dark Mode */
  --color-bg: #0a0f1a; /* Canvas — deepest layer */
  --color-surface: #111827; /* Cards — layer 1 */
  --color-surface-raised: #1f2937; /* Hover/focused cards — layer 2 */
  --color-surface-overlay: #273549; /* Modals, dropdowns — layer 3 */
  --color-text-main: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-primary-light: #134e4a;
  --color-secondary-light: #1e3a5f;
  --color-accent-light: #3b2f6b;
  --color-success-light: #14532d;
  --color-warning-light: #431407;
  --color-info-light: #431407;
  --color-error: #fc8181;
  --color-error-light: #7f1d1d;
  --color-background-app: #0a0f1a;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);

  /* Dark ambient — more dramatic, moody glows */
  /* --bg-image removed for readability */
  --bg-ambient-1: radial-gradient(
    ellipse at 15% 40%,
    rgba(49, 151, 149, 0.12) 0%,
    transparent 55%
  );
  --bg-ambient-2: radial-gradient(
    ellipse at 85% 15%,
    rgba(128, 90, 213, 0.09) 0%,
    transparent 50%
  );
  --bg-ambient-3: radial-gradient(
    ellipse at 50% 90%,
    rgba(49, 130, 206, 0.06) 0%,
    transparent 45%
  );
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", "Inter", sans-serif;
  background-color: var(--color-bg);
  background-image:
    var(--bg-ambient-1), var(--bg-ambient-2), var(--bg-ambient-3);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--color-text-main);
  overscroll-behavior-y: none;
  line-height: 1.6;
  font-size: 1.05rem; /* Accessibility: Larger base font */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

input,
textarea,
select,
button {
  font-family: inherit;
  color: var(--color-text-main);
  background-color: var(--color-bg); /* Forces dark background in dark mode */
}

/* Splash Screen & CLS Prevention */
body:not(.app-ready) .app-header,
body:not(.app-ready) .app-content,
body:not(.app-ready) .app-footer,
body:not(.app-ready) .bottom-nav {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.8s ease-in-out,
    visibility 0.8s;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-brand {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 1.2s ease-out;
}

.splash-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: #1a365d;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

body.dark-theme .splash-title {
  color: #90cdf4;
}

.splash-plus {
  color: #319795;
  font-weight: 800;
  font-size: 2.6rem;
}

.splash-tagline {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  color: #718096;
  letter-spacing: 4px;
  text-transform: uppercase;
}

body.dark-theme .splash-tagline {
  color: #a0aec0;
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.breathing-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--color-primary-light) 0%,
    var(--color-primary) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(49, 151, 149, 0.4);
  animation: breathe 8s infinite ease-in-out;
  margin-bottom: 2rem;
}

.breathing-text {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
}

.splash-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  text-align: center;
  max-width: 80%;
  margin-bottom: 3rem;
}

.skip-btn {
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.skip-btn:hover {
  background-color: var(--color-surface);
  color: var(--color-text-main);
}

@keyframes breathe {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 10px rgba(49, 151, 149, 0.2);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 40px rgba(49, 151, 149, 0.6);
  }
  100% {
    transform: scale(0.8);
    box-shadow: 0 0 10px rgba(49, 151, 149, 0.2);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkmarkDraw {
  from {
    stroke-dashoffset: 100;
    opacity: 0;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  60% {
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseSuccess {
  0% {
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(72, 187, 120, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  75% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes staggerFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header — Glassmorphism */
.app-header {
  background-color: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  padding: 1rem;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.06),
    0 2px 12px rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

body.dark-theme .app-header {
  background-color: rgba(15, 23, 42, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-title-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.header-title-container h1 {
  pointer-events: auto;
}

.back-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
  margin-right: 0.5rem;
}

.back-btn:hover {
  background-color: var(--color-primary-light);
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

.back-btn.hidden {
  display: flex !important;
  visibility: hidden !important; /* Keep layout balanced and override general hidden display:none */
}

.info-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
  margin-left: 0.5rem;
}

.info-btn:hover {
  background-color: var(--color-primary-light);
}

.info-btn svg {
  width: 24px;
  height: 24px;
}

.hidden {
  display: none !important;
}

.app-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a365d; /* Navy Blue to match logo */
  margin: 0;
  flex-grow: 1;
  text-align: center;
  letter-spacing: -0.2px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}
.app-title:active {
  opacity: 0.7;
}

body.dark-theme .app-title {
  color: #90cdf4;
}

/* Content Area */
.app-content {
  flex-grow: 1;
  padding: 1.5rem 1rem 5.5rem 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  transition: opacity 0.2s ease-in-out;
}

/* Slide-in animation for view transitions */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-slide-in {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.view-slide-up {
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Home View */
.welcome-section {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-section h2 {
  font-size: 1.75rem;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.welcome-section p {
  color: var(--color-text-muted);
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Staggered card entry animation */
.categories-grid .category-card {
  animation: cardEntrance 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.categories-grid .category-card:nth-child(1) {
  animation-delay: 0ms;
}
.categories-grid .category-card:nth-child(2) {
  animation-delay: 70ms;
}
.categories-grid .category-card:nth-child(3) {
  animation-delay: 140ms;
}
.categories-grid .category-card:nth-child(4) {
  animation-delay: 210ms;
}
.categories-grid .category-card:nth-child(5) {
  animation-delay: 280ms;
}
.categories-grid .category-card:nth-child(6) {
  animation-delay: 350ms;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.category-card {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(226, 232, 240, 0.5);
  position: relative;
  overflow: hidden;
}

body.dark-theme .category-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.category-card:hover,
.category-card:active {
  transform: translateY(-5px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(49, 151, 149, 0.1);
  border-color: rgba(49, 151, 149, 0.3);
}

body.dark-theme .category-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem auto;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Glass sheen overlay — works with ANY inline background-color */
.card-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    transparent 100%
  );
  pointer-events: none;
  transition: opacity 0.3s;
}

.card-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  transition: var(--transition);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

/* Filled SVG shapes for depth — first shape gets translucent fill */
.card-icon svg > path:first-child,
.card-icon svg > rect:first-child,
.card-icon svg > circle:first-of-type {
  fill: currentColor;
  fill-opacity: 0.1;
}

/* Light Mode Gradients & Soft Inner Borders for Icons */
.category-card[data-view="pillar-guide"] .card-icon {
  background: linear-gradient(145deg, #e6fffa 0%, #b2f5ea 60%, #81e6d9 100%);
  color: var(--color-primary);
  border: 1px solid rgba(49, 151, 149, 0.15);
  box-shadow:
    0 4px 14px rgba(49, 151, 149, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.category-card[data-view="pillar-hospital"] .card-icon {
  background: linear-gradient(145deg, #ebf8ff 0%, #bee3f8 60%, #90cdf4 100%);
  color: var(--color-secondary);
  border: 1px solid rgba(49, 130, 206, 0.15);
  box-shadow:
    0 4px 14px rgba(49, 130, 206, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.category-card[data-view="pillar-tools"] .card-icon {
  background: linear-gradient(145deg, #f0fff4 0%, #c6f6d5 60%, #9ae6b4 100%);
  color: var(--color-success);
  border: 1px solid rgba(56, 161, 105, 0.15);
  box-shadow:
    0 4px 14px rgba(56, 161, 105, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.category-card[data-view="pillar-info"] .card-icon {
  background: linear-gradient(145deg, #fffff0 0%, #fefcbf 60%, #faf089 100%);
  color: var(--color-warning);
  border: 1px solid rgba(214, 158, 46, 0.15);
  box-shadow:
    0 4px 14px rgba(214, 158, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Dark Mode Overrides for Icons */
body.dark-theme .category-card[data-view="pillar-guide"] .card-icon {
  background: linear-gradient(
    145deg,
    rgba(49, 151, 149, 0.18) 0%,
    rgba(49, 151, 149, 0.06) 100%
  );
  border: 1px solid rgba(49, 151, 149, 0.25);
  box-shadow:
    0 4px 16px rgba(49, 151, 149, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #4fd1c5;
}
body.dark-theme .category-card[data-view="pillar-hospital"] .card-icon {
  background: linear-gradient(
    145deg,
    rgba(49, 130, 206, 0.18) 0%,
    rgba(49, 130, 206, 0.06) 100%
  );
  border: 1px solid rgba(49, 130, 206, 0.25);
  box-shadow:
    0 4px 16px rgba(49, 130, 206, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #63b3ed;
}
body.dark-theme .category-card[data-view="pillar-tools"] .card-icon {
  background: linear-gradient(
    145deg,
    rgba(56, 161, 105, 0.18) 0%,
    rgba(56, 161, 105, 0.06) 100%
  );
  border: 1px solid rgba(56, 161, 105, 0.25);
  box-shadow:
    0 4px 16px rgba(56, 161, 105, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #68d391;
}
body.dark-theme .category-card[data-view="pillar-info"] .card-icon {
  background: linear-gradient(
    145deg,
    rgba(214, 158, 46, 0.18) 0%,
    rgba(214, 158, 46, 0.06) 100%
  );
  border: 1px solid rgba(214, 158, 46, 0.25);
  box-shadow:
    0 4px 16px rgba(214, 158, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #f6e05e;
}

/* Dark mode glass sheen - subtler */
body.dark-theme .card-icon::after {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    transparent 100%
  );
}

/* Dark mode SVG fill more visible */
body.dark-theme .card-icon svg > path:first-child,
body.dark-theme .card-icon svg > rect:first-child,
body.dark-theme .card-icon svg > circle:first-of-type {
  fill-opacity: 0.15;
}

/* Premium Hover Glowing States */
.category-card:hover[data-view="pillar-guide"] .card-icon {
  box-shadow: 0 6px 22px rgba(49, 151, 149, 0.28);
  transform: translateY(-2px) scale(1.06);
}
.category-card:hover[data-view="pillar-hospital"] .card-icon {
  box-shadow: 0 6px 22px rgba(49, 130, 206, 0.28);
  transform: translateY(-2px) scale(1.06);
}
.category-card:hover[data-view="pillar-tools"] .card-icon {
  box-shadow: 0 6px 22px rgba(56, 161, 105, 0.28);
  transform: translateY(-2px) scale(1.06);
}
.category-card:hover[data-view="pillar-info"] .card-icon {
  box-shadow: 0 6px 22px rgba(214, 158, 46, 0.28);
  transform: translateY(-2px) scale(1.06);
}

/* Dark mode hover glows — neon ring effect */
body.dark-theme .category-card:hover[data-view="pillar-guide"] .card-icon {
  box-shadow:
    0 6px 24px rgba(79, 209, 197, 0.2),
    0 0 0 1px rgba(79, 209, 197, 0.3);
}
body.dark-theme .category-card:hover[data-view="pillar-hospital"] .card-icon {
  box-shadow:
    0 6px 24px rgba(99, 179, 237, 0.2),
    0 0 0 1px rgba(99, 179, 237, 0.3);
}
body.dark-theme .category-card:hover[data-view="pillar-tools"] .card-icon {
  box-shadow:
    0 6px 24px rgba(104, 211, 145, 0.2),
    0 0 0 1px rgba(104, 211, 145, 0.3);
}
body.dark-theme .category-card:hover[data-view="pillar-info"] .card-icon {
  box-shadow:
    0 6px 24px rgba(246, 224, 94, 0.15),
    0 0 0 1px rgba(246, 224, 94, 0.25);
}

/* Sub-card hover glow — colored ambient shadow */
.category-card:hover .card-icon {
  transform: translateY(-2px) scale(1.06);
}

/* Full-card ambient glow per icon color on hover */
.category-card[data-view="preparation"]:hover,
.category-card[data-view="discharge"]:hover {
  box-shadow:
    0 12px 28px rgba(49, 151, 149, 0.14),
    0 0 0 1px rgba(49, 151, 149, 0.08);
}
.category-card[data-view="hospital"]:hover,
.category-card[data-view="psychology"]:hover,
.category-card[data-view="contacts"]:hover {
  box-shadow:
    0 12px 28px rgba(49, 130, 206, 0.14),
    0 0 0 1px rgba(49, 130, 206, 0.08);
}
.category-card[data-view="vitals"]:hover,
.category-card[data-view="expenses"]:hover {
  box-shadow:
    0 12px 28px rgba(214, 158, 46, 0.14),
    0 0 0 1px rgba(214, 158, 46, 0.08);
}
.category-card[data-view="reminders"]:hover,
.category-card[data-view="calendar"]:hover {
  box-shadow:
    0 12px 28px rgba(56, 161, 105, 0.14),
    0 0 0 1px rgba(56, 161, 105, 0.08);
}
.category-card[data-view="spiritual"]:hover,
.category-card[data-view="personal-notes"]:hover {
  box-shadow:
    0 12px 28px rgba(128, 90, 213, 0.14),
    0 0 0 1px rgba(128, 90, 213, 0.08);
}
.category-card[data-view="first-aid"]:hover {
  box-shadow:
    0 12px 28px rgba(229, 62, 62, 0.14),
    0 0 0 1px rgba(229, 62, 62, 0.08);
}

/* Custom Premium Icon Styles */
.premium-vector-icon {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.category-card:hover .premium-vector-icon {
  transform: scale(1.1);
}

/* Ambient sparkle animation (always on, subtle) */
.icon-sparkle {
  animation: sparkleIdle 3s ease-in-out infinite;
}

/* Premium Icon micro-animations on hover */
.category-card:hover .icon-badge {
  animation: iconBadgePulse 1s ease-in-out infinite alternate;
}
.category-card:hover .icon-sparkle {
  animation: sparkleFloat 2s ease-in-out infinite;
}

/* Badge elements get subtle glow */
.icon-badge {
  filter: drop-shadow(0 0 2px currentColor);
  transition: filter 0.3s;
}

.category-card:hover .icon-badge {
  filter: drop-shadow(0 0 6px currentColor);
}

@keyframes iconBadgePulse {
  0% {
    stroke-width: 1.8px;
    filter: drop-shadow(0 0 2px currentColor);
  }
  100% {
    stroke-width: 2.4px;
    filter: drop-shadow(0 0 8px currentColor);
  }
}

@keyframes sparkleIdle {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

@keyframes sparkleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-3px) scale(1.3);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
}

.category-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--color-text-main);
  font-weight: 700;
}

.category-card p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Generic View Headers */
.view-header {
  margin-bottom: 1.5rem;
}

.view-header h2 {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.view-header p {
  color: var(--color-text-muted);
}

/* Info Lists & Cards */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary);
}

.info-card.highlight-accent {
  border-left-color: var(--color-accent);
}

.info-card.highlight-primary {
  border-left-color: var(--color-primary);
}

.info-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.info-card p,
.info-card li {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.info-card ul {
  margin-left: 1.25rem;
  margin-top: 0.5rem;
}

.info-card li {
  margin-bottom: 0.5rem;
}

/* Checklists */
.checklist-section h3 {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--color-secondary);
}

.checklist {
  list-style: none;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.checklist li {
  border-bottom: 1px solid var(--color-border);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist label {
  display: flex;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.checklist label:hover {
  background-color: var(--color-bg);
}

.checklist input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  margin-right: 1rem;
  display: grid;
  place-content: center;
  transition: var(--transition);
  cursor: pointer;
}

.checklist input[type="checkbox"]::before {
  content: "";
  width: 14px;
  height: 14px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em white;
  background-color: white;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checklist input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.checklist input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.checklist input[type="checkbox"]:checked + span,
.checklist label:has(input:checked) {
  color: var(--color-text-muted);
  text-decoration: line-through;
  opacity: 0.8;
}

/* Contacts */
.contact-card {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.contact-name {
  font-weight: 500;
}

.contact-number a {
  display: inline-block;
  background-color: var(--color-success-light);
  color: var(--color-success);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.contact-number a:hover {
  background-color: var(--color-success);
  color: white;
}

.custom-notes {
  margin-top: 1.5rem;
}

.notes-area {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: var(--transition);
}

.notes-area:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Carousel for Psychological Support */
.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding-bottom: 1.5rem; /* space for scrollbar */
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none; /* Firefox */
}
.carousel-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.carousel-card {
  flex: 0 0 85%;
  scroll-snap-align: center;
  background: linear-gradient(
    135deg,
    var(--color-secondary-light),
    var(--color-surface)
  );
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-secondary-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 200px;
}
.carousel-card h4 {
  color: var(--color-secondary);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.spiritual-card {
  background: linear-gradient(135deg, #faf5ff, var(--color-surface));
  border-color: #faf5ff;
}
.spiritual-card h4 {
  color: #805ad5;
}

/* 3-Step Infographic Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: var(--color-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-number {
  position: absolute;
  left: -2rem;
  top: 0;
  width: 24px;
  height: 24px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px var(--color-bg);
}
.timeline-content {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.timeline-content h4 {
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

/* Full Monthly Calendar */
.calendar-container {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cal-nav-btn {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.cal-nav-btn:hover {
  background: var(--color-primary);
  color: white;
}

#calendar-month-year {
  font-size: 1.1rem;
  color: var(--color-text-main);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.calendar-day:hover:not(.empty) {
  background-color: var(--color-secondary-light);
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.today {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: bold;
}

.calendar-day.selected {
  background-color: var(--color-primary);
  color: white;
  font-weight: bold;
}

.calendar-day.has-notes::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.calendar-day.selected.has-notes::after {
  background-color: white;
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.modal-overlay.hidden-modal {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 90%;
  width: 500px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(0);
  transition: transform 0.3s ease;
  margin: auto;
}

.modal-overlay.hidden-modal .modal-content {
  transform: translateY(20px);
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--color-text-muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.close-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-text-main);
}

.app-version-trigger {
  appearance: none;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: white;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-version-trigger:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.app-version-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  outline-offset: 3px;
}

.whats-new-modal-content {
  width: min(440px, 100%);
  max-width: 100%;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
}

.whats-new-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-right: 2.5rem;
  margin-bottom: 0.75rem;
}

.whats-new-version {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
}

.whats-new-date {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.whats-new-modal-content h2 {
  margin: 0;
  color: var(--color-text-main);
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: 0;
}

#whats-new-intro {
  margin: 0.45rem 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.whats-new-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.whats-new-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0;
  border-top: 1px solid var(--color-border);
}

.whats-new-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
}

.whats-new-list li:nth-child(2) .whats-new-marker {
  background: color-mix(in srgb, #3182ce 18%, transparent);
  color: #3182ce;
}

.whats-new-list li:nth-child(3) .whats-new-marker {
  background: color-mix(in srgb, #805ad5 18%, transparent);
  color: #805ad5;
}

.whats-new-list li:nth-child(4) .whats-new-marker {
  background: color-mix(in srgb, #d69e2e 18%, transparent);
  color: #b7791f;
}

.whats-new-list h3 {
  margin: 0;
  color: var(--color-text-main);
  font-size: 0.93rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.whats-new-list p {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.whats-new-assurance {
  margin: 0.85rem 0;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-text-main);
  font-size: 0.8rem;
  line-height: 1.45;
}

.whats-new-dismiss {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: white;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.whats-new-dismiss:hover {
  filter: brightness(1.08);
}

.whats-new-dismiss:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .whats-new-modal-content {
    padding: 1.25rem 1rem 1rem;
    max-height: 86vh;
  }

  .whats-new-list li {
    padding: 0.7rem 0;
  }
}

/* Dark Theme Custom Overrides */
body.dark-theme svg circle[stroke="#1A365D"] {
  stroke: #90cdf4 !important;
}
body.dark-theme .app-header svg circle[stroke="#1A365D"] {
  stroke: #90cdf4 !important;
}
body.dark-theme .app-title {
  color: #90cdf4 !important;
}
body.dark-theme #splash-screen {
  background-color: var(--color-bg);
}
body.dark-theme #splash-screen svg circle[stroke="#1A365D"] {
  stroke: #90cdf4 !important;
}
body.dark-theme #splash-screen .breathing-text {
  background: rgba(45, 55, 72, 0.9);
  color: var(--color-primary);
}
body.dark-theme .theme-btn:hover {
  background-color: var(--color-primary-light);
}

/* Reminders & Medication Component Styling */
.reminder-card {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-warning);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reminder-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reminder-time-badge {
  display: inline-block;
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  width: fit-content;
}

body.dark-theme .reminder-time-badge {
  background-color: #5f370e;
  color: #f6ad55;
}

.reminder-delete-btn {
  background: none;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.reminder-delete-btn:hover {
  background-color: #fff5f5;
}

body.dark-theme .reminder-delete-btn:hover {
  background-color: #feb2b220;
}

/* ==========================================
   Premium Welcome Card
   ========================================== */
.welcome-card {
  background: linear-gradient(
    145deg,
    rgba(230, 255, 250, 0.9) 0%,
    rgba(235, 248, 255, 0.8) 50%,
    rgba(250, 245, 255, 0.85) 100%
  );
  border-radius: calc(var(--border-radius) + 4px);
  padding: 2.5rem 1.5rem 2rem 1.5rem;
  text-align: center;
  box-shadow:
    0 8px 32px rgba(49, 151, 149, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  border: 1px solid rgba(49, 151, 149, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer overlay on welcome card */
.welcome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.welcome-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

body.dark-theme .welcome-card {
  background: linear-gradient(
    145deg,
    rgba(19, 78, 74, 0.3) 0%,
    rgba(30, 60, 95, 0.25) 50%,
    rgba(59, 47, 107, 0.2) 100%
  );
  border: 1px solid rgba(79, 209, 197, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(79, 209, 197, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-theme .welcome-card::before {
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 60%
  );
}

.welcome-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  position: relative;
}

/* Ambient glow halo behind the SVG figure */
.welcome-card-logo::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(49, 151, 149, 0.18) 0%,
    rgba(49, 130, 206, 0.08) 45%,
    transparent 70%
  );
  animation: haloGlow 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.welcome-card-logo svg {
  position: relative;
  z-index: 1;
}

@keyframes haloGlow {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

body.dark-theme .welcome-card-logo::before {
  background: radial-gradient(
    ellipse at center,
    rgba(79, 209, 197, 0.22) 0%,
    rgba(99, 179, 237, 0.1) 45%,
    transparent 70%
  );
}

/* Adapt SVG strokes in dark mode */
body.dark-theme .welcome-card-logo svg path:not(.animated-heart) {
  stroke: #edf2f7 !important;
}

.welcome-card-title {
  font-family:
    "Outfit",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #1a365d 0%, #319795 50%, #3182ce 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0.6rem 0 0.3rem 0 !important;
}

body.dark-theme .welcome-card-title {
  background: linear-gradient(135deg, #90cdf4 0%, #4fd1c5 50%, #63b3ed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-card-subtitle {
  font-family: "Outfit", "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-primary);
  margin: 0 !important;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  opacity: 0.75;
}

body.dark-theme .welcome-card-subtitle {
  color: #4fd1c5;
  opacity: 0.7;
}

/* Animations for Logo to make it feel alive (micro-animations) */
@keyframes heartPulse {
  0% {
    transform: scale(1);
    transform-origin: 100px 85px;
  }
  50% {
    transform: scale(1.08);
    transform-origin: 100px 85px;
  }
  100% {
    transform: scale(1);
    transform-origin: 100px 85px;
  }
}

.animated-heart {
  animation: heartPulse 3s infinite ease-in-out;
}

@keyframes haloBreathe {
  0% {
    opacity: 0.5;
    stroke-dashoffset: 0;
  }
  50% {
    opacity: 0.85;
    stroke-dashoffset: 5;
  }
  100% {
    opacity: 0.5;
    stroke-dashoffset: 0;
  }
}

.animated-halo {
  animation: haloBreathe 4s infinite ease-in-out;
}

@keyframes handGentlySwayLeft {
  0% {
    transform: rotate(0deg);
    transform-origin: 76px 169px;
  }
  50% {
    transform: rotate(-2deg);
    transform-origin: 76px 169px;
  }
  100% {
    transform: rotate(0deg);
    transform-origin: 76px 169px;
  }
}

@keyframes handGentlySwayRight {
  0% {
    transform: rotate(0deg);
    transform-origin: 124px 169px;
  }
  50% {
    transform: rotate(2deg);
    transform-origin: 124px 169px;
  }
  100% {
    transform: rotate(0deg);
    transform-origin: 124px 169px;
  }
}

.animated-hand-left {
  animation: handGentlySwayLeft 5s infinite ease-in-out;
}

.animated-hand-right {
  animation: handGentlySwayRight 5s infinite ease-in-out;
}

/* ==========================================
   SOS / Emergency Widget
   ========================================== */
.emergency-widget {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border-radius: var(--border-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-left: 5px solid #e53e3e;
  border-top: 1px solid #feb2b2;
  border-right: 1px solid #feb2b2;
  border-bottom: 1px solid #feb2b2;
  transition: var(--transition);
}

.emergency-widget:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.emergency-widget-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.emergency-widget-icon {
  font-size: 2.2rem;
  animation: pulseRed 2s infinite ease-in-out;
}

.emergency-widget-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #9b2c2c;
  margin: 0 0 0.1rem 0;
}

.emergency-widget-info p {
  font-size: 0.85rem;
  color: #c53030;
  margin: 0;
}

.emergency-widget-btn {
  background-color: #e53e3e;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(229, 62, 62, 0.2);
}

.emergency-widget-btn:hover {
  background-color: #c53030;
  transform: scale(1.05);
}

@keyframes pulseRed {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 6px rgba(229, 62, 62, 0.5));
  }
  100% {
    transform: scale(1);
  }
}

/* Dark Theme Overrides for Emergency Widget */
body.dark-theme .emergency-widget {
  background: linear-gradient(135deg, #7b341e 0%, #2d3748 100%) !important;
  border-color: #7b341e !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

body.dark-theme .emergency-widget-info h3 {
  color: #fed7d7 !important;
}

body.dark-theme .emergency-widget-info p {
  color: #fbd38d !important;
}

/* ==========================================
   Save Indicator & Backup/Restore Panel
   ========================================== */
.save-indicator {
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-success);
  margin-top: 0.35rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 600;
}

.backup-panel {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-top: 2rem;
  transition: var(--transition);
}

.backup-panel:hover {
  box-shadow: var(--shadow-md);
}

.backup-panel h3 {
  font-size: 1.15rem;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.backup-panel p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.backup-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn-backup-export,
.btn-backup-import {
  flex: 1;
  min-width: 140px;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-backup-export {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(49, 130, 206, 0.15);
}

.btn-backup-export:hover {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-backup-import {
  background-color: var(--color-secondary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-backup-import:hover {
  background-color: #2c7a7b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
  .emergency-widget {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem;
    gap: 0.8rem;
  }

  .emergency-widget-btn {
    width: 100%;
    text-align: center;
  }
}

/* Floating SOS Panic Button styling */
.sos-floating-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  border: 2px solid white;
  color: white;
  font-size: 1.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
  z-index: 999;
  transition: var(--transition);
  animation: pulseRedFloating 2s infinite ease-in-out;
}

.sos-floating-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.5);
}

@keyframes pulseRedFloating {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 6px 25px rgba(229, 62, 62, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
  }
}

/* Triple-ring pulse around SOS button */
.sos-floating-btn::before,
.sos-floating-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(229, 62, 62, 0.5);
  animation: sosRing 2.4s ease-out infinite;
  pointer-events: none;
}
.sos-floating-btn::after {
  inset: -8px;
  border-color: rgba(229, 62, 62, 0.3);
  animation-delay: 0.8s;
}

@keyframes sosRing {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

body.dark-theme .sos-floating-btn {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(229, 62, 62, 0.3);
}

body.dark-theme .sos-floating-btn::before {
  border-color: rgba(252, 129, 129, 0.4);
}
body.dark-theme .sos-floating-btn::after {
  border-color: rgba(252, 129, 129, 0.2);
}

/* Responsiveness overrides for Mobile Header */
@media (max-width: 480px) {
  .app-header {
    gap: 0.15rem;
    padding-inline: 0.6rem;
  }

  .header-title-container {
    position: static !important;
    transform: none !important;
    flex-grow: 1 !important;
    min-width: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-left: 0.15rem !important;
    pointer-events: auto !important;
  }

  .app-title {
    font-size: 1rem !important;
    text-align: left !important;
    white-space: nowrap;
  }

  .back-btn {
    width: 32px;
    height: 32px;
    margin-right: 0;
    flex: 0 0 32px;
  }

  .header-right-actions {
    gap: 0.1rem !important;
    max-width: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    flex: 0 0 auto;
  }

  .header-right-actions .info-btn {
    width: 28px;
    height: 28px;
    margin: 0 !important;
    flex: 0 0 28px;
  }

  .header-right-actions .info-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* SOS Modal Emergency Call Buttons */
.emergency-call-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* ==========================================================================
   ✨ PREMIUM UX REDESIGN SYSTEM (APPLE HIG & MATERIAL 3 PHILOSOPHIES)
   ========================================================================== */

/* 1. iOS Glassmorphic Segmented Controls */
.segmented-control {
  display: flex;
  background: rgba(226, 232, 240, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 4px;
  margin: 1rem 0 1.5rem 0;
  border: 1px solid var(--color-border);
}

body.dark-theme .segmented-control {
  background: rgba(26, 32, 44, 0.6);
}

.segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 1rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.segment-btn:hover {
  color: var(--color-text-main);
}

.segment-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.03);
  transform: scale(1.02);
}

body.dark-theme .segment-btn.active {
  color: var(--color-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 2. Material 3 Search Bar Pill */
.search-bar-container {
  position: relative;
  width: 100%;
  margin: 0.5rem 0 1.5rem 0;
}

.search-input {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  padding: 0 1.5rem 0 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

body.dark-theme .search-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px var(--color-secondary-light);
}

/* 3. Smooth Chevron Accordion Cards */
.accordion-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
  padding: 0 !important; /* Managed by header and content */
  cursor: pointer;
  border: 1.5px solid var(--color-border);
}

.accordion-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

body.dark-theme .accordion-card:hover {
  border-color: var(--color-secondary);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.25rem;
  user-select: none;
}

.accordion-chevron {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 1.25rem;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded State */
.accordion-card.expanded {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

body.dark-theme .accordion-card.expanded {
  border-color: var(--color-secondary);
}

.accordion-card.expanded .accordion-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

body.dark-theme .accordion-card.expanded .accordion-chevron {
  color: var(--color-secondary);
}

.accordion-card.expanded .accordion-content {
  max-height: 1200px; /* Large enough for any first-aid text */
  opacity: 1;
  padding-bottom: 1.25rem;
  overflow-y: auto; /* Allow scrolling if content is very long */
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* 4. Carousel Dots Page Indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 1.2rem 0;
  user-select: none;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(113, 128, 150, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dots .dot:hover {
  background: rgba(113, 128, 150, 0.6);
}

.carousel-dots .dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--color-primary);
}

body.dark-theme .carousel-dots .dot.active {
  background: var(--color-secondary);
}

/* 5. Medication Intake Log Badges & Cards */
.intake-card {
  border-left: 4px solid var(--color-success) !important;
  background: var(--color-primary-light) !important;
}

body.dark-theme .intake-card {
  background: rgba(47, 133, 90, 0.15) !important;
  border-left: 4px solid #38a169 !important;
}

.intake-delete-btn {
  transition: all 0.2s ease;
  opacity: 0.6;
}

.intake-delete-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* PWA Smart Install Banner */
.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(49, 151, 149, 0.2);
  border-left: 5px solid var(--color-primary);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  animation: slideDownFade 0.5s ease-out;
  box-sizing: border-box;
  transition: var(--transition);
}

body.dark-theme .pwa-install-banner {
  background: rgba(26, 32, 44, 0.85);
  border: 1px solid rgba(49, 151, 149, 0.4);
  border-left: 5px solid var(--color-secondary);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.pwa-banner-icon {
  font-size: 2rem;
  line-height: 1;
  animation: bounceMini 2s infinite ease-in-out;
}

.pwa-banner-info h4 {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.pwa-banner-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pwa-install-btn-action {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(49, 151, 149, 0.2);
}

.pwa-install-btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(49, 151, 149, 0.3);
}

body.dark-theme .pwa-install-btn-action {
  background: var(--color-secondary);
  box-shadow: 0 4px 10px rgba(49, 151, 149, 0.2);
}

.pwa-install-btn-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: var(--transition);
}

.pwa-install-btn-close:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

@media (max-width: 580px) {
  .pwa-install-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }
  .pwa-banner-actions {
    justify-content: flex-end;
  }
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* --- Smart Reminders Frequency Selector --- */
.reminders-freq-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  -webkit-overflow-scrolling: touch;
}

.reminders-freq-selector::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

body.dark-theme .reminders-freq-selector {
  background: rgba(255, 255, 255, 0.03);
}

.freq-btn {
  flex: 1 0 auto;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.freq-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .freq-btn.active {
  color: var(--color-secondary);
}

/* --- Expenses Tracker Styles --- */
.expenses-summary-card {
  background: linear-gradient(135deg, var(--color-primary), #2a69ac);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

body.dark-theme .expenses-summary-card {
  background: linear-gradient(135deg, #2b6cb0, var(--color-secondary));
}

.expenses-summary-amount {
  font-size: 2.25rem;
  font-weight: 800;
  margin-top: 0.5rem;
  font-family: "Outfit", "Inter", sans-serif;
}

.expenses-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

@media (max-width: 480px) {
  .expenses-form-grid {
    grid-template-columns: 1fr;
  }
}

.expenses-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.expenses-form-field.full-width {
  grid-column: 1 / -1;
}

.expenses-form-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.expenses-form-field input,
.expenses-form-field select {
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-text-main);
  box-sizing: border-box;
  outline: none;
  transition: var(--transition);
}

.expenses-form-field input:focus,
.expenses-form-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(49, 151, 149, 0.15);
}

.expenses-add-btn {
  grid-column: 1 / -1;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.expenses-add-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

body.dark-theme .expenses-add-btn {
  background: var(--color-secondary);
}

.expenses-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.expenses-list-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin: 0;
}

.expenses-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.expense-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition: var(--transition);
}

body.dark-theme .expense-item-card {
  border-left-color: var(--color-secondary);
}

.expense-item-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.expense-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.expense-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-main);
}

.expense-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.expense-item-category-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

body.dark-theme .expense-item-category-badge {
  background: rgba(49, 151, 149, 0.15);
  color: var(--color-secondary);
}

.expense-item-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.expense-item-amount {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text-main);
  font-family: "Outfit", sans-serif;
}

.expense-delete-btn {
  background: none;
  border: none;
  color: var(--color-error);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.expense-delete-btn:hover {
  background: var(--color-error-light);
  transform: scale(1.1);
}

.expenses-empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 12px;
}

/* First Aid Video Styles */
.first-aid-source-banner {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface);
  color: var(--color-text-main);
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .first-aid-source-banner {
  background: rgba(45, 55, 72, 0.92);
}

.first-aid-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  margin-bottom: 0.45rem;
}

.first-aid-source-note {
  margin: 0 0 0.85rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: right;
}

.btn-view-video {
  background: rgba(229, 62, 62, 0.08);
  color: #e53e3e;
  border: 1px solid rgba(229, 62, 62, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .btn-view-video {
  background: rgba(252, 129, 129, 0.12);
  color: #fc8181;
  border: 1px solid rgba(252, 129, 129, 0.2);
}

.btn-view-video:hover {
  background: #e53e3e;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(229, 62, 62, 0.2);
}

body.dark-theme .btn-view-video:hover {
  background: #fc8181;
  color: #1a202c;
  box-shadow: 0 4px 10px rgba(252, 129, 129, 0.3);
}

.btn-view-video:active {
  transform: translateY(0);
}

.btn-source-link {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(49, 151, 149, 0.18);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .btn-source-link {
  background: rgba(79, 209, 197, 0.12);
  color: #81e6d9;
  border: 1px solid rgba(129, 230, 217, 0.2);
}

.btn-source-link:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(49, 151, 149, 0.18);
}

body.dark-theme .btn-source-link:hover {
  background: #81e6d9;
  color: #1a202c;
}

@media (max-width: 520px) {
  .first-aid-actions {
    justify-content: flex-start;
  }

  .first-aid-source-note {
    text-align: left;
  }
}

/* 5. iOS Install PWA Banner */
.ios-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 90%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 1.1rem;
  z-index: 10000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: iosSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.dark-theme .ios-install-banner {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@keyframes iosSlideUp {
  from {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.ios-install-banner.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.ios-close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.ios-banner-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.ios-banner-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.ios-banner-text {
  flex-grow: 1;
  padding-right: 15px;
}

.ios-banner-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--color-text-main);
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.ios-banner-text p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.safari-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  margin: 0 2px;
}

/* --- MEDICAL PRINT REPORT STYLES --- */
@media print {
  body > *:not(#print-report-container) {
    display: none !important;
  }

  #print-report-container {
    display: block !important;
    width: 100%;
    background: white;
    color: black;
    padding: 0;
    margin: 0;
  }

  @page {
    margin: 1cm;
    size: A4 portrait;
  }

  .print-only {
    display: block !important;
  }
}
@media screen {
  .print-only {
    display: none !important;
  }
}

/* ==========================================
   Vital Signs Thresholds & Animations
   ========================================== */
.vital-normal {
  color: #38a169 !important;
  font-weight: 800 !important;
}
.vital-warning {
  color: #dd6b20 !important;
  font-weight: 800 !important;
}
.vital-danger {
  color: #e53e3e !important;
  font-weight: 800 !important;
  animation: pulseRedText 2s infinite;
}

@keyframes pulseRedText {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ==========================================
   Checklists Micro-interactions
   ========================================== */
.checklist label {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.checklist label.checked {
  text-decoration: line-through;
  opacity: 0.6;
  transform: translateX(4px);
}

/* ==========================================
   Pillbox Selectors
   ========================================== */
.pillbox-selector-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pillbox-shape-btn,
.pillbox-color-btn {
  border: 2px solid transparent;
  background: var(--color-surface);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.pillbox-shape-btn:hover,
.pillbox-color-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pillbox-shape-btn.active,
.pillbox-color-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.pill-icon {
  width: 24px;
  height: 24px;
}

/* ==========================================
   Phase 2: Checklists Sticky Headers
   ========================================== */
.checklist-section h3 {
  position: sticky;
  top: 60px;
  z-index: 10;
  background: var(--color-background);
  padding: 0.5rem 0;
}
body.dark-theme .checklist-section h3 {
  background: var(--color-background-dark);
}

/* ==========================================
   Phase 2: Big Button Dismiss Modal
   ========================================== */
.alarm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.alarm-modal-content {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.alarm-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text-main);
  font-weight: 800;
}
.btn-massive {
  width: 100%;
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  border-radius: 16px;
  border: none;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn-massive-success {
  background: #38a169;
  color: white;
}
.btn-massive-success:active {
  transform: scale(0.95);
  background: #2f855a;
}
.btn-massive-secondary {
  background: #cbd5e0;
  color: #2d3748;
}
.btn-massive-secondary:active {
  transform: scale(0.95);
  background: #a0aec0;
}
body.dark-theme .btn-massive-secondary {
  background: #4a5568;
  color: #e2e8f0;
}

/* ==========================================
   Phase 2: Progress Bar & Sliders
   ========================================== */
.med-progress-container {
  width: 100%;
  margin-bottom: 1.5rem;
}
.med-progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.5s ease;
  border-radius: 8px;
}
.med-progress-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-align: right;
  margin-bottom: 0.4rem;
}
.slider-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  width: 100%;
}
.smart-slider {
  flex: 1;
  min-width: 50px;
  accent-color: var(--color-primary);
}
.slider-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  width: 45px;
  text-align: right;
}

/* ==========================================
   Bottom Navigation Bar (Mobile only)
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 998;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom);
  transition:
    background 0.3s,
    border-color 0.3s;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  height: 100%;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 2px;
  padding: 4px 0;
  min-width: 0; /* allow flex children to shrink */
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-item .nav-label {
  display: none;
}

/* Active Nav State */
.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active svg {
  stroke: var(--color-primary);
  transform: translateY(-1px);
}

body.dark-theme .nav-item.active {
  color: var(--color-secondary);
}

body.dark-theme .nav-item.active svg {
  stroke: var(--color-secondary);
}

/* Responsive Overrides */
@media (min-width: 769px) {
  .bottom-nav {
    /* display: none; Removed so shortcuts are visible on computer */
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 75px !important;
  }

  .sos-floating-btn {
    bottom: 85px !important;
  }
}

/* ==========================================
   Empty State Illustrations
   ========================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 2rem 1.5rem;
  gap: 1rem;
  animation: fadeIn 0.4s ease-out;
}

.empty-state-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.empty-state-icon.teal {
  background: linear-gradient(
    145deg,
    var(--color-primary-light) 0%,
    rgba(49, 151, 149, 0.12) 100%
  );
  box-shadow: 0 8px 24px rgba(49, 151, 149, 0.12);
}

.empty-state-icon.warning {
  background: linear-gradient(
    145deg,
    var(--color-warning-light) 0%,
    rgba(214, 158, 46, 0.12) 100%
  );
  box-shadow: 0 8px 24px rgba(214, 158, 46, 0.12);
}

.empty-state-icon.accent {
  background: linear-gradient(
    145deg,
    var(--color-accent-light) 0%,
    rgba(128, 90, 213, 0.12) 100%
  );
  box-shadow: 0 8px 24px rgba(128, 90, 213, 0.12);
}

.empty-state-icon svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0;
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  max-width: 240px;
  line-height: 1.55;
  margin: 0;
}

.empty-state-btn {
  margin-top: 0.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.65rem 1.6rem;
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.25);
  font-family: inherit;
}

.empty-state-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(49, 151, 149, 0.35);
}

/* ==========================================
   Checkbox Ripple Celebration Effect
   ========================================== */
.checkbox-ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  pointer-events: none;
  animation: checkboxRipple 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes checkboxRipple {
  0% {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    width: 60px;
    height: 60px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Checklist item checked state glow */
.checklist label:has(input:checked) {
  background: linear-gradient(
    90deg,
    rgba(49, 151, 149, 0.06) 0%,
    transparent 100%
  );
}

/* ==========================================
   Contextual Header Subtitle
   ========================================== */
.header-context-subtitle {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.2px;
  opacity: 0.8;
  display: block;
  line-height: 1;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.header-title-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* View header animation */
.view-header {
  animation: fadeIn 0.35s ease-out;
}

/* Checklist progress bar */
.checklist-progress-wrap {
  height: 4px;
  background: var(--color-border);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   Premium Input & Textarea Focus States
   ========================================== */
input[type="text"],
input[type="number"],
input[type="time"],
input[type="date"],
select,
textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease !important;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--color-primary) !important;
  box-shadow:
    0 0 0 3px rgba(49, 151, 149, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.05) !important;
  background-color: var(
    --color-surface-raised,
    var(--color-surface)
  ) !important;
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="number"]:focus,
body.dark-theme input[type="time"]:focus,
body.dark-theme input[type="date"]:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  border-color: #4fd1c5 !important;
  box-shadow:
    0 0 0 3px rgba(79, 209, 197, 0.15),
    0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================
   Bottom Nav Active Tab Indicator
   ========================================== */
.bottom-nav .nav-item.active {
  position: relative;
}

.bottom-nav .nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 0 0 4px 4px;
  animation: fadeIn 0.3s ease;
}

/* Welcome card hover — subtle scale + glow */
.welcome-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow:
    0 16px 48px rgba(49, 151, 149, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.dark-theme .welcome-card:hover {
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(79, 209, 197, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Empathy Widget Styles
   ========================================== */
.empathy-chip {
  background: var(--color-background-app);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empathy-chip:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.empathy-chip.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.3);
}

@keyframes empathyBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }
}

.empathy-breathe-anim {
  animation: empathyBreathe 6s ease-in-out infinite;
}

body.dark-theme .empathy-chip {
  background: var(--color-surface);
  border-color: var(--color-border);
}

body.dark-theme .empathy-chip:hover {
  background: rgba(79, 209, 197, 0.1);
}

body.dark-theme .empathy-chip.active {
  background: var(--color-primary);
  color: #1a202c;
}

/* Danger Zone Card */
.danger-zone-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(229, 62, 62, 0.2);
  border-radius: 16px;
  background: rgba(229, 62, 62, 0.05);
}
body.dark-theme .danger-zone-card {
  background: rgba(229, 62, 62, 0.1);
  border-color: rgba(229, 62, 62, 0.3);
}

/* i18n UI Styles */
.lang-toggle-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  font-weight: 700;
}
.lang-toggle-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
body.dark-theme .lang-toggle-btn:hover {
  color: var(--color-secondary);
  background: rgba(79, 209, 197, 0.1);
  border-color: var(--color-secondary);
}

/* Segmented Language Selector */
.lang-segmented {
  display: flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lang-seg-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-radius: 18px;
  padding: 0.3rem 0.9rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.lang-seg-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
body.dark-theme .lang-seg-btn.active {
  background: var(--color-secondary);
  color: #1a202c;
}

/* ===================================================
   PREMIUM REDESIGN COMPONENTS — Synodos-MED+ v2
   =================================================== */

/* Staggered card animations */
.categories-grid .category-card:nth-child(1) {
  animation: staggerFadeUp 0.4s ease both;
  animation-delay: 0.05s;
}
.categories-grid .category-card:nth-child(2) {
  animation: staggerFadeUp 0.4s ease both;
  animation-delay: 0.1s;
}
.categories-grid .category-card:nth-child(3) {
  animation: staggerFadeUp 0.4s ease both;
  animation-delay: 0.15s;
}
.categories-grid .category-card:nth-child(4) {
  animation: staggerFadeUp 0.4s ease both;
  animation-delay: 0.2s;
}
.categories-grid .category-card:nth-child(5) {
  animation: staggerFadeUp 0.4s ease both;
  animation-delay: 0.25s;
}

/* Card spring press interaction */
.category-card {
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base) !important;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.category-card:active {
  transform: scale(0.96) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Quick Actions Strip */
.quick-actions-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}
.quick-actions-strip::-webkit-scrollbar {
  display: none;
}

.quick-action-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(49, 151, 149, 0.04);
  border: 1px solid rgba(49, 151, 149, 0.22);
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--transition-spring),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-chip:active {
  transform: scale(0.94);
  background: var(--color-primary-light);
}
.quick-action-chip.urgent {
  background: rgba(221, 107, 32, 0.05);
  border-color: rgba(221, 107, 32, 0.35);
  color: #dd6b20;
}
body.dark-theme .quick-action-chip.urgent {
  color: #f6ad55;
  border-color: rgba(246, 173, 85, 0.3);
  background: rgba(246, 173, 85, 0.06);
}
.quick-action-chip.urgent-red {
  background: rgba(229, 62, 62, 0.08) !important;
  border-color: rgba(229, 62, 62, 0.35) !important;
  color: #e53e3e !important;
}
body.dark-theme .quick-action-chip.urgent-red {
  color: #fc8181 !important;
  border-color: rgba(252, 129, 129, 0.35) !important;
  background: rgba(252, 129, 129, 0.08) !important;
}

.home-sos-wrap {
  padding: 0 1rem 0.75rem;
}

.home-sos-bar {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(229, 62, 62, 0.34);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(229, 62, 62, 0.11),
    rgba(229, 62, 62, 0.05)
  );
  color: #c53030;
  padding: 0.8rem 0.95rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(229, 62, 62, 0.11);
  -webkit-tap-highlight-color: transparent;
}

.home-sos-bar:active {
  transform: scale(0.99);
}

.home-sos-icon {
  width: 54px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #c53030;
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.home-sos-bar strong {
  display: block;
  font-size: 1rem;
  line-height: 1.18;
}

.home-sos-bar small {
  display: block;
  margin-top: 0.18rem;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

body.dark-theme .home-sos-bar {
  border-color: rgba(252, 129, 129, 0.32);
  background: linear-gradient(
    135deg,
    rgba(252, 129, 129, 0.13),
    rgba(252, 129, 129, 0.05)
  );
  color: #feb2b2;
}

body.dark-theme .home-sos-icon {
  background: #e53e3e;
}

.today-panel {
  margin: 0 1rem 0.75rem;
  padding: 0.95rem;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.today-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.today-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.08em;
}

.today-panel h3 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  color: var(--color-text-main);
}

.today-backup-status {
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.today-backup-status.attention {
  color: var(--color-warning);
  border-color: rgba(214, 158, 46, 0.35);
  background: var(--color-warning-light);
}

.today-grid {
  display: grid;
  gap: 0.55rem;
}

.today-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  color: var(--color-text-main);
  cursor: pointer;
}

.today-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  flex: 0 0 auto;
}

.today-item strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2;
}

.today-item small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  line-height: 1.25;
}

.shift-panel {
  margin: 0 1rem 0.85rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.shift-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.shift-panel h2 {
  margin: 0.12rem 0 0;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--color-text-main);
}

.shift-panel p {
  margin: 0.28rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.shift-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.shift-status-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 8px 16px;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 13px;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-main);
  text-align: left;
  cursor: pointer;
}

.shift-status-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-primary-light);
}

.shift-status-icon.med {
  background: var(--color-warning-light);
}
.shift-status-icon.vitals {
  background: var(--color-success-light);
}
.shift-status-icon.notes {
  background: var(--color-secondary-light);
}

.shift-status-row strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.shift-status-row small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  line-height: 1.25;
}

.shift-row-arrow {
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
}

.shift-primary-action {
  width: 100%;
  margin-top: 0.85rem;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.95rem;
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 18px rgba(49, 151, 149, 0.24);
  cursor: pointer;
}

.shift-primary-action span:first-child {
  font-size: 1.35rem;
  line-height: 1;
}

.waiting-panel,
.self-care-panel {
  margin: 0 1rem 0.75rem;
  padding: 0.95rem;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--color-surface), var(--color-bg));
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.waiting-header,
.self-care-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.waiting-header h3,
.self-care-header h3 {
  margin: 0.1rem 0 0;
  color: var(--color-text-main);
  font-size: 1rem;
}

.waiting-header > span,
.self-care-header > span {
  max-width: 155px;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: right;
}

.waiting-grid,
.self-care-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.waiting-grid button,
.self-care-actions button {
  min-height: 42px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  border-radius: 11px;
  padding: 0.55rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.self-care-actions button {
  min-height: 40px;
  padding: 0.52rem 0.45rem;
  font-size: 0.76rem;
  line-height: 1.2;
}

.self-care-empathy {
  margin: 0.65rem 0 0;
  box-shadow: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
}

body.dark-theme .self-care-empathy {
  background: rgba(255, 255, 255, 0.035);
}

@media (max-width: 360px) {
  .self-care-panel {
    margin-inline: 0.5rem;
    padding: 0.85rem;
  }
  .self-care-header {
    gap: 0.5rem;
  }
  .self-care-header > span {
    max-width: 125px;
    font-size: 0.68rem;
  }
  .self-care-actions {
    gap: 0.3rem;
  }
  .self-care-actions button {
    min-height: 38px;
    padding: 0.45rem 0.25rem;
    font-size: 0.7rem;
  }
  .self-care-empathy .empathy-widget-header {
    gap: 0.4rem;
    padding-inline: 0.65rem;
  }
  .self-care-empathy .empathy-icon-badge {
    width: 32px;
    height: 32px;
  }
  .self-care-empathy .empathy-chevron {
    margin-left: 0.15rem;
  }
}

/* Day Counter Hero Card */
.day-counter-wrap {
  padding: 0.55rem 1rem 0.75rem;
}

.day-counter-card {
  background: var(--gradient-hero);
  border-radius: calc(var(--border-radius) + 4px);
  padding: 1.1rem 1.15rem 1rem;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  box-shadow:
    0 8px 30px rgba(13, 27, 42, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  animation: floatIn 0.5s ease both;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s ease,
    background 0.45s ease;
}
.day-counter-card[data-phase="hospital"] {
  background: linear-gradient(135deg, #0d1b2a 0%, #1a365d 50%, #2a4a7f 100%);
}
.day-counter-card[data-phase="home_care"] {
  background: linear-gradient(135deg, #0c2420 0%, #134e4a 48%, #1a6b64 100%);
}
.day-counter-card[data-phase="daily"] {
  background: linear-gradient(135deg, #121826 0%, #1e3a5f 52%, #2b5078 100%);
}
.day-counter-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 12px 35px rgba(13, 27, 42, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
}
.day-counter-card:active {
  transform: translateY(0) scale(0.99);
}
.day-counter-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(49, 151, 149, 0.3) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.day-counter-card[data-phase="home_care"]::before {
  background: radial-gradient(
    circle,
    rgba(79, 209, 197, 0.28) 0%,
    transparent 70%
  );
}
.day-counter-card[data-phase="daily"]::before {
  background: radial-gradient(
    circle,
    rgba(99, 179, 237, 0.22) 0%,
    transparent 70%
  );
}
.day-counter-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}
.day-counter-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.day-counter-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  min-width: 84px;
  min-height: 84px;
  padding: 0.45rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.day-counter-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.day-counter-ring-track {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 5.5;
}
.day-counter-ring-fill {
  stroke: #4fd1c5;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-dasharray: 282.743;
  stroke-dashoffset: 282.743;
  transition:
    stroke-dashoffset 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.35s ease;
}
.day-counter-badge.is-complete .day-counter-ring-fill {
  stroke: #68d391;
}
.day-counter-badge-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 100%;
  padding: 0.15rem;
}
.day-counter-badge-label {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}
.day-counter-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #f6ad55, #fbd38d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.day-counter-label {
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 0.78;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.day-counter-title {
  font-size: 1.08rem;
  font-weight: 700;
  opacity: 0.95;
  line-height: 1.25;
}
.day-counter-subtitle {
  font-size: 0.84rem;
  opacity: 0.85;
  margin-top: 0.12rem;
  line-height: 1.25;
}

/* Pillar color accents on category cards */
.category-card[data-view="pillar-guide"] .card-icon {
  background: linear-gradient(
    135deg,
    rgba(49, 151, 149, 0.12),
    rgba(44, 122, 123, 0.06)
  );
  color: #319795;
}
.category-card[data-view="pillar-hospital"] .card-icon {
  background: linear-gradient(
    135deg,
    rgba(49, 130, 206, 0.12),
    rgba(43, 108, 176, 0.06)
  );
  color: #3182ce;
}
.category-card[data-view="pillar-tools"] .card-icon {
  background: linear-gradient(
    135deg,
    rgba(128, 90, 213, 0.12),
    rgba(107, 70, 193, 0.06)
  );
  color: #805ad5;
}
.category-card[data-view="pillar-info"] .card-icon {
  background: linear-gradient(
    135deg,
    rgba(246, 173, 85, 0.12),
    rgba(237, 137, 54, 0.06)
  );
  color: #c05621;
}
body.dark-theme .category-card[data-view="pillar-info"] .card-icon {
  color: #f6ad55;
}

/* Premium Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  gap: 1rem;
  animation: scaleIn 0.4s ease both;
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--color-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.empty-state h3 {
  font-size: var(--text-lg, 1.15rem);
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0;
}
.empty-state p {
  font-size: var(--text-sm, 0.85rem);
  color: var(--color-text-muted);
  margin: 0;
  max-width: 280px;
  line-height: 1.6;
}
.empty-state .empty-cta {
  margin-top: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.empty-state .empty-cta:active {
  transform: scale(0.96);
}

/* Onboarding Overlay */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.onboarding-slides-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: visible;
  position: relative;
}
.onboarding-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem 1rem;
  text-align: center;
  gap: 1.25rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.onboarding-slide-icon {
  width: 140px;
  height: 140px;
  margin-bottom: 0.5rem;
  animation: bounceIn 0.6s ease both;
}
.onboarding-slide h2 {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 0;
}
.onboarding-slide p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
  max-width: 340px;
}
.onboarding-footer {
  padding: 1.5rem 2rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.onboarding-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--color-border);
  transition:
    width 0.3s var(--transition-spring),
    background 0.3s ease;
}
.onboarding-dot.active {
  width: 24px;
  background: var(--color-primary);
}
.onboarding-btn-primary {
  width: 100%;
  max-width: 340px;
  padding: 1rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.onboarding-btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.2);
}
.onboarding-skip {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color var(--transition-fast);
}
.onboarding-skip:hover,
.onboarding-skip:focus {
  color: var(--color-text-main);
}
.onboarding-name-input {
  width: 100%;
  max-width: 320px;
  padding: 0.85rem 1.2rem;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text-main);
  text-align: center;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  outline: none;
}
.onboarding-name-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.15);
}

/* Contextual Greeting */
.contextual-greeting {
  padding: 0.25rem 0 0.75rem;
  animation: slideUpFade 0.4s ease both;
}
.contextual-greeting .greeting-time {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  opacity: 0.8;
}
.contextual-greeting .greeting-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.2;
  margin-top: 0.15rem;
}
.contextual-greeting .greeting-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

body.dark-theme .contextual-greeting .greeting-time {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  opacity: 1;
}

body.dark-theme .contextual-greeting .greeting-name {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

body.dark-theme .contextual-greeting .greeting-sub {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Inline Trust Badge */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  margin-top: 0.3rem;
}

/* Success animation overlay */
.success-flash {
  position: fixed;
  inset: 0;
  background: rgba(72, 187, 120, 0.08);
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.success-flash.active {
  opacity: 1;
}

/* Premium Toast Upgrade */
.toast-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  width: 100%;
  max-width: 400px;
  padding: 0 1rem;
}
.toast {
  background: var(--color-surface);
  color: var(--color-text-main);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
  animation: floatIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: auto;
  max-width: 100%;
  width: 100%;
  text-align: center;
  line-height: 1.4;
  border-left: 4px solid var(--color-primary);
  position: relative;
  overflow: hidden;
}
.toast.toast-success {
  border-left-color: #48bb78;
}
.toast.toast-error {
  border-left-color: #fc8181;
}
.toast.toast-warning {
  border-left-color: #f6ad55;
}
.toast.toast-info {
  border-left-color: #63b3ed;
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: toastProgress linear forwards;
}
@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    var(--color-surface-overlay) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* Nav spring animation */
.nav-item {
  transition:
    transform var(--transition-spring),
    color var(--transition-fast) !important;
}
.nav-item:active {
  transform: scale(0.88) !important;
}
.nav-item.active svg {
  filter: drop-shadow(0 2px 6px rgba(49, 151, 149, 0.35));
}

/* Privacy moment inline badge */
.field-privacy-note {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--color-primary);
  margin-top: 0.25rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Empathy widget button active state */
.empathy-chip {
  transition:
    transform var(--transition-spring),
    background var(--transition-fast),
    color var(--transition-fast) !important;
}
.empathy-chip:active {
  transform: scale(0.93) !important;
}
.empathy-chip.active {
  animation: pulseSuccess 0.6s ease;
}

/* Category card gradient accent borders */
.category-card {
  position: relative;
  overflow: hidden;
}
.category-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.category-card[data-view="pillar-guide"]::after {
  background: var(--gradient-primary);
}
.category-card[data-view="pillar-hospital"]::after {
  background: var(--gradient-cool);
}
.category-card[data-view="pillar-tools"]::after {
  background: var(--gradient-purple);
}
.category-card[data-view="pillar-info"]::after {
  background: var(--gradient-warm);
}
.category-card:hover::after,
.category-card:focus-within::after {
  opacity: 1;
}

/* Vibrant view-slide animation */
.view-slide-in {
  animation: slideUpFade 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) both !important;
}
.view-slide-up {
  animation: floatIn 0.4s cubic-bezier(0.34, 1.1, 0.64, 1) both !important;
}

/* ===================================================
   SIGNATURE BRAND CARD & LOGO STYLES
   =================================================== */

.brand-signature-card {
  background: linear-gradient(135deg, #0b1329 0%, #152238 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.6rem 1.25rem 1.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base),
    border-color var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.brand-signature-card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.15);
}

.brand-glow-bg {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  background: radial-gradient(
    circle,
    rgba(49, 151, 149, 0.28) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 1;
}

.brand-logo-container {
  position: relative;
  z-index: 2;
  margin: 0 auto 0.6rem;
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}
.brand-logo-svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.2px;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 2;
}
.brand-title .brand-accent {
  color: #4fd1c5;
  font-weight: 800;
}

.brand-slogan {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  opacity: 0.95;
  margin-top: 0.1rem;
}

/* ===================================================
   MINI-GAMES (SNAKE, TIC-TAC-TOE, FLAPPY HEART) STYLES
   =================================================== */

.game-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  padding: 0.3rem;
  border-radius: 25px;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-sm);
}

.game-tab {
  background: none;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.game-tab:active {
  transform: scale(0.95);
}

.game-tab.active {
  background: var(--gradient-primary);
  color: white !important;
  box-shadow: var(--shadow-primary);
}

.game-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.game-panel.hidden {
  display: none !important;
}

/* Tic-Tac-Toe cells styling */
.ttt-cell {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  font-size: 2.2rem;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition:
    transform var(--transition-spring),
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.ttt-cell:active {
  transform: scale(0.92);
}

.ttt-cell.taken {
  cursor: not-allowed;
}

.ttt-cell.x-player {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(49, 151, 149, 0.3);
  background: rgba(49, 151, 149, 0.05);
  border-color: rgba(49, 151, 149, 0.3);
}

.ttt-cell.o-player {
  color: var(--color-warm-accent, #f6ad55);
  text-shadow: 0 0 8px rgba(246, 173, 85, 0.3);
  background: rgba(246, 173, 85, 0.05);
  border-color: rgba(246, 173, 85, 0.3);
}

/* Highlight winning cells */
.ttt-cell.winner {
  background: var(--color-success) !important;
  color: white !important;
  border-color: var(--color-success) !important;
  box-shadow: 0 0 15px rgba(72, 187, 120, 0.4);
  animation: bounceIn 0.4s ease both;
}

/* Breathing game styles */
.breathing-circle-static {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--color-primary-light) 0%,
    var(--color-primary) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(49, 151, 149, 0.25);
  margin: 1.5rem auto;
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-base);
}

.breathing-circle-static.breathing-active {
  animation: breathe 8s infinite ease-in-out;
}

body.dark-theme .breathing-circle-static .breathing-text {
  background: rgba(45, 55, 72, 0.9);
  color: var(--color-primary);
}

/* Game canvases styling */
#snake-canvas,
#flappy-canvas {
  background: transparent;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  color-scheme: light;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

#flappy-canvas {
  cursor: pointer;
}

body.dark-theme #snake-canvas,
body.dark-theme #flappy-canvas {
  background: transparent;
  color-scheme: dark;
}

/* Memory Match game styles */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  grid-template-rows: repeat(4, 70px);
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin: 0.5rem 0;
}

@media (max-width: 340px) {
  .memory-grid {
    grid-template-columns: repeat(4, 62px);
    grid-template-rows: repeat(4, 62px);
    gap: 6px;
  }
}

.memory-card {
  background-color: transparent;
  perspective: 1000px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card:active .memory-card-inner {
  transform: scale(0.95);
}
.memory-card.flipped:active .memory-card-inner {
  transform: rotateY(180deg) scale(0.95);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}

.memory-card-front {
  background: var(--gradient-primary);
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
}

.memory-card-back {
  background: var(--color-surface-raised);
  transform: rotateY(180deg);
  font-size: 1.8rem;
}

.memory-card.matched .memory-card-inner {
  animation: pulseSuccess 0.5s ease both;
  border: 2px solid var(--color-success);
}

/* AutoBackup Switch Toggle & List Styles */
.switch-toggle input:checked + .toggle-slider {
  background-color: var(--color-primary) !important;
}
body.dark-theme .switch-toggle input:checked + .toggle-slider {
  background-color: var(--color-secondary) !important;
}
.switch-toggle .toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
.switch-toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.autobackup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}
.autobackup-date {
  font-weight: 600;
  color: var(--color-text-main);
}
.autobackup-time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}
.btn-restore-backup {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-restore-backup:hover {
  background: var(--color-primary);
  color: white;
}
body.dark-theme .btn-restore-backup {
  background: rgba(99, 179, 237, 0.1);
  color: #63b3ed;
  border-color: transparent;
}
body.dark-theme .btn-restore-backup:hover {
  background: #63b3ed;
  color: #1a202c;
}

/* Guided Tour Styles */
.guide-tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
  display: none;
}
body.tour-active .app-header {
  z-index: 10001 !important;
}
body.tour-active .app-header .header-brand,
body.tour-active .app-header .info-btn:not(.tour-spotlight),
body.tour-active .app-header .theme-btn:not(.tour-spotlight) {
  opacity: 0.15 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}
.tour-spotlight {
  position: relative !important;
  z-index: 10002 !important;
  box-shadow:
    0 0 0 4px var(--color-primary),
    0 4px 20px rgba(0, 0, 0, 0.4) !important;
  background: var(--color-surface-raised) !important;
  border-radius: 8px !important;
  transform: scale(1.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
body.dark-theme .tour-spotlight {
  box-shadow:
    0 0 0 4px #63b3ed,
    0 4px 20px rgba(0, 0, 0, 0.8) !important;
}
.tour-tooltip {
  position: absolute;
  background: rgba(26, 32, 44, 0.98);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 1.2rem;
  width: 290px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10002;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  font-family: inherit;
  box-sizing: border-box;
}
.tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tour-tooltip-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: #4fd1c5;
}
body.dark-theme .tour-tooltip-title {
  color: #63b3ed;
}
.tour-tooltip-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}
.tour-tooltip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}
.tour-btn-next {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}
.tour-btn-next:hover {
  transform: scale(1.05);
}
body.dark-theme .tour-btn-next {
  background: #63b3ed;
  color: #1a202c;
}
.tour-btn-skip {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  padding: 0.4rem 0.5rem;
}
.tour-btn-skip:hover {
  color: white;
}
.tour-arrow {
  position: absolute;
  top: -6px;
  width: 12px;
  height: 12px;
  background: rgba(26, 32, 44, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  transform: rotate(45deg);
}

/* Circular Action Buttons for Vitals Logger */
.btn-circular-save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(49, 151, 149, 0.08);
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-circular-save:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(49, 151, 149, 0.3);
}

.btn-circular-save:active {
  transform: scale(0.92) translateY(0);
}

body.dark-theme .btn-circular-save {
  background: rgba(49, 151, 149, 0.15);
  color: #4fd1c5;
}

body.dark-theme .btn-circular-save:hover {
  background: #4fd1c5;
  color: #0a0f1a;
  box-shadow: 0 4px 12px rgba(79, 209, 197, 0.35);
}

/* Stepper Buttons for precise input control (e.g. thermometer) */
.btn-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0;
  line-height: 1;
}

.btn-stepper:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.08);
}

.btn-stepper:active {
  transform: scale(0.9);
}

body.dark-theme .btn-stepper {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
}

body.dark-theme .btn-stepper:hover {
  background: rgba(49, 151, 149, 0.2);
  color: #4fd1c5;
  border-color: #4fd1c5;
}

/* Custom Notepad Item Styles */
.note-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  padding: 0.8rem 1rem;
  border-radius: 0 8px 8px 0;
  gap: 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  animation: slideInNote 0.25s ease-out;
}

@keyframes slideInNote {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-item-row:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.note-item-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-text-main);
  line-height: 1.4;
  word-break: break-word;
}

.note-item-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  border: none;
  background: rgba(229, 62, 62, 0.08);
  color: #e53e3e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.note-item-delete:hover {
  background: #e53e3e;
  color: white;
  transform: scale(1.05);
}

.note-item-delete:active {
  transform: scale(0.9);
}

body.dark-theme .note-item-delete {
  background: rgba(252, 129, 129, 0.15);
  color: #fc8181;
}

body.dark-theme .note-item-delete:hover {
  background: #fc8181;
  color: #0a0f1a;
}

/* Patient Switcher Tab Styles */
.patient-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: 20px;
  padding: 0.5rem 1.1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.patient-tab-btn:hover {
  background: var(--color-surface-raised);
  color: var(--color-text-main);
  border-color: var(--color-primary);
}

.patient-tab-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

body.dark-theme .patient-tab-btn.active {
  background: #319795;
  border-color: #319795;
}

.patient-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  transition: all 0.15s ease;
  margin-right: -4px;
  margin-left: 2px;
}

.patient-tab-close:hover {
  background: rgba(229, 62, 62, 0.15);
  color: #e53e3e;
  opacity: 1;
  transform: scale(1.15);
}

.patient-tab-btn.active .patient-tab-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Medication Adherence Widget (Premium Redesign) on Home Screen */
.med-adherence-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
  padding-left: 0.15rem;
}

.med-adherence-header.upcoming {
  color: var(--color-primary);
}

.med-adherence-header.overdue {
  color: var(--color-danger, #e53e3e);
}

.med-adherence-card {
  grid-column: 1 / -1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.med-adherence-card.overdue {
  border: 1px solid rgba(229, 62, 62, 0.3);
  background: linear-gradient(
    135deg,
    var(--color-surface),
    rgba(229, 62, 62, 0.02)
  );
}

.med-adherence-card.upcoming {
  border: 1px solid rgba(49, 151, 149, 0.25);
  background: linear-gradient(
    135deg,
    var(--color-surface),
    rgba(49, 151, 149, 0.02)
  );
}

.med-adherence-card.success-all {
  border: 1px solid rgba(56, 161, 105, 0.3);
  background: linear-gradient(
    135deg,
    var(--color-surface),
    rgba(56, 161, 105, 0.02)
  );
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.med-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.med-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.med-status-badge.upcoming {
  background: rgba(56, 161, 105, 0.12);
  color: #38a169;
}

.med-status-badge.overdue {
  background: rgba(229, 62, 62, 0.12);
  color: var(--color-danger, #e53e3e);
}

.med-intake-progress {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.med-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.med-time {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.1;
}

.med-adherence-body {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
}

.med-time-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--color-border);
  padding-right: 0.85rem;
  height: 100%;
  align-self: stretch;
}

.med-pills-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;
  min-width: 0;
}

.med-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.med-pill-info-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 0;
}

.med-pill-name-inline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.med-pill-take-btn {
  background: #38a169;
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(56, 161, 105, 0.1);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.med-pill-take-btn:hover {
  background: #2f855a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(56, 161, 105, 0.2);
}

.med-pill-take-btn:active {
  transform: translateY(0);
}

/* Pharmacies Caching & Listing UI */
.pharmacy-offline-banner {
  background: rgba(246, 173, 85, 0.12);
  border: 1px dashed rgba(246, 173, 85, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #dd6b20;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-theme .pharmacy-offline-banner {
  color: #f6ad55;
}

.pharmacy-live-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  border-left: 4px solid var(--color-primary);
}

.pharmacy-live-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.pharmacy-live-card.open {
  border-left: 4px solid var(--color-success, #38a169);
}

.pharmacy-live-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.pharmacy-live-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.3;
}

.pharmacy-live-status {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.pharmacy-live-status.open {
  background: rgba(56, 161, 105, 0.1);
  color: var(--color-success, #38a169);
  border: 1px solid rgba(56, 161, 105, 0.2);
}

.pharmacy-live-status.duty {
  background: rgba(49, 151, 149, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(49, 151, 149, 0.2);
}

.pharmacy-live-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pharmacy-live-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.pharmacy-live-info-row svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.pharmacy-live-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px dashed var(--color-border);
  padding-top: 0.75rem;
}

.pharmacy-live-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 10px;
  padding: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-main);
}

.pharmacy-live-btn.primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.pharmacy-live-btn.primary:hover {
  background: #2c7a7b;
}

.pharmacy-live-btn:hover {
  background: var(--color-border);
  transform: translateY(-1px);
}

.pharmacy-live-btn:active {
  transform: translateY(0);
}

/* Live Hospital Duty Widget Styles */
.live-hospital-duty-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 1.25rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: slideDownFade 0.4s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.live-hospital-badge {
  background: #e53e3e;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: liveBadgePulse 2s infinite ease-in-out;
  box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

@keyframes liveBadgePulse {
  0% {
    opacity: 0.85;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 0 8px rgba(229, 62, 62, 0.6);
  }
  100% {
    opacity: 0.85;
    transform: scale(0.98);
  }
}

.live-hospital-badge .dot {
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: blinkDot 1s infinite alternate;
}

@keyframes blinkDot {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

.hospital-duty-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.hospital-duty-btn.call {
  background: #38a169;
  color: white;
}

.hospital-duty-btn.call:hover {
  background: #2f855a;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(56, 161, 105, 0.25);
}

.hospital-duty-btn.map {
  background: #3182ce;
  color: white;
}

.hospital-duty-btn.map:hover {
  background: #2b6cb0;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(49, 130, 206, 0.25);
}

.hospital-duty-btn:active {
  transform: translateY(0);
}

/* Online Verification Link button style */
.hospital-verify-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  align-self: center;
  margin-top: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.hospital-verify-link:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.hospital-verify-link:active {
  transform: translateY(0);
}

/* Dark Theme specific overrides if needed */
body.dark-theme .live-hospital-duty-card {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Compact Collapsible Empathy Widget */
.empathy-widget-compact {
  grid-column: 1 / -1;
  background: linear-gradient(
    135deg,
    var(--color-surface),
    var(--color-surface-overlay)
  );
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.empathy-widget-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease;
}

.empathy-widget-header:hover {
  background-color: rgba(49, 151, 149, 0.03);
}

.empathy-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(49, 151, 149, 0.15);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  cursor: pointer;
  animation: empathyBadgeAura 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes empathyBadgeAura {
  0% {
    box-shadow: 0 0 0 0 rgba(49, 151, 149, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(49, 151, 149, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(49, 151, 149, 0);
  }
}

.empathy-widget-header:hover .empathy-icon-badge {
  transform: scale(1.06);
}

.empathy-prompt-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-text-main);
  flex-grow: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empathy-chevron {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0.5rem;
}

/* Expanded state styles */
.empathy-widget-compact.expanded .empathy-chevron {
  transform: rotate(180deg);
}

.empathy-widget-content {
  max-height: 0;
  opacity: 0;
  padding: 0 1.25rem;
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empathy-widget-compact.expanded .empathy-widget-content {
  max-height: 1000px; /* high enough to cover content without clipping */
  opacity: 1;
  padding: 0.5rem 1.25rem 1.25rem 1.25rem;
  border-top: 1px dashed var(--color-border);
}

.empathy-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0 0;
  text-align: center;
}

.empathy-quote {
  font-size: 0.78rem;
  color: var(--color-primary);
  margin: 0;
  font-style: italic;
  opacity: 0.85;
  text-align: center;
}

/* Overwrite background for active chip to stand out */
.empathy-chip.active {
  background: var(--color-primary) !important;
  color: white !important;
  border-color: var(--color-primary) !important;
}

.empathy-chips {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin: 0.25rem 0;
}

.empathy-chip {
  width: 100%;
  max-width: 260px; /* Constrain max width for elegant centered alignment */
  text-align: center;
}

/* Dark Theme specific overrides */
body.dark-theme .empathy-widget-header:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* QQ Transfer Premium UI */
.qq-hero-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.glass-qr-card {
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05) !important;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Shift handover */
.handover-view-header {
  margin-bottom: 1rem;
}

.handover-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.handover-summary-card {
  padding: 1rem;
  border: 1px solid rgba(49, 151, 149, 0.3);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.handover-summary-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.handover-summary-heading > span:nth-child(2) {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.handover-summary-heading small {
  color: var(--color-primary);
  font-size: 0.66rem;
  font-weight: 800;
}

.handover-summary-heading strong {
  color: var(--color-text-main);
  font-size: 1rem;
}

.handover-relief-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.handover-relief-icon svg,
.handover-icon-btn svg,
.handover-share-btn svg,
.handover-data-details summary svg {
  width: 21px;
  height: 21px;
}

.handover-icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-primary);
  cursor: pointer;
}

.handover-summary-text {
  width: 100%;
  min-height: 255px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.85rem;
  background: var(--color-bg);
  color: var(--color-text-main);
  font: 500 0.84rem/1.55 inherit;
}

.handover-summary-text:focus {
  border-color: var(--color-primary);
  outline: 2px solid rgba(49, 151, 149, 0.12);
}

.handover-edit-hint,
.handover-brand-note {
  margin: 0.55rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.handover-share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.handover-share-btn {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.handover-share-btn.whatsapp {
  background: #168c51;
}
.handover-share-btn.viber {
  background: #665cac;
}
.handover-share-btn.primary {
  background: var(--color-primary);
}
.handover-share-btn.secondary {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-main);
}

.handover-data-details {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.handover-data-details summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.handover-data-details summary::-webkit-details-marker {
  display: none;
}

.handover-data-details summary > span {
  display: flex;
  flex-direction: column;
}

.handover-data-details summary strong {
  color: var(--color-text-main);
  font-size: 0.88rem;
}

.handover-data-details summary small {
  margin-top: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.handover-data-details summary > svg {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.handover-data-details[open] summary > svg {
  transform: rotate(90deg);
}

.handover-data-content {
  display: grid;
  gap: 0.75rem;
  padding: 0 0.75rem 0.75rem;
}

.handover-card {
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
}

.handover-card h3 {
  margin: 0 0 0.35rem;
  color: var(--color-text-main);
  font-size: 0.9rem;
}

.handover-card p {
  margin: 0 0 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.handover-data-action,
.handover-scan-action,
.handover-raw-share,
.handover-manual-action {
  width: 100%;
  min-height: 42px;
}

.handover-data-action {
  background: var(--color-primary);
  color: white;
}
.handover-scan-action {
  background: var(--color-accent);
  color: white;
}
.handover-raw-share {
  display: none;
  margin-top: 0.65rem;
  background: #4a5568;
  color: white;
}
.handover-manual-action {
  margin-top: 0.65rem;
  border: 1px dashed var(--color-accent);
  background: transparent;
  color: var(--color-accent);
}

.handover-qr-container {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
}

.handover-warning {
  display: none;
  margin-top: 0.65rem !important;
  color: var(--color-warning) !important;
  text-align: center;
}

.handover-success-msg {
  display: none;
  margin-top: 0.65rem;
  border: 1px solid var(--color-success);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(56, 161, 105, 0.1);
  color: var(--color-success);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.handover-data-details .scanner-wrapper {
  display: none;
  margin-top: 0.75rem;
}

.handover-brand-note {
  margin: 0;
  padding: 0 0.35rem;
  text-align: center;
}

@media (max-width: 360px) {
  .handover-summary-card {
    padding: 0.85rem;
  }
  .handover-summary-text {
    min-height: 275px;
    font-size: 0.8rem;
  }
  .handover-share-grid {
    gap: 0.4rem;
  }
  .handover-share-btn {
    font-size: 0.74rem;
  }
}

body.dark-theme .glass-qr-card {
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.scanner-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--color-accent);
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  box-shadow: 0 0 10px 2px var(--color-accent);
  z-index: 10;
  animation: scan-laser 2s infinite linear alternate;
  display: none;
}
.scanner-wrapper.scanning .scanner-laser {
  display: block;
}

@keyframes scan-laser {
  0% {
    top: 5%;
  }
  100% {
    top: 95%;
  }
}

.success-burst {
  animation: success-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes success-pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ══════════════ HOSPITALIZATION PROGRESS TRACKER ══════════════ */
.hosp-progress-inline {
  width: 100%;
  position: relative;
  z-index: 1;
}

.hosp-progress-card {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.78rem 0 0;
  position: relative;
  overflow: visible;
}
.hosp-progress-card::before {
  display: none;
}
@keyframes shimmer-bar {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.hosp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.58rem;
}
.hosp-progress-label {
  display: none;
}
.hosp-progress-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.92);
  line-height: 1.2;
}
.hosp-progress-pct {
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 900;
  color: #4fd1c5;
  line-height: 1;
  letter-spacing: 0;
}

.hosp-progress-bar-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  position: relative;
  overflow: visible;
  margin-bottom: 0.65rem;
}
.hosp-progress-bar-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--color-primary) 0%, #4fd1c5 100%);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 2%;
}
.hosp-progress-bar-pulse {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4fd1c5;
  box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
  transition: left 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: -6px;
}
@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(79, 209, 197, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 209, 197, 0);
  }
}

.hosp-progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: rgba(226, 232, 240, 0.62);
}
.hosp-est-edit-btn {
  flex: 0 0 auto;
  background: rgba(79, 209, 197, 0.1);
  border: 1px solid rgba(79, 209, 197, 0.28);
  color: #4fd1c5;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  line-height: 1.25;
  white-space: nowrap;
}
.hosp-est-edit-btn:hover {
  background: rgba(79, 209, 197, 0.18);
  border-color: rgba(79, 209, 197, 0.45);
}

/* ── Discharge Summary Panel ─────────────────────────────────────────── */
#discharge-summary-panel {
  border-top: 1px solid rgba(104, 211, 145, 0.25);
  padding-top: 0.85rem;
  margin-top: 0.1rem;
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.discharge-summary-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.discharge-summary-stats {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
}
.discharge-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  background: rgba(104, 211, 145, 0.08);
  border: 1px solid rgba(104, 211, 145, 0.2);
  border-radius: 10px;
  padding: 0.5rem 0.3rem;
}
.discharge-stat-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: #68d391;
  line-height: 1;
}
.discharge-stat-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.discharge-new-btn {
  width: 100%;
  background: rgba(104, 211, 145, 0.15);
  border: 1px solid rgba(104, 211, 145, 0.35);
  color: #68d391;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}
.discharge-new-btn:hover {
  background: rgba(104, 211, 145, 0.22);
  border-color: rgba(104, 211, 145, 0.5);
}

/* ── Standalone Wellness Tip Panel ───────────────────────────────────── */
#standalone-tip-panel {
  border-top: 1px solid rgba(79, 209, 197, 0.2);
  padding-top: 0.85rem;
  margin-top: 0.1rem;
  animation: fadeInUp 0.4s ease;
}
.standalone-tip-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.standalone-tip-quote {
  font-size: 0.83rem;
  font-style: italic;
  color: rgba(226, 232, 240, 0.85);
  line-height: 1.55;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid rgba(79, 209, 197, 0.5);
  background: rgba(79, 209, 197, 0.06);
  border-radius: 0 8px 8px 0;
}

@media (max-width: 360px) {
  .day-counter-wrap {
    padding-inline: 0.5rem;
  }
  .day-counter-card {
    padding: 0.95rem;
    gap: 0.75rem;
  }
  .day-counter-main {
    gap: 0.6rem;
  }
  .day-counter-label {
    font-size: 0.8rem;
  }
  .day-counter-title {
    font-size: 0.98rem;
  }
  .day-counter-subtitle {
    font-size: 0.78rem;
  }
  .day-counter-badge {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
    padding: 0.35rem;
  }
  .day-counter-badge-label {
    font-size: 0.48rem;
  }
  .day-counter-number {
    font-size: 1.95rem;
  }
  .hosp-progress-footer {
    gap: 0.3rem;
    font-size: 0.62rem;
  }
  .hosp-est-edit-btn {
    padding: 3px 8px;
    font-size: 0.62rem;
  }
}

/* ══════════════ SHARE APP BUTTON ══════════════ */
.share-app-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(
    135deg,
    rgba(49, 151, 149, 0.08) 0%,
    rgba(79, 209, 197, 0.06) 100%
  );
  border: 1px dashed rgba(49, 151, 149, 0.4);
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
  text-align: center;
  line-height: 1.4;
}
.share-app-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(49, 151, 149, 0.15) 0%,
    rgba(79, 209, 197, 0.1) 100%
  );
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(49, 151, 149, 0.15);
}
.share-app-btn:active {
  transform: scale(0.98);
}

body.dark-theme .share-app-btn {
  border-color: rgba(79, 209, 197, 0.35);
  color: #4fd1c5;
}
body.dark-theme .hosp-progress-card {
  border-top-color: rgba(79, 209, 197, 0.16);
}

/* Ethical sponsorship preview: enabled only with ?sponsor-preview=1 */
.sponsor-preview-only {
  display: none;
}

body.sponsor-preview-mode .sponsor-preview-only {
  display: block;
}

.pillar-sponsor {
  margin: -0.5rem 0 1.25rem;
  padding: 0.7rem 0.75rem;
  background: rgba(49, 151, 149, 0.055);
  border: 1px solid rgba(49, 151, 149, 0.2);
  border-radius: 8px;
  position: relative;
}

.pillar-sponsor__preview-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.pillar-sponsor__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
}

.pillar-sponsor__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--color-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.2);
}

.pillar-sponsor__logo svg {
  width: 23px;
  height: 23px;
}

.pillar-sponsor__copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pillar-sponsor__copy span {
  color: var(--color-text-muted);
  font-size: 0.67rem;
  line-height: 1.3;
}

.pillar-sponsor__copy strong {
  overflow: hidden;
  color: var(--color-text-main);
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pillar-sponsor__details {
  position: relative;
  flex: 0 0 36px;
}

.pillar-sponsor__details summary {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid rgba(49, 151, 149, 0.25);
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}

.pillar-sponsor__details summary::-webkit-details-marker {
  display: none;
}

.pillar-sponsor__details summary svg {
  width: 19px;
  height: 19px;
}

.pillar-sponsor__details[open] summary {
  color: #fff;
  background: var(--color-primary);
}

.pillar-sponsor__disclosure {
  width: min(290px, calc(100vw - 3rem));
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 20;
  padding: 0.8rem;
  color: var(--color-text-main);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.pillar-sponsor__disclosure strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-primary);
  font-size: 0.78rem;
}

.pillar-sponsor__disclosure p,
.pillar-sponsor__disclosure span {
  display: block;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.pillar-sponsor__disclosure span {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
}

body.dark-theme .pillar-sponsor {
  background: rgba(79, 209, 197, 0.055);
  border-color: rgba(79, 209, 197, 0.18);
}

.shortcuts-hospital-card {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  text-align: left;
  border-color: rgba(49, 151, 149, 0.3);
}

.shortcuts-hospital-card .card-icon {
  width: 54px;
  height: 54px;
  margin: 0;
}

.shortcuts-hospital-copy {
  min-width: 0;
}

.shortcuts-hospital-card h3,
.shortcuts-hospital-card p {
  text-align: left;
}

.shortcuts-hospital-card h3 {
  margin-bottom: 0.25rem;
}

.shortcuts-hospital-arrow {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

/* ==========================================
   PREMIUM UI OVERRIDES FOR EXPENSES (ADDED RECENTLY)
   ========================================== */
.expenses-summary-card {
  background: linear-gradient(135deg, var(--color-primary), #234e52) !important;
  color: white !important;
  padding: 2rem 1.5rem !important;
  border-radius: 20px !important;
  text-align: center !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 10px 25px rgba(49, 151, 149, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.expenses-summary-card::before {
  content: "??";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 8rem;
  opacity: 0.05;
  transform: rotate(-15deg);
  pointer-events: none;
}
body.dark-theme .expenses-summary-card {
  background: linear-gradient(
    135deg,
    #2b6cb0,
    var(--color-secondary)
  ) !important;
  box-shadow: 0 10px 25px rgba(43, 108, 176, 0.3) !important;
}
.expenses-summary-amount {
  font-size: 2.75rem !important;
  font-weight: 800 !important;
  margin-top: 0.5rem !important;
  font-family: "Outfit", "Inter", sans-serif !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  letter-spacing: -0.5px !important;
}
.expenses-form-grid {
  gap: 1.25rem !important;
  margin-bottom: 2rem !important;
  padding: 1.5rem !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-sm) !important;
}
.expenses-form-field input,
.expenses-form-field select {
  padding: 0.85rem 1rem !important;
  border-radius: 10px !important;
  background: var(--color-bg) !important;
}
.expenses-add-btn {
  background: linear-gradient(
    135deg,
    var(--color-primary-light),
    var(--color-primary)
  ) !important;
  padding: 1rem !important;
  border-radius: 12px !important;
  font-size: 1.05rem !important;
  gap: 0.6rem !important;
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.25) !important;
}
.expenses-empty-state {
  padding: 3rem 1.5rem !important;
  background: linear-gradient(
    180deg,
    var(--color-surface),
    var(--color-bg)
  ) !important;
  border: 1px solid rgba(226, 232, 240, 0.1) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}
body.dark-theme .expenses-empty-state {
  border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Care analytics dashboard */
.analytics-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 5.5rem;
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.analytics-metric-card,
.analytics-chart-panel,
.analytics-insight {
  background: linear-gradient(
    145deg,
    var(--color-surface),
    var(--color-surface-overlay)
  );
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.analytics-metric-card {
  min-height: 150px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.analytics-metric-card::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--analytics-accent, var(--color-primary));
  opacity: 0.82;
}

.metric-care {
  --analytics-accent: var(--color-primary);
}
.metric-handover {
  --analytics-accent: var(--color-secondary);
}
.metric-attention {
  --analytics-accent: var(--color-error);
}

.analytics-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.analytics-card-top svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--analytics-accent, var(--color-primary));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-metric-card strong {
  display: block;
  margin-top: 0.7rem;
  color: var(--color-text-main);
  font-size: clamp(2.2rem, 8vw, 3.35rem);
  font-weight: 850;
  line-height: 1;
}

.analytics-metric-card small {
  display: block;
  margin-top: 0.65rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.metric-attention strong {
  color: var(--color-error);
}

.analytics-chart-panel {
  padding: 1rem;
}

.analytics-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.analytics-panel-header h3 {
  margin: 0;
  color: var(--color-text-main);
  font-size: 1rem;
  font-weight: 800;
}

.analytics-panel-header p {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.analytics-range-pill {
  min-width: 42px;
  padding: 0.36rem 0.55rem;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.2rem 0 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.analytics-legend span::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: currentColor;
}

.analytics-legend .legend-bp {
  color: var(--color-primary);
}
.analytics-legend .legend-dia {
  color: var(--color-accent);
}

.analytics-chart {
  min-height: 230px;
}

.analytics-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.analytics-grid-line {
  stroke: var(--color-border);
  stroke-width: 1;
}

.analytics-axis-label {
  fill: var(--color-text-muted);
  font-size: 10px;
}

.analytics-bp-line,
.analytics-dia-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-bp-line {
  stroke: var(--color-primary);
  stroke-width: 3;
}

.analytics-dia-line {
  stroke: var(--color-accent);
  stroke-width: 2.5;
}

.analytics-bp-area {
  fill: var(--color-primary);
  opacity: 0.09;
}

.analytics-dot {
  stroke: var(--color-surface);
  stroke-width: 2;
}

.analytics-empty-state {
  display: none;
  padding: 2rem 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
  background: var(--color-background-app);
}

.analytics-empty-state.visible {
  display: block;
}

.analytics-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.analytics-insight {
  padding: 0.95rem;
}

.analytics-insight strong {
  display: block;
  color: var(--color-text-main);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.analytics-insight span {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.analytics-disclaimer {
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--color-warning);
  border-radius: 0 12px 12px 0;
  background: var(--color-warning-light);
  color: var(--color-text-main);
  font-size: 0.78rem;
  line-height: 1.5;
}

body.dark-theme .analytics-metric-card,
body.dark-theme .analytics-chart-panel,
body.dark-theme .analytics-insight {
  background: linear-gradient(
    145deg,
    rgba(31, 41, 55, 0.96),
    rgba(17, 24, 39, 0.96)
  );
}

body.dark-theme .analytics-bp-area {
  opacity: 0.16;
}

@media (max-width: 720px) {
  .analytics-metrics-grid,
  .analytics-insights-grid {
    grid-template-columns: 1fr;
  }

  .analytics-metric-card {
    min-height: 132px;
  }

  .analytics-panel-header {
    display: grid;
  }

  .analytics-chart {
    min-height: 205px;
  }
}

/* ==========================================
   HOME SCREEN PREMIUM UPGRADES (v1.6)
   ========================================== */

/* -- Quick Actions Horizontal Strip -- */
.quick-actions-strip {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-left: 1rem;
}
.quick-actions-strip::-webkit-scrollbar {
  display: none;
}

.quick-action-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 68px;
  padding: 0.65rem 0.5rem 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  scroll-snap-align: start;
}
.quick-action-chip:first-child {
  margin-left: 1rem;
}
.quick-action-chip:last-child {
  margin-right: 1rem;
}
.quick-action-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.15);
  border-color: var(--color-primary);
}
.quick-action-chip:active {
  transform: scale(0.96);
}
.qa-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.qa-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-align: center;
  line-height: 1.15;
}

/* -- Self Care Visual Cards -- */
.self-care-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  padding: 0.85rem 0.5rem !important;
  min-height: 72px !important;
  border-radius: 14px !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.self-care-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.12) !important;
  border-color: var(--color-primary) !important;
}
.self-care-card:active {
  transform: scale(0.96) !important;
}
.self-care-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.self-care-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-align: center;
  line-height: 1.2;
}

/* -- Shift Status Dots -- */
.shift-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0.5rem;
}
.shift-status-dot.done {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(72, 187, 120, 0.4);
}
.shift-status-dot.pending {
  background: var(--color-text-muted);
  opacity: 0.35;
}

/* -- PWA Banner Compact Toast -- */
.pwa-install-banner {
  position: fixed !important;
  bottom: 75px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 2rem) !important;
  max-width: 380px !important;
  border-radius: 16px !important;
  padding: 0.85rem 1rem !important;
  z-index: 999 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2) !important;
  animation: slideUpToast 0.4s ease-out !important;
}
@keyframes slideUpToast {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* -- Empathy Leaf Aura -- */
.aura-leaf-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(49, 151, 149, 0.05);
  animation: leafAuraPulse 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes leafAuraPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(49, 151, 149, 0.4),
      0 0 20px rgba(49, 151, 149, 0.2) inset;
    transform: scale(0.95);
  }
  50% {
    box-shadow:
      0 0 0 20px rgba(49, 151, 149, 0),
      0 0 35px rgba(49, 151, 149, 0.4) inset;
    transform: scale(1.05);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(49, 151, 149, 0),
      0 0 20px rgba(49, 151, 149, 0.2) inset;
    transform: scale(0.95);
  }
}

/* ==========================================
   HOME PRIORITIES (v1.7)
   ========================================== */
.home-phase-hero {
  margin: 0 1rem 0.65rem;
  padding: 0.45rem 0 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid #3182ce;
}

.home-phase-hero[data-phase="home_care"] {
  border-left-color: #319795;
}

.home-phase-hero[data-phase="daily"] {
  border-left-color: #805ad5;
}

.home-phase-hero-kicker {
  display: block;
  color: #3182ce;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.home-phase-hero[data-phase="home_care"] .home-phase-hero-kicker {
  color: #258b87;
}

.home-phase-hero[data-phase="daily"] .home-phase-hero-kicker {
  color: #805ad5;
}

.home-phase-hero h1 {
  margin: 0.18rem 0 0;
  color: var(--color-text-main);
  font-size: 1.4rem;
  line-height: 1.15;
}

.home-phase-hero p {
  margin: 0.28rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.home-priority-section {
  margin: 0 1rem 0.55rem;
}

.home-priority-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.home-priority-heading h2 {
  margin: 0;
  color: var(--color-text-main);
  font-size: 1.08rem;
  line-height: 1.2;
}

.home-phase-switcher {
  position: relative;
  flex: 0 0 auto;
}

.home-priority-summary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(99, 179, 237, 0.34);
  border-radius: 999px;
  background: rgba(49, 130, 206, 0.1);
  color: #3182ce;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-priority-summary:hover {
  filter: brightness(1.08);
}

.home-priority-summary:focus-visible,
.home-phase-menu-option:focus-visible {
  outline: 3px solid color-mix(in srgb, currentColor 32%, transparent);
  outline-offset: 2px;
}

.home-phase-chevron {
  font-size: 0.82rem;
  line-height: 1;
  transition: transform 0.16s ease;
}

.home-priority-summary[aria-expanded="true"] .home-phase-chevron {
  transform: rotate(180deg);
}

.home-phase-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 80;
  width: 210px;
  max-width: calc(100vw - 2rem);
  padding: 0.4rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.home-phase-menu[hidden],
.home-phase-menu-option[hidden] {
  display: none;
}

.home-phase-menu-title {
  display: block;
  padding: 0.3rem 0.55rem 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.home-phase-menu-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-main);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.home-phase-menu-option:hover {
  background: var(--color-bg);
}

.home-phase-menu-option::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3182ce;
}

.home-phase-menu-option[data-home-care-phase="home_care"]::before {
  background: #319795;
}

.home-phase-menu-option[data-home-care-phase="daily"]::before {
  background: #805ad5;
}

.home-priority-summary[data-phase="home_care"] {
  border-color: rgba(49, 151, 149, 0.36);
  background: rgba(49, 151, 149, 0.1);
  color: #258b87;
}

.home-priority-summary[data-phase="daily"] {
  border-color: rgba(128, 90, 213, 0.34);
  background: rgba(128, 90, 213, 0.1);
  color: #805ad5;
}

body.dark-theme .home-priority-summary {
  color: #63b3ed;
}

body.dark-theme .home-priority-summary[data-phase="home_care"] {
  color: #4fd1c5;
}

body.dark-theme .home-priority-summary[data-phase="daily"] {
  color: #b794f4;
}

.home-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.6rem;
}

.home-priority-action {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
  padding: 0.35rem 0.55rem;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.home-priority-action:active {
  transform: scale(0.98);
}

.home-priority-primary {
  background: linear-gradient(135deg, #38b2ac, #258b87);
  border-color: #4fd1c5;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(49, 151, 149, 0.24);
}

.home-priority-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.home-priority-copy {
  display: inline-flex;
  min-width: 0;
}

.home-priority-copy strong,
.home-priority-copy small {
  display: inline;
}

.home-priority-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
}

.home-priority-copy small {
  display: none;
}

body.dark-theme .home-priority-action {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

body.dark-theme .home-priority-primary {
  background: linear-gradient(135deg, #38b2ac, #258b87);
  border-color: #4fd1c5;
  color: #ffffff;
}

.home-priority-action[data-tone="blue"] {
  background: rgba(49, 130, 206, 0.1);
  border-color: rgba(99, 179, 237, 0.36);
}

.home-priority-action[data-tone="blue"] .home-priority-icon {
  color: #63b3ed;
}

.home-priority-action[data-tone="violet"] {
  background: rgba(128, 90, 213, 0.1);
  border-color: rgba(183, 148, 246, 0.34);
}

.home-priority-action[data-tone="violet"] .home-priority-icon {
  color: #b794f4;
}

.home-priority-action[data-tone="amber"] {
  background: rgba(246, 173, 85, 0.1);
  border-color: rgba(246, 173, 85, 0.34);
}

.home-priority-action[data-tone="amber"] .home-priority-icon {
  color: #f6ad55;
}

body.dark-theme .home-priority-action[data-tone="blue"] {
  background: rgba(49, 130, 206, 0.18);
  border-color: rgba(99, 179, 237, 0.42);
}

body.dark-theme .home-priority-action[data-tone="violet"] {
  background: rgba(128, 90, 213, 0.18);
  border-color: rgba(183, 148, 246, 0.4);
}

body.dark-theme .home-priority-action[data-tone="amber"] {
  background: rgba(246, 173, 85, 0.16);
  border-color: rgba(246, 173, 85, 0.42);
}

/* Compact SOS matches the quick-action rhythm without reducing its prominence. */
.home-sos-wrap {
  padding: 0 1rem 0.65rem;
}

.home-sos-bar {
  min-height: 40px;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
  box-shadow: none;
  text-align: center;
}

.home-sos-icon {
  width: auto;
  height: auto;
  background: transparent;
  color: currentColor;
  font-size: 1rem;
  font-weight: 500;
}

.home-sos-bar strong {
  display: inline;
  font-size: 0.88rem;
  line-height: 1.1;
}

.home-sos-bar small {
  display: none;
}

body.dark-theme .home-sos-bar {
  background: rgba(252, 129, 129, 0.12);
  border-color: rgba(252, 129, 129, 0.4);
  color: #fed7d7;
}

body.dark-theme .home-sos-icon {
  background: transparent;
  color: #fc8181;
}

.home-utility-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 1rem 0.85rem;
}

.home-utility-button {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: transparent;
  color: var(--color-text-main);
  padding: 0.55rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.home-utility-button span {
  color: var(--color-primary);
  margin-right: 0.2rem;
}

#home-today-panel {
  padding: 0.85rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

#home-today-panel .shift-panel-top {
  margin-bottom: 0.65rem;
}

#home-today-panel #home-medication-widget-container {
  padding: 0;
  margin: 0 0 0.7rem;
}

.home-today-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.home-today-footer .today-backup-status {
  min-height: 30px;
}

@media (max-width: 360px) {
  .home-phase-hero,
  .home-priority-section,
  .home-utility-row {
    margin-inline: 0.5rem;
  }

  .home-phase-hero {
    padding-left: 0.6rem;
  }

  .home-phase-hero h1 {
    font-size: 1.22rem;
  }

  .home-priority-action {
    min-height: 40px;
    gap: 0.3rem;
    padding: 0.3rem 0.4rem;
  }

  .home-priority-icon {
    font-size: 0.9rem;
  }

  .home-priority-copy strong {
    font-size: 0.8rem;
  }

  .home-utility-button {
    font-size: 0.68rem;
  }
}

/* ==========================================
   PATIENT CARE PHASE (v1.7)
   ========================================== */
.settings-care-phase {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.settings-care-phase-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text-main);
}

.settings-care-phase-heading > span {
  font-size: 1.15rem;
}

.settings-care-phase-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-care-phase-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.settings-care-phase-heading small {
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.care-phase-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.care-phase-option {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.3rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.care-phase-option.is-active {
  color: #ffffff;
}

.care-phase-option[data-care-phase="hospital"].is-active {
  border-color: #63b3ed;
  background: #3182ce;
}

.care-phase-option[data-care-phase="home_care"].is-active {
  border-color: #4fd1c5;
  background: #258b87;
}

.care-phase-option[data-care-phase="daily"].is-active {
  border-color: #b794f4;
  background: #805ad5;
}

.care-phase-option[data-care-phase="daily"] {
  font-size: 0.66rem;
  overflow-wrap: normal;
  white-space: nowrap;
}

.care-phase-confirm {
  border-top: 1px solid var(--color-border);
  padding-top: 0.65rem;
}

.care-phase-confirm p {
  margin: 0 0 0.55rem;
  color: var(--color-text-main);
  font-size: 0.8rem;
  line-height: 1.35;
}

.care-phase-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.care-phase-confirm-actions button {
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-main);
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

#settings-care-phase-confirm-btn {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

@media (max-width: 480px) {
  .care-phase-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .care-phase-option[data-care-phase="daily"] {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .care-phase-option {
    min-height: 42px;
    font-size: 0.66rem;
  }
}
