/* ============================================================
   MHFCare Dashboard — Design Tokens & Custom Styles
   All visual values are defined here as CSS variables.
   Never hardcode colors or spacing directly in HTML.
   ============================================================ */

/* ------------------------------------------------------------
   Tailwind Custom Config (applied via the inline config block
   in each HTML page's <script> tag)
   See: pages/summary-dashboard.html for the config example.
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   ------------------------------------------------------------ */
:root {
  /* --- Colors: Backgrounds --- */
  --color-bg:            #e3f0fe;   /* Page background (light blue) */
  --color-nav-bg:        #5a95f5;   /* Navigation panel background */
  --color-card-bg:       #ffffff;   /* Card and modal surfaces */
  --color-surface-light: #f3f4f6;   /* Light surface / secondary backgrounds */
  --color-overlay:       rgba(0, 0, 0, 0.35); /* Modal backdrop */

  /* --- Colors: Text --- */
  --color-primary-text:  #3c414e;   /* Primary body text and icons */
  --color-muted-text:    #c6c9d2;   /* Secondary / placeholder text */
  --color-nav-text:      #ffffff;   /* Navigation panel text */
  --color-near-black:    #121214;   /* Deep text / dark backgrounds */

  /* --- Colors: Interactive --- */
  --color-accent:        #5a95f5;   /* Links, active stepper dots, highlights */
  --color-cta-blue:      #5a95f5;   /* "Start Exercising" button */
  --color-cta-orange:    #f5a623;   /* "Log My Exercise" button */
  --color-nav-active-bg: #ffffff;   /* Active nav item pill background */
  --color-nav-active-text: #3c414e; /* Active nav item text */
  --color-logout-bg:     #1e2330;   /* Logout button background */

  /* --- Colors: Inflammation Scale --- */
  --color-inflammation-1: #00c853;  /* Green — Low inflammation */
  --color-inflammation-2: #69f000;  /* Light green */
  --color-inflammation-3: #b2ff00;  /* Yellow-green */
  --color-inflammation-4: #ffd600;  /* Yellow — Moderate */
  --color-inflammation-5: #ffab00;  /* Amber */
  --color-inflammation-6: #ff6d00;  /* Orange */
  --color-inflammation-7: #dd2c00;  /* Red-orange */
  --color-inflammation-8: #d50000;  /* Red — High inflammation */

  /* --- Typography --- */
  --font-family:         'Inter', sans-serif;

  --text-welcome-size:   2rem;
  --text-welcome-weight: 700;
  --text-app-title-size: 1.125rem;
  --text-app-title-weight: 700;
  --text-card-title-size: 1.25rem;
  --text-card-title-weight: 700;
  --text-card-subtitle-size: 0.875rem;
  --text-nav-item-size:  1rem;
  --text-body-size:      0.875rem;
  --text-disclaimer-size: 0.75rem;
  --text-badge-size:     0.75rem;

  /* --- Spacing --- */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;

  /* --- Border Radius --- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-pill: 999px;

  /* --- Shadows --- */
  --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-modal:   0 8px 32px rgba(0, 0, 0, 0.18);
  --shadow-panel:   -4px 0 24px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* --- Component Sizes --- */
  --header-height-desktop: 113px;
  --header-height-mobile:  88px;
  --nav-panel-width:       342px;
  --bottom-nav-height:     72px;
  --sidebar-toggle-size:   36px;
}

/* ------------------------------------------------------------
   Base Resets & Defaults
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 16px;
  background-color: var(--color-bg);
  color: var(--color-primary-text);
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------
   Tailwind CDN fallbacks
   When cdn.tailwindcss.com is slow or blocked (common on mobile
   networks), responsive utility classes never apply. These rules
   mirror the most critical hidden/lg:* patterns used in page HTML.
   ------------------------------------------------------------ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

@media (max-width: 1023px) {
  .hidden.lg\:flex,
  .hidden.lg\:block,
  .hidden.lg\:inline-flex,
  .hidden.lg\:inline-block {
    display: none !important;
  }

  .stepper-nav {
    display: none !important;
  }

  .sidebar-toggle {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .lg\:hidden {
    display: none !important;
  }

  .hidden.lg\:flex {
    display: flex !important;
  }

  .hidden.lg\:block {
    display: block !important;
  }

  .hidden.lg\:inline-flex {
    display: inline-flex !important;
  }

  .hidden.lg\:inline-block {
    display: inline-block !important;
  }
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.page-wrapper {
  min-height: 100vh;
  background-color: var(--color-bg);
  position: relative;
  overflow-x: hidden;
}

.main-content {
  padding: var(--space-md);
  width: 100%;
}

@media (min-width: 1024px) {
  .main-content {
    padding: var(--space-xl) var(--space-lg);
  }
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.app-header {
  background-color: var(--color-card-bg);
  height: var(--header-height-desktop);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 0;
  z-index: 40;
  gap: var(--space-lg);
  /* Do NOT use overflow:hidden — it clips the More dropdown menu */
  overflow: visible;
}

/* Tailwind's .relative must not override sticky header positioning */
.app-header.relative {
  position: sticky;
  top: 0;
}

/* Logo in the header: hard-cap it before Tailwind's w-12/h-12 applies (FOUC fix) */
.app-header img:first-child {
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 12px;
}

@media (max-width: 1023px) {
  .app-header {
    height: auto;
    min-height: var(--header-height-mobile);
    padding: var(--space-sm) var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .app-header h1 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .app-header p {
    font-size: 0.75rem;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-md));
  }
}

/* ------------------------------------------------------------
   Stepper Navigation
   Desktop only — hidden on mobile (Tailwind `hidden lg:flex` is
   overridden by this file's display rules, so we enforce it here).
   ------------------------------------------------------------ */
.stepper-nav {
  display: none;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}

@media (min-width: 1024px) {
  .stepper-nav {
    display: flex;
  }
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.stepper-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);  /* matches active dot color */
  background: var(--color-card-bg);
  flex-shrink: 0;
}

.stepper-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.stepper-connector {
  height: 3px;
  width: 78px;
  background: var(--color-muted-text);
  flex-shrink: 0;
}

.stepper-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-muted-text);
}

.stepper-label.active {
  color: var(--color-accent);
  font-weight: 700;
}

.stepper-chevron {
  color: var(--color-muted-text);
  font-size: 2rem;
  margin: 0 var(--space-xs);
  line-height: 1;
}

.notifications-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  visibility: hidden;
}

.notifications-panel-overlay.open {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

/* Right-side notifications panel — mobile: full screen; desktop: half screen */
.notifications-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  background-color: var(--color-card-bg);
  z-index: 99991;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  font-family: var(--font-sans, Inter, sans-serif);
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .notifications-panel {
    width: 50vw;
    max-width: 50vw;
  }
}

.notifications-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.notifications-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
}

.notifications-panel-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .notifications-panel-layout {
    flex-direction: row;
  }
}

.notifications-list-col {
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  max-height: 38vh;
}

@media (min-width: 1024px) {
  .notifications-list-col {
    width: 36%;
    min-width: 220px;
    max-width: 320px;
    max-height: none;
    border-bottom: none;
    border-right: 1px solid #eef2f7;
  }
}

.notifications-detail-col {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: #fafbfc;
}

.notifications-detail-inner {
  padding: 20px 22px 28px;
}

.notifications-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a95f5;
  margin-bottom: 8px;
}

.notifications-detail-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #3c414e;
  margin: 0 0 6px;
  line-height: 1.25;
}

.notifications-detail-meta {
  font-size: 0.82rem;
  color: #9ca3af;
  margin: 0 0 18px;
}

.notifications-detail-content {
  font-size: 0.92rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 24px;
}

.notifications-detail-thanks {
  color: #16a34a;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 12px 0;
}

.notifications-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.notifications-dismiss-btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.notifications-dismiss-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.notifications-respond-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: #5a95f5;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notifications-respond-btn:hover:not(:disabled) {
  background: #3a7ae4;
}

.notifications-respond-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notification-index {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-card--active .notification-index {
  background: #5a95f5;
  color: #fff;
}

.notification-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a95f5;
  white-space: nowrap;
}

.notification-card {
  width: 100%;
  text-align: left;
  border: 1.5px solid #eef2f7;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.notification-card:hover {
  border-color: #c6d9fc;
  box-shadow: 0 2px 8px rgba(90, 149, 245, 0.1);
}

.notification-card--active {
  border-color: #5a95f5;
  background: #f0f6ff;
  box-shadow: 0 2px 10px rgba(90, 149, 245, 0.15);
}

.notification-card--unread {
  border-left: 3px solid #5a95f5;
  background: #fafbff;
}

.notifications-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
}

/* ------------------------------------------------------------
   Navigation Panel (Sidebar / Drawer)
   ------------------------------------------------------------ */
.nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--nav-panel-width);
  background-color: var(--color-nav-bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--space-md);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.nav-panel.open {
  transform: translateX(0);
}

.nav-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  color: var(--color-nav-text);
  font-size: var(--text-nav-item-size);
  text-decoration: none;
  transition: background 0.15s ease;
  margin-bottom: var(--space-xs);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-item.active {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Sidebar Toggle Button (desktop left edge)
   Hidden on mobile — same Tailwind override issue as stepper-nav.
   ------------------------------------------------------------ */
.sidebar-toggle {
  display: none;
  position: fixed;
  left: 0;
  top: calc(var(--header-height-desktop) + 25px);
  transform: none;
  width: var(--sidebar-toggle-size);
  height: 60px;
  background: var(--color-accent);
  color: white;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 45;
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: var(--shadow-card);
  border: none;
  transition: background 0.15s ease;
}

@media (min-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }
}

.sidebar-toggle:hover {
  background: #3d7de8;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  font-size: var(--text-body-size);
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-cta-blue);
  color: white;
}

.btn-action {
  background: var(--color-cta-orange);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-text);
  border: 1.5px solid var(--color-muted-text);
}

.btn-logout {
  background: var(--color-logout-bg);
  color: white;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  display: none; /* desktop-only; .btn display:inline-flex would override Tailwind hidden */
}

@media (min-width: 1024px) {
  .btn-logout {
    display: inline-flex;
  }
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

/* ------------------------------------------------------------
   Inflammation Scale Bar
   ------------------------------------------------------------ */
.scale-bar-wrapper {
  padding: var(--space-md) var(--space-lg);
  position: relative;
}

.scale-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.scale-bar-segment {
  flex: 1;
}

.scale-indicator {
  position: absolute;
  top: 0;                    /* sits at the top of the padding-top space above the bar */
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 20px solid var(--color-near-black);
  transform: translateX(-50%);
  transition: left 0.5s ease;
}

/* ------------------------------------------------------------
   More Dropdown
   ------------------------------------------------------------ */
/* Step that hosts the More menu — sit above stepper connectors when open */
.stepper-step.relative {
  z-index: 50;
}

.more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 80px;
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.more-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 1.25rem;
  font-weight: 400;
  color: #4a4a4a;
  text-decoration: none;
  transition: background 0.1s ease;
  cursor: pointer;
}

.more-dropdown-item:hover {
  background: var(--color-surface-light);
}

/* ------------------------------------------------------------
   Modals & Overlays
   ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background: var(--color-card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  max-width: 560px;
  width: 90%;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-surface-light);
  flex-shrink: 0;
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-primary-text);
  line-height: 1;
  padding: var(--space-xs);
}

/* Mobile: modal as bottom sheet */
@media (max-width: 639px) {
  .modal-backdrop {
    align-items: flex-end;
  }
  .modal-dialog {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90dvh;         /* dvh respects the visible viewport on mobile browsers */
    overflow-x: hidden;
    overflow-y: auto;          /* override base overflow:hidden so content is scrollable */
    -webkit-overflow-scrolling: touch;
    /* push content above the iOS home indicator / Android nav bar */
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
}

/* ------------------------------------------------------------
   Info Panel (right side panel on desktop, bottom sheet on mobile)
   ------------------------------------------------------------ */
.info-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 400px;
  background: var(--color-card-bg);
  z-index: 55;
  box-shadow: var(--shadow-panel);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.info-panel.open {
  transform: translateX(0);
}

@media (max-width: 639px) {
  .info-panel {
    width: 100%;
    height: 85vh;
    top: auto;
    bottom: 0;
    right: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
  }
  .info-panel.open {
    transform: translateY(0);
  }
}

.info-section-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-near-black);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Doctor Nudge (fixed bottom-right avatar)
   ------------------------------------------------------------ */
.doctor-nudge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 35;
  cursor: pointer;
}

.doctor-nudge-inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
}

/* Close button on the doctor nudge widget */
.doctor-nudge-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  background: #5a95f5;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  z-index: 36;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background 0.15s;
}
.doctor-nudge-close:hover { background: #3a75d5; }

@media (max-width: 639px) {
  .doctor-nudge {
    bottom: calc(var(--bottom-nav-height) + 10px);
  }
}

/* Combined doctor + speech-bubble figure (transparent PNG, looks good on any background) */
.doctor-nudge-figure {
  width: 190px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 639px) {
  .doctor-nudge-figure {
    width: 140px;
  }
}

/* ------------------------------------------------------------
   Video Player (custom styled)
   ------------------------------------------------------------ */
.video-player {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

.video-controls {
  background: #1a1a1a;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.video-progress {
  flex: 1;
  height: 4px;
  background: #444;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.video-progress-fill {
  height: 100%;
  background: #e53935;
  border-radius: 2px;
  width: 65%;
}

.video-progress-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e53935;
}

/* ------------------------------------------------------------
   Bottom Navigation (mobile only)
   ------------------------------------------------------------ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-card-bg);
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--color-muted-text);
  font-size: 0.7rem;
  font-weight: 500;
  flex: 1;
  padding: var(--space-sm) 0;
  transition: color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
}

.bottom-nav-item.active {
  color: var(--color-primary-text);
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
}

/* Spacer so content doesn't hide behind bottom nav on mobile */
.bottom-nav-spacer {
  height: var(--bottom-nav-height);
}

/* ------------------------------------------------------------
   Alpine.js Transition Helpers
   ------------------------------------------------------------ */
[x-cloak] { display: none !important; }

/* ------------------------------------------------------------
   Utility: Divider
   ------------------------------------------------------------ */
.divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  margin: var(--space-md) 0;
}

.divider-dark {
  border-top-color: #e5e7eb;
}

/* ------------------------------------------------------------
   Health Insights — Health Insights intro card
   ------------------------------------------------------------ */
.health-insights-card {
  background: #eaf2f9;
  border: 1px solid #d1e1ef;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: var(--space-lg);
}

.health-insights-card__title {
  /* Prefer Tailwind text-2xl font-extrabold on the element; kept for legacy references */
  font-size: 1.5rem;
  font-weight: 800;
  color: #3c414e;
  margin: 0 0 10px;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
}

.health-insights-card__body {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 16px;
}

.health-insights-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.health-insights-callout__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.health-insights-callout__icon img {
  display: block;
  width: 48px;
  height: 48px;
}

.health-insights-callout__headline {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #72bf44;
  margin: 0 0 4px;
  line-height: 1.35;
}

.health-insights-callout__text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #475569;
  margin: 0;
}

/* ------------------------------------------------------------
   Health Insights — Age metrics + download report row
   ------------------------------------------------------------ */
.insights-metrics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: stretch;
}

.metrics-panel__header {
  background: #6b7280;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px 16px;
  border-bottom: 1px solid #5b6370;
}

.metrics-panel__header--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.metrics-panel__header-title {
  font-weight: 800;
}

.metrics-panel__header-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-align: right;
  line-height: 1.35;
}

.age-metrics-panel,
.disease-metrics-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.age-metrics-panel__body {
  padding: 22px 24px 26px;
}

.age-metrics-panel__stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px 24px;
  align-items: stretch;
  min-height: 88px;
}

.age-metrics-divider {
  width: 1px;
  background: #d1d5db;
  justify-self: center;
  align-self: stretch;
}

.age-metrics-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 8px;
}

.age-metrics-stat__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #3c414e;
  line-height: 1.3;
}

.age-metrics-stat__value {
  font-size: 2.25rem;
  font-weight: 900;
  color: #5a95f5;
  line-height: 1;
}

.download-report-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 100%;
}

.download-report-card__icon {
  margin-bottom: 12px;
}

.download-report-card__title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #3c414e;
  margin: 0 0 8px;
}

.download-report-card__text {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6b7280;
  margin: 0 0 14px;
}

.download-report-card__link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a95f5;
  cursor: pointer;
}

.download-report-card__link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.disease-metrics-panel__body {
  background: #fff;
}

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

  .age-metrics-panel__stats {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .age-metrics-divider {
    display: none;
  }

  .metrics-panel__header-hint {
    text-align: left;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .health-insights-card {
    padding: 16px;
  }

  .health-insights-callout {
    flex-direction: row;
    align-items: center;
  }
}
