/* ============================================================
   PeptideSafe — Million-Dollar Premium Theme v3
   Complete visual overhaul: depth, drama, density, polish
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --teal: #2563eb;
  --teal-light: #3b82f6;
  --teal-dark: #1d4ed8;
  --emerald: #2563eb;
  --emerald-light: #60a5fa;
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --cyan: #06b6d4;
  --pink: #ec4899;

  --bg: #f6f8fb;
  --bg-subtle: #f0f2f5;
  --bg-secondary: #eef1f6;
  --surface: #ffffff;
  --surface-hover: #fafbfc;
  --card: #ffffff;
  --border: rgba(0,0,0,0.06);
  --border-strong: rgba(0,0,0,0.1);

  --text: #0c1222;
  --text-primary: #0c1222;
  --text-secondary: #4b5675;
  --text-muted: #8994a8;

  --primary: #2563eb;

  --glass: rgba(255,255,255,0.72);
  --glass-strong: rgba(255,255,255,0.92);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-glow-teal: 0 0 20px rgba(37,99,235,0.15), 0 0 60px rgba(37,99,235,0.08);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 50px;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 72px;
}

/* ============================================================
   RESET & GLOBAL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'ss02', 'cv01';
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

::selection { background: rgba(37,99,235,0.15); color: var(--text); }

/* ============================================================
   UTILITY ANIMATIONS
   ============================================================ */
.ripple-container { position: relative; overflow: hidden; }
.ripple-effect {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
  transform: scale(0); animation: rippleExpand 0.7s ease-out forwards;
  pointer-events: none;
}

.view-enter { animation: viewSlideUp 0.5s var(--smooth) both; }
.view-exit  { animation: viewFadeOut 0.2s ease-out both; }

/* ============================================================
   PARTICLE CANVAS
   ============================================================ */
#particleCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  opacity: 0.5;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app { display: flex; height: 100vh; position: relative; z-index: 1; }

/* ============================================================
   SIDEBAR — Refined, compact, premium
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 12px;
  flex-shrink: 0; z-index: 20;
  position: relative;
  overflow: hidden;
  max-height: 100vh;
  transition: width 0.3s var(--smooth);
}
.sidebar::after {
  content: ''; position: absolute; top: 80px; right: -1px;
  width: 2px; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(37,99,235,0.2), rgba(59,130,246,0.1), transparent);
  animation: sidebarGlow 6s ease-in-out infinite alternate;
}

.sidebar-logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--emerald) 60%, var(--emerald-light) 100%);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin-bottom: 6px;
  transition: all 0.5s var(--spring);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sidebar-logo:hover {
  transform: scale(1.12) rotate(-5deg);
  box-shadow: 0 8px 28px rgba(37,99,235,0.4);
}
.sidebar-logo:active { transform: scale(0.92); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; width: 100%; padding: 8px 10px 0; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 4px 10px 0; flex-shrink: 0; }

.nav-btn {
  width: 100%; height: 42px; border-radius: 11px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; gap: 10px;
  transition: all 0.3s var(--smooth);
  position: relative;
  padding: 0;
}
.nav-btn:hover {
  background: rgba(0,0,0,0.04); color: var(--text-secondary);
  transform: scale(1.04);
}
.nav-btn:active { transform: scale(0.93); }

/* Per-icon active colors */
.nav-btn.active {
  box-shadow: inset 0 0 0 1.5px rgba(100,100,100,0.1);
}
.nav-btn[data-view="home"].active            { background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(37,99,235,0.04)); color: #2563eb; box-shadow: inset 0 0 0 1.5px rgba(37,99,235,0.15); }
.nav-btn[data-view="dashboard"].active       { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04)); color: #3b82f6; box-shadow: inset 0 0 0 1.5px rgba(59,130,246,0.15); }
.nav-btn[data-view="achievements"].active    { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04)); color: #f59e0b; box-shadow: inset 0 0 0 1.5px rgba(245,158,11,0.15); }
.nav-btn[data-view="knowledge"].active       { background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04)); color: #10b981; box-shadow: inset 0 0 0 1.5px rgba(16,185,129,0.15); }
.nav-btn[data-view="favorites"].active       { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04)); color: #f59e0b; box-shadow: inset 0 0 0 1.5px rgba(245,158,11,0.15); }
.nav-btn[data-view="calendar"].active        { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04)); color: #ef4444; box-shadow: inset 0 0 0 1.5px rgba(239,68,68,0.15); }
.nav-btn[data-view="tracker"].active         { background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(168,85,247,0.04)); color: #a855f7; box-shadow: inset 0 0 0 1.5px rgba(168,85,247,0.15); }
.nav-btn[data-view="journal"].active         { background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(236,72,153,0.04)); color: #ec4899; box-shadow: inset 0 0 0 1.5px rgba(236,72,153,0.15); }
.nav-btn[data-view="bloodwork"].active       { background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(220,38,38,0.04)); color: #dc2626; box-shadow: inset 0 0 0 1.5px rgba(220,38,38,0.15); }
.nav-btn[data-view="calc-pro"].active        { background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(6,182,212,0.04)); color: #06b6d4; box-shadow: inset 0 0 0 1.5px rgba(6,182,212,0.15); }
.nav-btn[data-view="builder"].active         { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(99,102,241,0.04)); color: #6366f1; box-shadow: inset 0 0 0 1.5px rgba(99,102,241,0.15); }
.nav-btn[data-view="interactions"].active    { background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(249,115,22,0.04)); color: #f97316; box-shadow: inset 0 0 0 1.5px rgba(249,115,22,0.15); }
.nav-btn[data-view="protocols"].active       { background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(20,184,166,0.04)); color: #14b8a6; box-shadow: inset 0 0 0 1.5px rgba(20,184,166,0.15); }
.nav-btn[data-view="community"].active       { background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(20,184,166,0.04)); color: #14b8a6; box-shadow: inset 0 0 0 1.5px rgba(20,184,166,0.15); }
.nav-btn[data-view="research"].active        { background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(139,92,246,0.04)); color: #8b5cf6; box-shadow: inset 0 0 0 1.5px rgba(139,92,246,0.15); }
.nav-btn[data-view="videos"].active          { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04)); color: #ef4444; box-shadow: inset 0 0 0 1.5px rgba(239,68,68,0.15); }
.nav-btn[data-view="disclaimer"].active      { background: linear-gradient(135deg, rgba(100,116,139,0.12), rgba(100,116,139,0.04)); color: #64748b; box-shadow: inset 0 0 0 1.5px rgba(100,116,139,0.15); }
.nav-btn[data-view="account"].active         { background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(37,99,235,0.04)); color: #2563eb; box-shadow: inset 0 0 0 1.5px rgba(37,99,235,0.15); }
.nav-btn i {
  transition: transform 0.35s var(--spring);
  font-size: 14px;
}
.nav-btn:hover i { transform: scale(1.12); }
.nav-btn.active i { animation: iconBreathe 3s ease-in-out infinite; }

/* Tooltips */
.nav-tooltip {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #1e293b; color: white; font-size: 11px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all 0.25s var(--smooth);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 100; letter-spacing: 0.2px;
}
.nav-tooltip::before {
  content: ''; position: absolute; left: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent; border-right-color: #1e293b;
}
.nav-btn:hover .nav-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Nav labels — hidden by default, shown when sidebar expanded */
.nav-label {
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; max-width: 0; opacity: 0;
  transition: max-width 0.3s var(--smooth), opacity 0.25s var(--smooth);
  pointer-events: none;
}

/* Toggle button separator */
.sidebar-toggle-btn {
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px;
}
.sidebar-toggle-btn i { transition: transform 0.3s var(--smooth); }

/* Expanded sidebar state */
.sidebar.expanded {
  width: 200px;
}
.sidebar.expanded .nav-label {
  max-width: 120px; opacity: 1;
  pointer-events: auto;
}
.sidebar.expanded .nav-btn {
  justify-content: flex-start;
  padding: 0 14px;
}
.sidebar.expanded .nav-btn i {
  width: 18px; text-align: center; flex-shrink: 0;
}
.sidebar.expanded .nav-tooltip {
  display: none;
}
.sidebar.expanded .sidebar-divider {
  width: 80%; margin: 4px 14px;
}
.sidebar.expanded .sidebar-logo {
  align-self: flex-start;
  margin-left: 14px;
}
.sidebar.expanded .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  position: relative; z-index: 1;
  background: var(--bg);
}

/* ============================================================
   TOPBAR — Clean, minimal, premium
   ============================================================ */
.topbar {
  height: 54px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; flex-shrink: 0;
  background: rgba(246,248,251,0.85);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  z-index: 15;
}
.topbar::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(37,99,235,0.12) 35%, rgba(59,130,246,0.08) 65%, transparent 95%);
  animation: shimmerLine 8s ease-in-out infinite;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text);
}
.topbar-badge {
  font-size: 10px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill); color: white;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
  position: relative; overflow: hidden;
}
.topbar-badge::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: badgeShine 5s ease-in-out infinite;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-hint {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  opacity: 0; animation: fadeInSlide 0.8s var(--smooth) 0.5s both;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content-area { flex: 1; overflow-y: auto; scroll-behavior: smooth; position: relative; }

/* ============================================================
   HOME VIEW — DRAMATIC HERO REDESIGN
   ============================================================ */
.home-view {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100%; padding: 0 28px 40px;
  position: relative; overflow: hidden;
}

/* Premium gradient mesh */
.home-view::before {
  content: ''; position: absolute; top: -15%; left: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(37,99,235,0.1) 0%, transparent 55%);
  animation: orbFloat1 20s ease-in-out infinite;
  pointer-events: none; filter: blur(60px);
}
.home-view::after {
  content: ''; position: absolute; bottom: -15%; right: -15%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 55%);
  animation: orbFloat2 25s ease-in-out infinite;
  pointer-events: none; filter: blur(60px);
}

/* Hero wrapper */
.home-hero {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 36px; max-width: 720px; width: 100%;
  position: relative; z-index: 2;
}

/* Badge — premium floating pill */
.home-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  padding: 7px 18px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(239,246,255,0.95), rgba(219,234,254,0.9));
  color: var(--teal); margin-bottom: 20px;
  border: 1px solid rgba(37,99,235,0.18);
  animation: heroBadgeIn 0.7s var(--smooth) both;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(37,99,235,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
}
.home-badge i { animation: boltSpin 3s ease-in-out infinite; font-size: 11px; }

/* Heading — MASSIVE, dramatic gradient */
.home-heading {
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.06;
  color: var(--text);
  animation: heroTitleIn 0.9s var(--smooth) 0.1s both;
  letter-spacing: -1.5px;
}
.home-heading .gradient-text {
  background: linear-gradient(
    90deg,
    #2563eb 0%,
    #06b6d4 12%,
    #10b981 24%,
    #a855f7 36%,
    #ec4899 48%,
    #f59e0b 60%,
    #06b6d4 72%,
    #2563eb 84%,
    #a855f7 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: holoShift 4s linear infinite;
  filter: saturate(1.3) brightness(1.05);
  position: relative;
}

/* Subtitle */
.home-sub {
  font-size: 15px; color: var(--text-secondary); text-align: center;
  max-width: 540px; margin-bottom: 28px; line-height: 1.7; font-weight: 400;
  animation: heroSubIn 0.9s var(--smooth) 0.2s both;
}

/* Search bar — prominent, glowing, premium */
.home-input-wrap {
  width: 100%; max-width: 560px; position: relative; z-index: 2;
  border: 1.5px solid rgba(0,0,0,0.08); border-radius: 18px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  display: flex; align-items: center;
  padding: 6px 7px 6px 20px;
  transition: all 0.4s var(--smooth);
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(37,99,235,0);
  animation: heroInputIn 0.9s var(--smooth) 0.3s both;
}
.home-input-wrap:hover {
  box-shadow: var(--shadow-lg), 0 0 0 0 rgba(37,99,235,0);
  border-color: rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.home-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.08), var(--shadow-lg);
  transform: translateY(-2px);
}
.home-input-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14.5px; color: var(--text);
  font-family: 'Inter', sans-serif; font-weight: 400;
}
.home-input-wrap input::placeholder { color: var(--text-muted); font-weight: 400; }
.home-send-btn {
  width: 40px; height: 40px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: white; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; flex-shrink: 0;
  transition: all 0.4s var(--spring);
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.home-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(37,99,235,0.4);
}
.home-send-btn:active { transform: scale(0.9); }

/* ============================================================
   FEATURE CARDS — Large, rich, interactive, 3-col grid
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 720px; width: 100%;
  position: relative; z-index: 2;
}
.feature-grid:first-of-type { margin-top: 32px; }

.feature-card {
  padding: 28px 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all 0.4s var(--spring);
  opacity: 0; animation: cardFloatIn 0.6s var(--smooth) both;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Top accent gradient bar */
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--emerald));
  opacity: 0; transform: scaleX(0);
  transition: all 0.4s var(--smooth);
  transform-origin: left;
}
.feature-card:hover::before { opacity: 1; transform: scaleX(1); }

.feature-card:nth-child(1) { animation-delay: 0.35s; }
.feature-card:nth-child(2) { animation-delay: 0.42s; }
.feature-card:nth-child(3) { animation-delay: 0.49s; }
.feature-card:nth-child(4) { animation-delay: 0.56s; }
.feature-card:nth-child(5) { animation-delay: 0.63s; }
.feature-card:nth-child(6) { animation-delay: 0.70s; }

.feature-card:hover {
  border-color: rgba(37,99,235,0.18);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(37,99,235,0.05);
  transform: translateY(-6px) scale(1.015);
}
.feature-card:active { transform: translateY(-2px) scale(0.98); }

.feature-card .fc-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 18px;
  transition: all 0.4s var(--spring);
  box-shadow: var(--shadow-xs);
}
.feature-card:hover .fc-icon {
  transform: scale(1.12) rotate(-4deg);
  box-shadow: var(--shadow-sm);
}
.feature-card .fc-label {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; letter-spacing: -0.2px;
  transition: color 0.3s;
}
.feature-card:hover .fc-label { color: var(--teal); }
.feature-card .fc-desc {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
}
/* Arrow icon on hover */
.feature-card .fc-arrow {
  position: absolute; top: 16px; right: 16px;
  font-size: 11px; color: var(--text-muted);
  opacity: 0; transform: translateX(-4px);
  transition: all 0.3s var(--smooth);
}
.feature-card:hover .fc-arrow { opacity: 0.5; transform: translateX(0); }

/* Stats row */
.stats-row {
  display: flex; gap: 40px; justify-content: center; margin-top: 28px;
  position: relative; z-index: 2;
  opacity: 0; animation: heroSubIn 0.8s var(--smooth) 0.8s both;
}
.stat-item { text-align: center; }
.stat-value {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* Quick suggestion pills */
.pill-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 660px; margin-top: 20px; position: relative; z-index: 2;
}
.pill {
  padding: 7px 16px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap; font-family: 'Inter', sans-serif;
  transition: all 0.35s var(--spring);
  opacity: 0; animation: pillSlideIn 0.5s var(--smooth) both;
  box-shadow: var(--shadow-xs);
}
.pill:nth-child(1) { animation-delay: 0.85s; }
.pill:nth-child(2) { animation-delay: 0.9s; }
.pill:nth-child(3) { animation-delay: 0.95s; }
.pill:nth-child(4) { animation-delay: 1.0s; }
.pill:nth-child(5) { animation-delay: 1.05s; }
.pill:hover {
  border-color: var(--teal); color: var(--teal);
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.1);
}
.pill:active { transform: scale(0.95); }

/* ============================================================
   CHAT VIEW
   ============================================================ */
/* ============================================================
   KNOWLEDGE BASE
   ============================================================ */
.kb-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.kb-header { margin-bottom: 24px; animation: viewSlideUp 0.5s var(--smooth) both; }
.kb-title {
  font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.kb-subtitle { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 4px; }
.kb-subtitle.mb { margin-bottom: 20px; }
.kb-search-wrap {
  position: relative; margin-top: 18px; max-width: 440px;
}
.kb-search-wrap i {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px; z-index: 1;
}
.kb-search {
  width: 100%; padding: 11px 18px 11px 42px;
  border: 1.5px solid rgba(0,0,0,0.08); border-radius: var(--radius-md);
  font-size: 13.5px; outline: none; font-family: 'Inter', sans-serif;
  transition: all 0.3s var(--smooth);
  background: white; box-shadow: var(--shadow-xs);
}
.kb-search:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08), var(--shadow-sm);
}
.kb-categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.cat-chip {
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.3s var(--spring);
  font-family: 'Inter', sans-serif; box-shadow: var(--shadow-xs);
}
.cat-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cat-chip:hover, .cat-chip.active {
  border-color: var(--teal); color: var(--teal); background: #eff6ff;
}
.cat-chip:active { transform: scale(0.95); }

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* Peptide cards — richer, more visual */
.peptide-card {
  padding: 22px 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: white; cursor: pointer;
  transition: all 0.4s var(--spring);
  opacity: 0; animation: cardFloatIn 0.5s var(--smooth) both;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.peptide-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--teal);
  opacity: 0; transform: scaleX(0); transform-origin: left;
  transition: all 0.4s var(--smooth);
}
.peptide-card:hover::before { opacity: 1; transform: scaleX(1); }
.peptide-card:nth-child(n) { animation-delay: calc(0.04s * var(--i, 1)); }
.peptide-card:nth-child(1) { --i: 1; } .peptide-card:nth-child(2) { --i: 2; }
.peptide-card:nth-child(3) { --i: 3; } .peptide-card:nth-child(4) { --i: 4; }
.peptide-card:nth-child(5) { --i: 5; } .peptide-card:nth-child(6) { --i: 6; }
.peptide-card:nth-child(7) { --i: 7; } .peptide-card:nth-child(8) { --i: 8; }
.peptide-card:nth-child(9) { --i: 9; } .peptide-card:nth-child(10) { --i: 10; }
.peptide-card:nth-child(11) { --i: 11; } .peptide-card:nth-child(12) { --i: 12; }

.peptide-card:hover {
  border-color: rgba(37,99,235,0.15);
  box-shadow: var(--shadow-xl);
  transform: translateY(-5px);
}
.peptide-card:active { transform: translateY(-1px); }
.peptide-card .pc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.peptide-card .pc-badge {
  font-size: 10px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill); color: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.peptide-card .pc-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  transition: color 0.3s; letter-spacing: -0.2px;
}
.peptide-card:hover .pc-name { color: var(--teal); }
.peptide-card .pc-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.peptide-card .pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.peptide-card .pc-tag {
  font-size: 10.5px; padding: 3px 9px; border-radius: 6px;
  background: var(--bg); color: var(--text-muted); font-weight: 500;
  transition: all 0.3s var(--spring);
}
.peptide-card:hover .pc-tag { background: #eff6ff; color: var(--teal); }

/* ============================================================
   DETAIL MODAL
   ============================================================ */
.detail-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: transparent;
}
.detail-overlay.open {
  display: flex;
  background: rgba(12,18,34,0.35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: overlayFadeIn 0.35s ease both;
}
.detail-panel {
  width: 92%; max-width: 720px; max-height: 85vh;
  background: white; border-radius: var(--radius-xl);
  overflow-y: auto;
  animation: modalScaleIn 0.5s var(--spring) both;
  box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(0,0,0,0.04);
}
.detail-header {
  padding: 28px 32px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px); z-index: 1;
}
.detail-body { padding: 24px 32px 32px; }
.detail-close {
  position: absolute; top: 20px; right: 20px; width: 34px; height: 34px;
  border-radius: 10px; border: none; background: var(--bg);
  cursor: pointer; color: var(--text-secondary);
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: all 0.35s var(--spring);
}
.detail-close:hover { background: #e2e8f0; transform: rotate(90deg) scale(1.1); }

.detail-section {
  margin-bottom: 22px;
  opacity: 0; animation: sectionSlideUp 0.45s var(--smooth) both;
}
.detail-section:nth-child(1) { animation-delay: 0.08s; }
.detail-section:nth-child(2) { animation-delay: 0.14s; }
.detail-section:nth-child(3) { animation-delay: 0.2s; }
.detail-section:nth-child(4) { animation-delay: 0.26s; }
.detail-section:nth-child(5) { animation-delay: 0.32s; }
.detail-section:nth-child(6) { animation-delay: 0.38s; }
.detail-section:nth-child(7) { animation-delay: 0.44s; }
.detail-section:nth-child(8) { animation-delay: 0.50s; }
.detail-section:nth-child(9) { animation-delay: 0.56s; }

.detail-section-title {
  font-size: 11px; font-weight: 700; color: var(--teal);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.detail-section-title::before {
  content: ''; width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--teal), var(--emerald));
  border-radius: 2px;
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.detail-stat {
  padding: 14px; border-radius: 12px; background: var(--bg);
  border: 1px solid transparent;
  transition: all 0.3s var(--smooth);
}
.detail-stat:hover {
  background: #eff6ff; transform: translateY(-2px);
  box-shadow: var(--shadow-sm); border-color: rgba(37,99,235,0.08);
}
.detail-stat-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-stat-value { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 3px; }
.detail-list { list-style: none; padding: 0; }
.detail-list li {
  padding: 7px 0; font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: 10px; line-height: 1.6;
  transition: transform 0.2s var(--smooth);
}
.detail-list li:hover { transform: translateX(4px); color: var(--text); }
.detail-list li::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  flex-shrink: 0; margin-top: 8px;
  box-shadow: 0 0 6px rgba(37,99,235,0.2);
}
.detail-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail-tag {
  font-size: 11px; padding: 4px 12px; border-radius: 7px;
  background: #eff6ff; color: var(--teal); font-weight: 600;
  border: 1px solid rgba(37,99,235,0.08);
  transition: all 0.3s var(--spring);
}
.detail-tag:hover { transform: translateY(-2px); box-shadow: 0 3px 12px rgba(37,99,235,0.12); }

/* ============================================================
   CALCULATOR
   ============================================================ */
.calc-view { padding: 28px 28px 40px; max-width: 620px; animation: viewSlideUp 0.5s var(--smooth) both; }
.calc-title { font-size: 24px; font-weight: 800; margin-bottom: 5px; letter-spacing: -0.5px; }
.calc-subtitle { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 28px; }
.calc-card {
  padding: 28px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: white;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--smooth);
}
.calc-card:hover { box-shadow: var(--shadow-md); }
.calc-field { margin-bottom: 20px; }
.calc-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px; display: block;
}
.calc-input {
  width: 100%; padding: 12px 16px; border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px; font-size: 14px; outline: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s var(--smooth);
}
.calc-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.calc-results {
  margin-top: 24px; padding: 24px; border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #eff6ff);
  border: 1px solid #bfdbfe;
}
.calc-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid rgba(209,250,229,0.5);
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-label { font-size: 12.5px; color: #1e3a8a; font-weight: 500; display: flex; align-items: center; }
.calc-result-value {
  font-size: 20px; font-weight: 800; color: var(--teal);
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
  transition: all 0.5s var(--spring);
}
.calc-result-value.flash { animation: valueFlash 0.5s var(--spring); }
.calc-how {
  margin-top: 24px; padding: 18px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--border);
}
.calc-how-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.calc-how ol { padding-left: 18px; }
.calc-how li { font-size: 12px; color: var(--text-secondary); margin: 5px 0; line-height: 1.6; }

/* ============================================================
   COMPARE
   ============================================================ */
.compare-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.compare-selectors { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.compare-select {
  flex: 1; min-width: 190px; padding: 11px 16px;
  border: 1.5px solid rgba(0,0,0,0.08); border-radius: 12px;
  font-size: 13px; outline: none; font-family: 'Inter', sans-serif;
  background: white; cursor: pointer;
  transition: all 0.3s var(--smooth);
}
.compare-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.compare-btn {
  padding: 11px 24px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: white; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.35s var(--spring);
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.compare-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.35); }
.compare-btn:active { transform: translateY(0) scale(0.96); }
.compare-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  animation: tableSlideUp 0.5s var(--smooth) both;
}
.compare-table th {
  text-align: left; padding: 13px 16px; background: var(--bg);
  font-weight: 600; color: var(--text); border-bottom: 2px solid rgba(0,0,0,0.06);
}
.compare-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: top; line-height: 1.6;
  transition: background 0.2s;
}
.compare-table tr:hover td { background: rgba(240,253,250,0.5); }
.compare-table .row-label { font-weight: 600; color: var(--text); background: var(--bg); width: 140px; }

/* ============================================================
   PROTOCOLS
   ============================================================ */
.protocols-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.protocol-card {
  padding: 22px 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: white;
  margin-bottom: 14px; cursor: pointer;
  transition: all 0.4s var(--spring);
  opacity: 0; animation: cardFloatIn 0.5s var(--smooth) both;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.protocol-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--teal), var(--emerald));
  border-radius: 0 2px 2px 0; transform: scaleY(0); transform-origin: top;
  transition: transform 0.4s var(--smooth);
}
.protocol-card:hover::before { transform: scaleY(1); }
.protocol-card:nth-child(1) { animation-delay: 0.05s; }
.protocol-card:nth-child(2) { animation-delay: 0.1s; }
.protocol-card:nth-child(3) { animation-delay: 0.15s; }
.protocol-card:nth-child(4) { animation-delay: 0.2s; }
.protocol-card:nth-child(5) { animation-delay: 0.25s; }
.protocol-card:hover {
  border-color: rgba(37,99,235,0.12);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px); padding-left: 28px;
}
.protocol-card:active { transform: translateY(-1px); }
.protocol-card .proto-name {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 5px;
  transition: color 0.3s; letter-spacing: -0.2px;
}
.protocol-card:hover .proto-name { color: var(--teal); }
.protocol-card .proto-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.protocol-card .proto-meta { display: flex; gap: 16px; margin-top: 12px; }
.protocol-card .proto-meta span {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; font-weight: 500;
}

.protocol-detail { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.proto-phase { margin-bottom: 24px; }
.proto-phase-name {
  font-size: 14px; font-weight: 700; color: var(--teal);
  margin-bottom: 10px; padding-left: 16px;
  border-left: 3px solid var(--teal);
}
.proto-phase-items { list-style: none; padding: 0; }
.proto-phase-items li {
  padding: 9px 0 9px 16px; font-size: 13px; color: var(--text-secondary);
  border-left: 3px solid rgba(0,0,0,0.06); line-height: 1.6;
  transition: all 0.25s var(--smooth);
}
.proto-phase-items li:hover { border-color: var(--teal); padding-left: 22px; color: var(--text); }
.proto-notes {
  padding: 18px; border-radius: 14px; background: #fffbeb;
  border: 1px solid #fef3c7; margin-top: 20px;
}
.proto-notes-title { font-size: 12.5px; font-weight: 700; color: #92400e; margin-bottom: 8px; }
.proto-notes li { font-size: 12px; color: #b45309; margin: 5px 0; line-height: 1.6; }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.disclaimer {
  font-size: 11px; color: var(--text-muted); text-align: center;
  padding: 14px 24px; border-top: 1px solid var(--border);
  background: rgba(246,248,251,0.85); line-height: 1.6;
  backdrop-filter: blur(8px);
}

/* ============================================================
   LEGAL DISCLAIMER PAGE
   ============================================================ */
.disclaimer-page { max-width: 800px; }
.legal-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color 0.2s;
}
.legal-section:hover { border-color: rgba(0,0,0,0.12); }
.legal-section-last { margin-bottom: 24px; }
.legal-badge {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; margin-bottom: 14px;
}
.legal-badge-red { background: #eff6ff; color: #2563eb; }
.legal-badge-amber { background: #fffbeb; color: #f59e0b; }
.legal-badge-blue { background: #eff6ff; color: #3b82f6; }
.legal-badge-purple { background: #f5f3ff; color: #8b5cf6; }
.legal-badge-teal { background: #f0fdf4; color: #10b981; }
.legal-badge-gray { background: #f9fafb; color: #6b7280; }
body.dark .legal-badge-red { background: rgba(37,99,235,0.12); }
body.dark .legal-badge-amber { background: rgba(245,158,11,0.12); }
body.dark .legal-badge-blue { background: rgba(59,130,246,0.12); }
body.dark .legal-badge-purple { background: rgba(139,92,246,0.12); }
body.dark .legal-badge-teal { background: rgba(16,185,129,0.12); }
body.dark .legal-badge-gray { background: rgba(107,114,128,0.12); }
.legal-heading {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin: 0 0 10px 0; letter-spacing: -0.3px;
}
.legal-section p {
  font-size: 13.5px; line-height: 1.7; color: var(--text-secondary);
  margin: 0 0 10px 0;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section strong { color: var(--text); font-weight: 600; }
.legal-list {
  margin: 10px 0; padding-left: 20px;
  font-size: 13.5px; line-height: 1.7; color: var(--text-secondary);
}
.legal-list li { margin-bottom: 4px; }
.legal-list li strong { color: var(--text); }
.legal-contact {
  text-align: center; padding: 16px;
  font-size: 12px; color: var(--text-muted);
}
.legal-contact p { margin: 0; }

/* ============================================================
   BACK BUTTON & STATUS BADGES
   ============================================================ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  padding: 7px 14px; border-radius: var(--radius-sm); border: none;
  background: transparent; transition: all 0.3s var(--spring);
  margin-bottom: 18px; font-family: 'Inter', sans-serif; font-weight: 500;
}
.back-btn:hover { background: rgba(0,0,0,0.04); color: var(--text); transform: translateX(-3px); }
.back-btn:active { transform: translateX(0) scale(0.95); }

.status-badge { font-size: 10px; padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600; }
.status-approved { background: #bfdbfe; color: #1e3a8a; }
.status-research { background: #fef3c7; color: #92400e; }
.status-investigational { background: #e0e7ff; color: #3730a3; }

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, 50px) scale(1.15); }
  50% { transform: translate(-20px, 80px) scale(0.92); }
  75% { transform: translate(40px, -20px) scale(1.08); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -40px) scale(1.2); }
  66% { transform: translate(50px, -60px) scale(0.88); }
}

@keyframes heroBadgeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.9); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes heroTitleIn {
  from { opacity: 0; transform: translateY(30px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes heroSubIn {
  from { opacity: 0; transform: translateY(22px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes heroInputIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFloatIn {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pillSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes viewSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes viewFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: scale(0.98); }
}
@keyframes msgEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes liquidBounce {
  0%   { transform: translateY(0) scaleX(1) scaleY(1); opacity: 0.3; }
  15%  { transform: translateY(-12px) scaleX(0.82) scaleY(1.2); opacity: 1; }
  30%  { transform: translateY(2px) scaleX(1.15) scaleY(0.8); opacity: 0.8; }
  45%  { transform: translateY(-5px) scaleX(0.92) scaleY(1.08); opacity: 0.9; }
  100% { transform: translateY(0) scaleX(1) scaleY(1); opacity: 0.3; }
}

@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes sectionSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmerText {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes holoShift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
@keyframes shimmerLine {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.7; }
}
@keyframes badgeShine {
  0%, 75%, 100% { left: -100%; }
  87%           { left: 100%; }
}
@keyframes fadeInSlide {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes sidebarGlow {
  0%   { opacity: 0.15; height: 20%; top: 80px; }
  50%  { opacity: 0.5; height: 45%; top: 140px; }
  100% { opacity: 0.15; height: 20%; top: 200px; }
}
@keyframes iconBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes boltSpin {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-10deg) scale(1.12); }
  50%  { transform: rotate(0) scale(1); }
  75%  { transform: rotate(10deg) scale(1.12); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes valueFlash {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.12); filter: brightness(1.15); }
  100% { transform: scale(1); }
}
@keyframes tableSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rippleExpand {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(4); opacity: 0; }
}

/* ============================================================
   DARK MODE — Rich, deep, premium
   ============================================================ */
body.dark {
  --bg: #0a0b10;
  --bg-subtle: #0f1018;
  --bg-secondary: #15161e;
  --surface: rgba(16,17,25,0.85);
  --surface-hover: rgba(20,21,30,0.9);
  --card: rgba(16,17,25,0.85);
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --text: #eef0f6;
  --text-primary: #eef0f6;
  --text-secondary: #8b92a8;
  --text-muted: #565e72;
  --primary: #3b82f6;
  --glass: rgba(16,17,25,0.75);
  --glass-strong: rgba(12,13,18,0.92);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.35);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.5);

  background: var(--bg); color: var(--text);
}
body.dark .main-area { background: var(--bg); }
body.dark .sidebar { background: var(--glass-strong); border-color: var(--border); }
body.dark .sidebar::after { background: linear-gradient(180deg, transparent, rgba(37,99,235,0.1), rgba(59,130,246,0.06), transparent); }
body.dark .nav-btn { color: var(--text-muted); }
body.dark .nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
body.dark .nav-btn.active { box-shadow: inset 0 0 0 1.5px rgba(100,100,100,0.08); }
body.dark .nav-btn[data-view="home"].active            { background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(37,99,235,0.05)); color: #60a5fa; box-shadow: inset 0 0 0 1.5px rgba(37,99,235,0.12); }
body.dark .nav-btn[data-view="dashboard"].active       { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); color: #60a5fa; box-shadow: inset 0 0 0 1.5px rgba(59,130,246,0.12); }
body.dark .nav-btn[data-view="achievements"].active    { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); color: #fbbf24; box-shadow: inset 0 0 0 1.5px rgba(245,158,11,0.12); }
body.dark .nav-btn[data-view="knowledge"].active       { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05)); color: #34d399; box-shadow: inset 0 0 0 1.5px rgba(16,185,129,0.12); }
body.dark .nav-btn[data-view="favorites"].active       { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); color: #fbbf24; box-shadow: inset 0 0 0 1.5px rgba(245,158,11,0.12); }
body.dark .nav-btn[data-view="calendar"].active        { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); color: #f87171; box-shadow: inset 0 0 0 1.5px rgba(239,68,68,0.12); }
body.dark .nav-btn[data-view="tracker"].active         { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(168,85,247,0.05)); color: #c084fc; box-shadow: inset 0 0 0 1.5px rgba(168,85,247,0.12); }
body.dark .nav-btn[data-view="journal"].active         { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(236,72,153,0.05)); color: #f472b6; box-shadow: inset 0 0 0 1.5px rgba(236,72,153,0.12); }
body.dark .nav-btn[data-view="bloodwork"].active       { background: linear-gradient(135deg, rgba(220,38,38,0.15), rgba(220,38,38,0.05)); color: #f87171; box-shadow: inset 0 0 0 1.5px rgba(220,38,38,0.12); }
body.dark .nav-btn[data-view="calc-pro"].active        { background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(6,182,212,0.05)); color: #22d3ee; box-shadow: inset 0 0 0 1.5px rgba(6,182,212,0.12); }
body.dark .nav-btn[data-view="builder"].active         { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05)); color: #818cf8; box-shadow: inset 0 0 0 1.5px rgba(99,102,241,0.12); }
body.dark .nav-btn[data-view="interactions"].active    { background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(249,115,22,0.05)); color: #fb923c; box-shadow: inset 0 0 0 1.5px rgba(249,115,22,0.12); }
body.dark .nav-btn[data-view="protocols"].active       { background: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(20,184,166,0.05)); color: #2dd4bf; box-shadow: inset 0 0 0 1.5px rgba(20,184,166,0.12); }
body.dark .nav-btn[data-view="community"].active       { background: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(20,184,166,0.05)); color: #2dd4bf; box-shadow: inset 0 0 0 1.5px rgba(20,184,166,0.12); }
body.dark .nav-btn[data-view="research"].active        { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05)); color: #a78bfa; box-shadow: inset 0 0 0 1.5px rgba(139,92,246,0.12); }
body.dark .nav-btn[data-view="videos"].active          { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); color: #f87171; box-shadow: inset 0 0 0 1.5px rgba(239,68,68,0.12); }
body.dark .nav-btn[data-view="disclaimer"].active      { background: linear-gradient(135deg, rgba(148,163,184,0.15), rgba(148,163,184,0.05)); color: #94a3b8; box-shadow: inset 0 0 0 1.5px rgba(148,163,184,0.12); }
body.dark .nav-btn[data-view="account"].active         { background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(37,99,235,0.05)); color: #60a5fa; box-shadow: inset 0 0 0 1.5px rgba(37,99,235,0.12); }
body.dark .nav-tooltip { background: #1e293b; }
body.dark .nav-tooltip::before { border-right-color: #1e293b; }

body.dark .topbar { background: rgba(10,11,16,0.85); border-color: var(--border); }
body.dark .topbar-title { color: #f1f5f9; }
body.dark .topbar::after { background: linear-gradient(90deg, transparent, rgba(37,99,235,0.1) 40%, rgba(59,130,246,0.06) 60%, transparent); }

body.dark .home-heading { color: #f1f5f9; }
body.dark .home-sub { color: #8b92a8; }
body.dark .home-view::before { background: radial-gradient(circle, rgba(37,99,235,0.14) 0%, transparent 55%); }
body.dark .home-view::after { background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 55%); }
body.dark .home-input-wrap { background: rgba(16,17,25,0.85); border-color: var(--border); }
body.dark .home-input-wrap:focus-within { border-color: var(--teal); }
body.dark .home-input-wrap input { color: var(--text); }
body.dark .home-badge { background: linear-gradient(135deg, rgba(30,58,138,0.35), rgba(37,99,235,0.15)); border-color: rgba(96,165,250,0.2); color: #60a5fa; box-shadow: 0 2px 12px rgba(37,99,235,0.15), inset 0 1px 0 rgba(255,255,255,0.05); }

body.dark .feature-card { background: var(--surface); border-color: var(--border); }
body.dark .feature-card:hover { border-color: rgba(37,99,235,0.15); }
body.dark .feature-card .fc-label { color: var(--text); }
body.dark .feature-card:hover .fc-label { color: #60a5fa; }
body.dark .feature-card .fc-desc { color: var(--text-muted); }

body.dark .pill { background: var(--surface); border-color: var(--border); color: var(--text-secondary); }
body.dark .pill:hover { background: rgba(30,58,138,0.3); border-color: var(--teal); color: var(--teal); }

body.dark .kb-view { color: var(--text); }
body.dark .kb-title { color: #f1f5f9; }
body.dark .kb-subtitle { color: var(--text-secondary); }
body.dark .kb-search { background: var(--surface); border-color: var(--border); color: var(--text); }
body.dark .cat-chip { background: var(--surface); border-color: var(--border); color: var(--text-secondary); }
body.dark .cat-chip:hover, body.dark .cat-chip.active { background: rgba(30,58,138,0.3); border-color: var(--teal); color: var(--teal); }
body.dark .peptide-card { background: var(--surface); border-color: var(--border); }
body.dark .peptide-card:hover { border-color: rgba(37,99,235,0.15); }
body.dark .peptide-card .pc-name { color: #f1f5f9; }
body.dark .peptide-card:hover .pc-name { color: #60a5fa; }
body.dark .peptide-card .pc-desc { color: var(--text-secondary); }
body.dark .peptide-card .pc-tag { background: rgba(255,255,255,0.04); color: var(--text-muted); }
body.dark .peptide-card:hover .pc-tag { background: rgba(30,58,138,0.3); color: #60a5fa; }

body.dark .calc-view { color: var(--text); }
body.dark .calc-title { color: #f1f5f9; }
body.dark .calc-subtitle { color: var(--text-secondary); }
body.dark .calc-card { background: var(--surface); border-color: var(--border); }
body.dark .calc-label { color: var(--text-secondary); }
body.dark .calc-input { background: rgba(255,255,255,0.04); border-color: var(--border); color: var(--text); }
body.dark .calc-results { background: linear-gradient(135deg, rgba(30,58,138,0.3), rgba(37,99,235,0.08)); border-color: rgba(37,99,235,0.15); }
body.dark .calc-result-label { color: #fca5a5; }
body.dark .calc-result-value { color: #60a5fa; }
body.dark .calc-result-row { border-color: rgba(37,99,235,0.1); }
body.dark .calc-how { background: rgba(255,255,255,0.03); border-color: var(--border); }
body.dark .calc-how-title { color: var(--text); }
body.dark .calc-how li { color: var(--text-secondary); }

body.dark .compare-view { color: var(--text); }
body.dark .compare-select { background: var(--surface); border-color: var(--border); color: var(--text); }
body.dark .compare-table th { background: rgba(255,255,255,0.03); color: var(--text); border-color: var(--border); }
body.dark .compare-table td { border-color: var(--border); color: var(--text-secondary); }
body.dark .compare-table .row-label { background: rgba(255,255,255,0.03); color: var(--text); }
body.dark .compare-table tr:hover td { background: rgba(30,58,138,0.1); }

body.dark .protocol-card { background: var(--surface); border-color: var(--border); }
body.dark .protocol-card:hover { border-color: rgba(37,99,235,0.12); }
body.dark .protocol-card .proto-name { color: #f1f5f9; }
body.dark .protocol-card:hover .proto-name { color: #60a5fa; }
body.dark .protocol-card .proto-desc { color: var(--text-secondary); }
body.dark .protocol-card .proto-meta span { color: var(--text-muted); }
body.dark .protocol-detail { color: var(--text); }
body.dark .proto-phase-items li { border-color: var(--border); color: #cbd5e1; }
body.dark .proto-phase-items li:hover { border-color: var(--teal); }
body.dark .proto-notes { background: rgba(42,32,16,0.4); border-color: rgba(74,56,32,0.4); }
body.dark .proto-notes li { color: #fbbf24; }

body.dark .detail-panel { background: rgba(12,13,18,0.97); }
body.dark .detail-header { background: rgba(12,13,18,0.95); border-color: var(--border); }
body.dark .detail-close { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
body.dark .detail-stat { background: rgba(255,255,255,0.03); }
body.dark .detail-stat:hover { background: rgba(30,58,138,0.25); border-color: rgba(37,99,235,0.1); }
body.dark .detail-stat-value { color: var(--text); }
body.dark .detail-list li { color: #cbd5e1; }
body.dark .detail-list li:hover { color: #f1f5f9; }
body.dark .detail-list li::before { box-shadow: 0 0 8px rgba(37,99,235,0.3); }
body.dark .detail-text { color: #cbd5e1; }
body.dark .detail-tag { background: rgba(30,58,138,0.25); color: #60a5fa; border-color: rgba(37,99,235,0.08); }
body.dark .detail-overlay.open { background: rgba(0,0,0,0.55); }
body.dark .disclaimer { background: rgba(10,11,16,0.8); border-color: var(--border); color: var(--text-muted); }
body.dark .back-btn { color: var(--text-secondary); }
body.dark .back-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
body.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }
  .nav-btn { height: 38px; font-size: 14px; }
  .sidebar-logo { width: 36px; height: 36px; }
  .home-heading { font-size: clamp(28px, 7vw, 38px); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature-card { padding: 20px 16px 18px; }
  .feature-card .fc-icon { width: 40px; height: 40px; font-size: 16px; }
  .stats-row { gap: 24px; }
  .stat-value { font-size: 18px; }
  .topbar { padding: 0 16px; }
  .topbar-hint { display: none; }
  .kb-grid { grid-template-columns: 1fr; }
  .compare-selectors { flex-direction: column; }
  .detail-panel { width: 96%; max-height: 92vh; border-radius: 16px; }
  .kb-view, .calc-view, .compare-view, .protocols-view, .protocol-detail, .calendar-view, .tracker-view, .journal-view, .bw-view, .research-view, .dash-view, .ach-view, .community-view { padding: 18px; }
  .home-hero { padding-top: 24px; }
  .research-card { padding: 16px; }
  .research-card-header { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   RESEARCH VIEW — PubMed Article Feed
   ============================================================ */
.research-view {
  padding: 28px 28px 40px;
  max-width: 1200px;
  animation: viewSlideUp 0.5s var(--smooth) both;
}

.research-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 14px;
  transition: all 0.25s;
}
.research-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.06);
}

.research-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.research-journal {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 10px;
  border-radius: 30px;
  letter-spacing: 0.2px;
}
.research-date {
  font-size: 11px;
  color: var(--text-muted);
}

.research-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  text-decoration: none;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
  transition: color 0.2s;
}
.research-title:hover {
  color: #2563eb;
}

.research-authors {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.research-abstract {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.research-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.research-pmid {
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.research-doi {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.research-link {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  margin-left: auto;
  transition: color 0.2s;
}
.research-link:hover {
  color: #1d4ed8;
}

.research-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.research-total {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.research-page-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}
.research-page-btn {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.research-page-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
}
.research-page-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Research button inside peptide detail modal */
.research-detail-btn {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 11px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: -0.1px;
}
.research-detail-btn:hover {
  background: linear-gradient(135deg, #dbeafe, #fca5a5);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.dark .research-detail-btn {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
}
.dark .research-detail-btn:hover {
  background: rgba(37, 99, 235, 0.18);
}

.research-oa-badge {
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 8px;
  border-radius: 30px;
  letter-spacing: 0.3px;
}
.research-cited {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 30px;
}

/* ── Research Expand / Category Groups ── */
.research-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.research-expand-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}
.research-all-topics {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  background: var(--bg);
  max-height: 400px;
  overflow-y: auto;
}
.research-all-topics::-webkit-scrollbar {
  width: 6px;
}
.research-all-topics::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.research-cat-group {
  margin-bottom: 14px;
}
.research-cat-group:last-child {
  margin-bottom: 0;
}
.research-cat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.research-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.research-cat-chips .cat-chip {
  font-size: 11px;
  padding: 3px 10px;
}
.dark .research-all-topics {
  background: var(--card);
}
.dark .research-expand-btn {
  background: var(--card);
}

/* ── Video Library ── */

/* --- YouTube Red theme overrides for video view --- */
.video-view .kb-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1), var(--shadow-sm);
}
.video-view .cat-chip:hover,
.video-view .cat-chip.active {
  border-color: #2563eb; color: #2563eb; background: #eff6ff;
}
body.dark .video-view .cat-chip:hover,
body.dark .video-view .cat-chip.active {
  background: rgba(37,99,235,0.12); border-color: #2563eb; color: #60a5fa;
}
.video-view .research-expand-btn:hover {
  color: #2563eb;
  border-color: #2563eb;
  background: rgba(37,99,235,0.05);
}
body.dark .video-view .research-expand-btn:hover {
  color: #60a5fa;
  border-color: #60a5fa;
  background: rgba(37,99,235,0.1);
}

.video-view .kb-title {
  color: var(--text);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  width: 100%;
}
.video-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 500;
}
.video-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}
.video-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.video-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.video-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: rgba(37, 99, 235, 0.3);
}
.video-card-expanded {
  grid-column: 1 / -1;
}
.video-card-expanded .video-thumb-wrap {
  max-height: 200px;
}
.video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.video-card:hover .video-thumb {
  transform: scale(1.05);
}
.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.25s;
}
.video-card:hover .video-play-overlay {
  opacity: 1;
}
.video-play-overlay i {
  font-size: 32px;
  color: rgba(255,255,255,0.95);
  background: rgba(37, 99, 235, 0.85);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding-left: 3px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.video-info {
  padding: 12px 14px;
}
.video-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.video-channel {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}
.video-meta {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.video-embed-wrap {
  width: 100%;
  border-top: 1px solid var(--border);
}
.video-embed-wrap iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}
.video-embed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.video-embed-link {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.video-embed-link:hover {
  text-decoration: underline;
}
.video-embed-close {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.video-embed-close:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.video-sort-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.video-sort-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: none;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border);
}
.video-sort-btn:last-child {
  border-right: none;
}
.video-sort-btn.active {
  color: #fff;
  background: #2563eb;
}
.video-sort-btn:hover:not(.active) {
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
}
.dark .video-sort-btn {
  background: var(--card);
}
@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .video-play-overlay i {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
}

/* Video card background fix for light mode */
.video-card {
  background: var(--surface, #fff);
}

/* ============================================================
   FEATURE #2: FAVORITES STAR
   ============================================================ */
.fav-star {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: rgba(0,0,0,0.04); cursor: pointer;
  color: var(--text-muted); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--spring); z-index: 2;
}
.fav-star:hover { background: #fef3c7; color: #f59e0b; transform: scale(1.15); }
.fav-star.fav-active { background: #fef3c7; color: #f59e0b; }
body.dark .fav-star { background: rgba(255,255,255,0.05); }
body.dark .fav-star:hover, body.dark .fav-star.fav-active { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* Video favorite heart button */
.video-fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  cursor: pointer; color: rgba(255,255,255,0.8); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s var(--spring); z-index: 3;
  opacity: 0;
}
.video-card:hover .video-fav-btn,
.video-fav-btn.video-fav-active { opacity: 1; }
.video-fav-btn:hover { background: rgba(239,68,68,0.85); color: #fff; transform: scale(1.15); }
.video-fav-btn.video-fav-active { background: rgba(239,68,68,0.9); color: #fff; }
.video-fav-btn.video-fav-active:hover { background: rgba(239,68,68,1); }

/* Favorites tab bar */
.fav-tabs {
  display: flex; gap: 6px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.fav-tab {
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all 0.2s; font-family: 'Inter', sans-serif;
  display: inline-flex; align-items: center;
}
.fav-tab:hover { color: var(--text); }
.fav-tab-active { color: var(--teal); border-bottom-color: var(--teal); }
.fav-tab-count {
  font-size: 11px; font-weight: 700; background: var(--bg-subtle);
  padding: 1px 7px; border-radius: 10px; margin-left: 6px;
}
.fav-tab-active .fav-tab-count { background: rgba(37,99,235,0.1); color: var(--teal); }

.fav-star-detail {
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 8px; border: 1px solid #fef3c7;
  background: #fffbeb; color: #f59e0b; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.25s; font-family: 'Inter', sans-serif;
}
.fav-star-detail:hover { background: #fef3c7; }
.fav-star-detail.fav-active { background: #f59e0b; color: white; border-color: #f59e0b; }
body.dark .fav-star-detail { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); }
body.dark .fav-star-detail.fav-active { background: #f59e0b; color: #1a1a2e; }

.detail-fullpage-btn {
  position: absolute; top: 20px; right: 56px;
  font-size: 11px; font-weight: 600; padding: 6px 12px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center;
  transition: all 0.25s; font-family: 'Inter', sans-serif;
}
.detail-fullpage-btn:hover { background: var(--surface-hover); color: var(--text); }

.detail-export-btn {
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 8px; border: 1px solid rgba(139,92,246,0.2);
  background: rgba(139,92,246,0.06); color: #7c3aed; cursor: pointer;
  display: inline-flex; align-items: center;
  transition: all 0.25s; font-family: 'Inter', sans-serif;
}
.detail-export-btn:hover { background: rgba(139,92,246,0.12); }

/* ============================================================
   FEATURE #3: SPOTLIGHT SEARCH
   ============================================================ */
.topbar-search-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px; cursor: pointer;
  transition: all 0.25s; font-family: 'Inter', sans-serif;
}
.topbar-search-btn:hover { background: var(--surface-hover); color: var(--text-secondary); border-color: var(--border-strong); }
.topbar-search-hint { font-size: 10px; opacity: 0.6; font-family: 'SF Mono', monospace; }

.spotlight-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: min(20vh, 160px);
  background: rgba(12,18,34,0.4); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.2s;
}
.spotlight-overlay.open { opacity: 1; }
.spotlight-panel {
  width: 92%; max-width: 560px;
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(0,0,0,0.05);
  overflow: hidden;
  transform: translateY(-12px) scale(0.97); transition: transform 0.25s var(--spring);
}
.spotlight-overlay.open .spotlight-panel { transform: translateY(0) scale(1); }
.spotlight-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.spotlight-icon { font-size: 16px; color: var(--text-muted); }
.spotlight-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: 'Inter', sans-serif;
}
.spotlight-input::placeholder { color: var(--text-muted); }
.spotlight-kbd {
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border); font-family: 'SF Mono', monospace;
}
.spotlight-results { max-height: 360px; overflow-y: auto; padding: 6px; }
.spotlight-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
  padding: 10px 12px 4px;
}
.spotlight-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; color: var(--text);
  font-family: 'Inter', sans-serif; text-align: left;
  transition: background 0.15s;
}
.spotlight-result:hover { background: var(--bg); }
.spotlight-result-name { flex: 1; font-size: 13px; font-weight: 500; }
.spotlight-result-name mark { background: #fef3c7; color: inherit; border-radius: 2px; padding: 0 1px; }
.spotlight-result-sub { font-size: 11px; color: var(--text-muted); }
.spotlight-result-arrow { font-size: 10px; color: var(--text-muted); opacity: 0; transition: opacity 0.15s; }
.spotlight-result:hover .spotlight-result-arrow { opacity: 1; }
.spotlight-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

body.dark .spotlight-panel { background: rgba(16,17,25,0.97); }
body.dark .spotlight-result:hover { background: rgba(255,255,255,0.04); }
body.dark .spotlight-result-name mark { background: rgba(245,158,11,0.2); }

/* ============================================================
   FEATURE #5: STACK BUILDER
   ============================================================ */
.builder-stack { margin-bottom: 20px; }
.builder-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 8px; transition: all 0.25s;
}
.builder-item:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); }
.builder-item-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.builder-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.builder-remove {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: rgba(59,130,246,0.08); color: #3b82f6;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s;
}
.builder-remove:hover { background: #3b82f6; color: white; }
.builder-summary {
  padding: 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

body.dark .builder-item { background: var(--surface); }
body.dark .builder-summary { background: var(--surface); }

/* ============================================================
   FEATURE #6: SKELETON LOADERS
   ============================================================ */
.skeleton-card {
  padding: 20px; border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 14px;
}
.skeleton-line {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--surface-hover) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   FEATURE #7: MOBILE BOTTOM TAB BAR
   ============================================================ */
.mobile-nav {
  display: none; /* Hidden on desktop */
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--glass-strong); backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: 6px 8px env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
}
.mobile-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 6px 12px;
  border-radius: 10px; transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.mobile-nav-btn span { font-size: 9px; font-weight: 600; }
.mobile-nav-btn.active { color: var(--teal); }
.mobile-nav-btn:active { transform: scale(0.9); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .content-area { padding-bottom: 70px; }
  .topbar-search-hint { display: none; }
}

/* ============================================================
   FEATURE #8: INTERACTION WARNINGS
   ============================================================ */
.interaction-warnings li::before {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
  box-shadow: 0 0 6px rgba(245,158,11,0.3) !important;
}

/* ============================================================
   FEATURE #10: ONBOARDING TOUR
   ============================================================ */
.tour-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,18,34,0.5); backdrop-filter: blur(10px);
}
.tour-card {
  width: 90%; max-width: 400px; padding: 32px 28px 24px;
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-2xl); text-align: center;
  animation: modalScaleIn 0.4s var(--spring) both;
}
.tour-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: white; font-size: 22px;
  box-shadow: 0 6px 24px rgba(37,99,235,0.25);
}
.tour-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; letter-spacing: -0.3px; }
.tour-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 24px; }
.tour-footer { display: flex; align-items: center; justify-content: space-between; }
.tour-dots { display: flex; gap: 6px; }
.tour-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all 0.3s;
}
.tour-dot.active { background: var(--teal); width: 20px; border-radius: 4px; }
.tour-btns { display: flex; gap: 8px; }
.tour-skip {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: transparent; border: none; cursor: pointer; padding: 8px 14px;
  font-family: 'Inter', sans-serif; border-radius: 8px;
}
.tour-skip:hover { background: var(--bg); }
.tour-next {
  font-size: 12px; font-weight: 600; color: white;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  border: none; cursor: pointer; padding: 8px 18px;
  border-radius: 8px; font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
  transition: all 0.25s;
}
.tour-next:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.3); }

body.dark .tour-card { background: rgba(16,17,25,0.97); }

/* ============================================================
   REGIMEN CALENDAR
   ============================================================ */
.calendar-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.cal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 24px;
}
.cal-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: white; transition: all 0.25s var(--spring);
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}
.cal-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.3); }
.cal-action-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.cal-action-secondary:hover { border-color: var(--teal); color: var(--teal); box-shadow: var(--shadow-sm); }

/* Today Strip */
.cal-today-strip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.cal-today-label {
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.cal-today-label i { color: var(--teal); }
.cal-today-doses { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-today-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--pill-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 20%, transparent);
  transition: all 0.2s;
}
.cal-today-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cal-pill-time {
  font-size: 11px; font-weight: 700; color: var(--pill-color);
  padding: 2px 7px; border-radius: 5px;
  background: color-mix(in srgb, var(--pill-color) 12%, transparent);
}
.cal-pill-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-pill-dose { font-size: 11px; color: var(--text-muted); }

/* Calendar Layout */
.cal-layout {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* Calendar Grid */
.cal-grid-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-xs);
}
.cal-nav {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.cal-nav-btn {
  background: transparent; border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); font-size: 12px;
  transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.cal-nav-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--bg); }
.cal-today-btn { width: auto; padding: 0 12px; font-size: 11px; font-weight: 600; }
.cal-nav-title {
  flex: 1; text-align: center; font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -0.3px;
}

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 8px 10px 6px; border-bottom: 1px solid var(--border);
}
.cal-wd {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 6px 10px 10px; gap: 2px;
}
.cal-day {
  position: relative; padding: 8px 4px 6px; text-align: center;
  border-radius: 10px; cursor: pointer; min-height: 52px;
  display: flex; flex-direction: column; align-items: center;
  transition: all 0.15s; border: 2px solid transparent;
}
.cal-day:hover { background: var(--bg); }
.cal-day-outside { opacity: 0.3; pointer-events: none; }
.cal-day-num { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-day-past .cal-day-num { opacity: 0.5; }
.cal-day-today {
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  border-color: color-mix(in srgb, var(--teal) 25%, transparent);
}
.cal-day-today .cal-day-num { color: var(--teal); font-weight: 800; }
.cal-day-selected {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 15%, transparent);
}
.cal-day-selected .cal-day-num { color: var(--teal); }
.cal-day-dots { display: flex; gap: 3px; margin-top: 3px; justify-content: center; flex-wrap: wrap; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-dot-more { font-size: 8px; font-weight: 700; color: var(--text-muted); line-height: 6px; }

/* Side Panel */
.cal-side-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow-xs);
  max-height: 520px; overflow-y: auto;
}
.cal-panel-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.cal-panel-title i { color: var(--teal); font-size: 13px; }

.cal-empty-state {
  text-align: center; padding: 40px 16px;
}
.cal-empty-state i { font-size: 36px; color: var(--border); margin-bottom: 14px; display: block; }
.cal-empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.cal-empty-text { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }

/* Regimen Cards */
.cal-regimen-list { display: flex; flex-direction: column; gap: 12px; }
.cal-regimen-card {
  border-radius: 12px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-left: 3px solid var(--reg-color);
  transition: all 0.2s;
}
.cal-regimen-card:hover { border-color: var(--reg-color); box-shadow: var(--shadow-sm); }
.cal-reg-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-reg-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cal-reg-actions { display: flex; gap: 4px; }
.cal-reg-edit, .cal-reg-del {
  background: transparent; border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted); transition: all 0.15s;
}
.cal-reg-edit:hover { background: var(--surface); color: var(--teal); }
.cal-reg-del:hover { background: #eff6ff; color: #3b82f6; }
.cal-reg-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.cal-reg-dates { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; }
.cal-progress-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.cal-progress-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }
.cal-reg-reminder { font-size: 10px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.cal-reg-reminder i { color: #f59e0b; font-size: 9px; }

/* Day Detail */
.cal-day-detail { }
.cal-back-to-list {
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--teal);
  font-family: 'Inter', sans-serif; padding: 0;
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.2s;
}
.cal-back-to-list:hover { opacity: 0.7; }
.cal-day-doses-list { display: flex; flex-direction: column; gap: 8px; }
.cal-dose-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-left: 3px solid var(--dose-color);
  transition: all 0.15s;
}
.cal-dose-card:hover { border-color: var(--dose-color); }
.cal-dose-time {
  font-size: 12px; font-weight: 700; color: var(--dose-color);
  min-width: 60px; text-align: center;
  padding: 4px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--dose-color) 8%, transparent);
}
.cal-dose-info { flex: 1; min-width: 0; }
.cal-dose-name { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-dose-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.cal-dose-notes { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-style: italic; }
.cal-dose-check { color: var(--dose-color); font-size: 14px; opacity: 0.3; }

/* Modal */
.cal-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.2s;
}
.cal-modal-overlay.open { opacity: 1; }
.cal-modal {
  background: var(--surface); border-radius: 18px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s var(--spring);
}
.cal-modal-overlay.open .cal-modal { transform: translateY(0) scale(1); }
.cal-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 14px; border-bottom: 1px solid var(--border);
}
.cal-modal-header h3 { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; margin: 0; }
.cal-modal-close {
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px; transition: all 0.15s;
}
.cal-modal-close:hover { background: #eff6ff; color: #3b82f6; }
.cal-modal-body { padding: 20px 24px; }
.cal-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px 20px; border-top: 1px solid var(--border);
}

.cal-form-group { margin-bottom: 14px; }
.cal-form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 5px;
}
.cal-form-row { display: flex; gap: 10px; }
.cal-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 13px; font-family: 'Inter', sans-serif;
  background: var(--bg); color: var(--text); transition: border-color 0.2s;
  box-sizing: border-box;
}
.cal-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.cal-day-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-day-toggle {
  padding: 6px 12px; border-radius: 8px; font-size: 12px;
  font-weight: 600; font-family: 'Inter', sans-serif;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.cal-day-toggle.active { background: var(--teal); color: white; border-color: var(--teal); }
.cal-day-toggle:hover { border-color: var(--teal); }

.cal-color-picker { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.cal-color-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.cal-color-swatch.active { border-color: var(--text); transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.cal-color-swatch:hover { transform: scale(1.1); }

.cal-btn-cancel {
  padding: 9px 18px; border-radius: 9px; font-size: 13px;
  font-weight: 600; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.cal-btn-cancel:hover { background: var(--bg); }
.cal-btn-save {
  padding: 9px 22px; border-radius: 9px; font-size: 13px;
  font-weight: 600; border: none;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: white; cursor: pointer; font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2); transition: all 0.2s;
}
.cal-btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.3); }

/* Dark mode overrides */
body.dark .cal-modal { background: rgba(16,17,25,0.97); }
body.dark .cal-reg-del:hover { background: rgba(59,130,246,0.12); }
body.dark .cal-modal-close:hover { background: rgba(59,130,246,0.12); }

/* Sidebar divider */
.sidebar-divider { width: 24px; height: 1px; background: var(--border); margin: 4px auto; opacity: 0.5; }

/* ============================================================
   DOSE TRACKER
   ============================================================ */
.tracker-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.tracker-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tracker-stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; text-align: center;
}
.tracker-stat-num { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.tracker-stat-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.tracker-section { margin-bottom: 24px; }
.tracker-section-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.tracker-section-title i { color: var(--teal); font-size: 12px; }

.site-rotation-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.site-chip {
  padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, var(--teal) var(--site-intensity, 0%), var(--bg));
  border: 1px solid var(--border); display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.site-chip.site-last { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.site-name { color: var(--text); }
.site-count { color: var(--teal); font-weight: 800; font-size: 12px; }

.dose-log-list { display: flex; flex-direction: column; gap: 6px; }
.dose-log-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.15s;
}
.dose-log-item:hover { border-color: var(--teal); }
.dose-log-today { border-left: 3px solid var(--teal); }
.dose-log-time { min-width: 60px; text-align: center; }
.dose-log-date { font-size: 10px; font-weight: 700; color: var(--teal); display: block; }
.dose-log-clock { font-size: 11px; color: var(--text-muted); }
.dose-log-info { flex: 1; min-width: 0; }
.dose-log-name { font-size: 13px; font-weight: 700; color: var(--text); }
.dose-log-meta { font-size: 11px; color: var(--text-secondary); }
.dose-log-notes { font-size: 10px; color: var(--text-muted); font-style: italic; margin-top: 2px; }
.dose-log-del {
  background: transparent; border: none; cursor: pointer; color: var(--text-muted);
  width: 24px; height: 24px; border-radius: 6px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.dose-log-del:hover { background: #eff6ff; color: #3b82f6; }

/* ============================================================
   SIDE EFFECT JOURNAL
   ============================================================ */
.journal-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.journal-trend-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 24px;
}
.journal-trend-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.journal-trend-svg { width: 100%; height: auto; max-height: 100px; }

.journal-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
@media (max-width: 760px) { .journal-layout { grid-template-columns: 1fr; } }

.journal-top-se {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; height: fit-content;
}
.se-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.se-bar-name { font-size: 11px; color: var(--text-secondary); min-width: 100px; }
.se-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.se-bar-fill { height: 100%; border-radius: 3px; background: #8b5cf6; }
.se-bar-count { font-size: 10px; font-weight: 700; color: var(--text-muted); min-width: 24px; }

.journal-entries { display: flex; flex-direction: column; gap: 6px; }
.journal-entry-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s;
}
.journal-entry-card:hover { border-color: #8b5cf6; }
.journal-entry-rating { font-size: 22px; min-width: 40px; text-align: center; }
.journal-rating-num { display: block; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.journal-entry-body { flex: 1; }
.journal-entry-date { font-size: 12px; font-weight: 700; color: var(--text); }
.journal-entry-se { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.journal-entry-notes { font-size: 10px; color: var(--text-muted); font-style: italic; margin-top: 2px; }

.journal-rating-picker { display: flex; gap: 8px; }
.journal-rating-btn {
  flex: 1; padding: 10px 6px; border-radius: 10px; border: 2px solid var(--border);
  background: var(--bg); cursor: pointer; text-align: center; transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.journal-rating-btn:hover { border-color: #8b5cf6; }
.journal-rating-btn.active { border-color: #8b5cf6; background: rgba(139,92,246,0.08); }
.journal-rating-emoji { font-size: 22px; display: block; margin-bottom: 4px; }
.journal-rating-label { font-size: 10px; font-weight: 600; color: var(--text-muted); }

.journal-se-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.journal-se-btn {
  padding: 5px 11px; border-radius: 7px; font-size: 11px;
  font-weight: 500; font-family: 'Inter', sans-serif;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.journal-se-btn:hover { border-color: #8b5cf6; }
.journal-se-btn.active { background: #8b5cf6; color: white; border-color: #8b5cf6; }
.journal-pep-btn.active { background: var(--teal); border-color: var(--teal); }

/* ============================================================
   RECON CALC PRO
   ============================================================ */
.calcpro-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 14px;
}
.calcpro-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.calcpro-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.calcpro-result {
  background: var(--bg); padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); text-align: center;
}
.calcpro-result-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.calcpro-result-value { font-size: 16px; font-weight: 800; color: var(--text); margin-top: 2px; }

.opt-table { overflow-x: auto; }
.opt-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.opt-table th { text-align: left; padding: 8px 10px; background: var(--bg); font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.opt-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.opt-recommended td { background: rgba(6,182,212,0.06); font-weight: 600; }
.opt-badge { font-size: 10px; font-weight: 700; color: #06b6d4; background: rgba(6,182,212,0.1); padding: 2px 8px; border-radius: 4px; }

.vial-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vial-card {
  border-radius: 10px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border);
  transition: all 0.15s;
}
.vial-card:hover { border-color: #06b6d4; }
.vial-expired { border-color: #bfdbfe !important; background: #eff6ff; }
.vial-warning { border-color: #fef3c7 !important; background: #fffbeb; }
.vial-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.vial-name { font-size: 14px; font-weight: 700; color: var(--text); }
.vial-meta { font-size: 11px; color: var(--text-secondary); margin: 2px 0; }
.vial-expiry { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.text-red { color: #3b82f6 !important; }
.text-amber { color: #f59e0b !important; }

/* ============================================================
   BLOOD WORK TRACKER
   ============================================================ */
.bw-view { padding: 28px 28px 40px; animation: viewSlideUp 0.5s var(--smooth) both; }
.bw-chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 24px;
}
.bw-chart-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bw-range { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.bw-chart-svg { width: 100%; height: auto; max-height: 140px; }
.bw-entry-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s; margin-bottom: 6px;
}
.bw-entry-card:hover { border-color: #3b82f6; }
.bw-entry-date { font-size: 13px; font-weight: 700; color: var(--text); min-width: 100px; }
.bw-entry-count { font-size: 11px; color: var(--text-secondary); flex: 1; }
.bw-entry-notes { font-size: 10px; color: var(--text-muted); flex: 1; font-style: italic; }

.bw-cat-group { margin-bottom: 16px; }
.bw-cat-label { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.bw-marker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.bw-marker-input label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 3px; }
.bw-unit { font-weight: 400; color: var(--text-muted); }

/* ============================================================
   INTERACTION CHECKER
   ============================================================ */
.ix-selectors { margin-bottom: 24px; }
.ix-selector { margin-bottom: 16px; }
.ix-label { display: block; font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.ix-label i { color: var(--teal); margin-right: 4px; }

.ix-results { display: flex; flex-direction: column; gap: 12px; }
.ix-result-card {
  border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--border);
}
.ix-high { background: #fef2f2; border-color: #fecaca; }
.ix-moderate { background: #fffbeb; border-color: #fef3c7; }
.ix-low { background: var(--surface); }
.ix-result-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ix-severity-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 5px;
}
.ix-badge-high { background: #ef4444; color: white; }
.ix-badge-moderate { background: #f59e0b; color: white; }
.ix-badge-low { background: var(--border); color: var(--text-secondary); }
.ix-result-pair { font-size: 13px; font-weight: 700; color: var(--text); }
.ix-result-note { font-size: 12px; color: var(--text-secondary); line-height: 1.65; }

body.dark .ix-high { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
body.dark .ix-moderate { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }

/* ============================================================
   AUTH MODAL & ACCOUNT
   ============================================================ */
.auth-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 10000;
  animation: fadeIn 0.2s ease;
}
.auth-modal {
  background: var(--card); border-radius: 16px; padding: 36px 32px;
  width: 90%; max-width: 400px; position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2); animation: viewSlideUp 0.3s var(--smooth);
}
.auth-modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 8px; border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.auth-modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.auth-modal-logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white; font-size: 20px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.auth-modal-title {
  font-size: 20px; font-weight: 700; color: var(--text); text-align: center;
  margin: 0 0 6px; letter-spacing: -0.3px;
}
.auth-modal-subtitle {
  font-size: 13px; color: var(--text-muted); text-align: center; margin: 0 0 20px; line-height: 1.5;
}
.auth-error {
  background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 14px; font-size: 12px; font-weight: 500;
  margin-bottom: 14px; text-align: center;
}
body.dark .auth-error { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.2); }
.auth-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 5px; margin-top: 12px;
}
.auth-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 14px; color: var(--text); outline: none;
  font-family: 'Inter', sans-serif; transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.auth-submit {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white; font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 18px; font-family: 'Inter', sans-serif;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,0.3); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-switch {
  text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px;
}
.auth-switch a { color: var(--teal); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.auth-privacy {
  text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 12px; opacity: 0.7;
}
.auth-privacy a { color: var(--teal); text-decoration: underline; }

/* Account avatar in sidebar */
.auth-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.auth-avatar-sm {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white; font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ============================================================
   PROGRESS DASHBOARD
   ============================================================ */
.dash-view { padding: 28px 28px 40px; max-width: 800px; animation: viewSlideUp 0.5s var(--smooth) both; }

.dash-streak-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.dash-streak-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 14px; text-align: center; position: relative; overflow: hidden;
}
.dash-streak-icon { font-size: 20px; margin-bottom: 6px; }
.dash-streak-num { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--text); }
.dash-streak-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.dash-streak-fire .dash-streak-icon { color: #f97316; }
.dash-streak-fire .dash-streak-num { color: #f97316; }
.dash-streak-journal .dash-streak-icon { color: #8b5cf6; }
.dash-streak-journal .dash-streak-num { color: #8b5cf6; }
.dash-streak-compliance .dash-streak-icon { color: #10b981; }
.dash-streak-compliance .dash-streak-num { color: #10b981; }
.dash-streak-wellness .dash-streak-icon { color: #ec4899; }
.dash-streak-wellness .dash-streak-num { color: #ec4899; }

.dash-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px;
}
.dash-stat-tile {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 14px; text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.dash-stat-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.dash-stat-icon { font-size: 18px; margin-bottom: 6px; }
.dash-stat-val { font-size: 22px; font-weight: 800; color: var(--text); }
.dash-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

.dash-section-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin-bottom: 14px;
}
.dash-section-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.dash-section-title i { margin-right: 6px; color: var(--teal); font-size: 12px; }

.dash-heatmap {
  display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin-bottom: 8px;
}
.dash-heat-cell {
  aspect-ratio: 1; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: white; font-weight: 700; min-width: 0;
}
.dash-heat-num { opacity: 0.9; }
.dash-heatmap-legend {
  display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 4px;
}
.dash-heat-legend-cell { width: 12px; height: 12px; border-radius: 2px; }

.dash-chart-legend {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted);
  margin-bottom: 10px;
}
.dash-legend-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}

.dash-pep-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dash-pep-row:last-child { border-bottom: none; }
.dash-pep-rank {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--text-muted); flex-shrink: 0;
}
.dash-pep-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-pep-bar { flex: 0 0 80px; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.dash-pep-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.dash-pep-count { font-size: 12px; font-weight: 700; color: var(--text-secondary); min-width: 30px; text-align: right; }

.dash-actions {
  display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap;
}
.dash-action-btn {
  flex: 1; min-width: 140px; padding: 12px 16px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dash-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.dash-action-journal { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.dash-action-journal:hover { box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.dash-action-achievements { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dash-action-achievements:hover { box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

@media (max-width: 600px) {
  .dash-streak-row { grid-template-columns: repeat(2, 1fr); }
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-heatmap { grid-template-columns: repeat(10, 1fr); }
}

/* ============================================================
   ACHIEVEMENTS / GAMIFICATION
   ============================================================ */
.ach-view { padding: 28px 28px 40px; max-width: 800px; animation: viewSlideUp 0.5s var(--smooth) both; }

.ach-level-card {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.04));
  border: 1px solid rgba(245,158,11,0.2); border-radius: 14px;
  padding: 22px 24px; margin-bottom: 24px;
}
.ach-level-badge {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.ach-level-num { font-size: 28px; font-weight: 900; color: white; }
.ach-level-info { flex: 1; min-width: 0; }
.ach-level-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.ach-level-xp { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ach-xp-bar {
  height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden;
}
.ach-xp-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.5s ease;
}
.ach-xp-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.ach-category { margin-bottom: 24px; }
.ach-category-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.ach-badge-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.ach-badge {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 14px; text-align: center; transition: transform 0.15s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.ach-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.ach-locked { opacity: 0.45; filter: grayscale(0.6); }
.ach-unlocked { border-color: rgba(245,158,11,0.2); }
.ach-unlocked::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.ach-badge-icon { font-size: 24px; margin-bottom: 8px; }
.ach-badge-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ach-badge-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; }
.ach-badge-xp { font-size: 11px; font-weight: 700; color: #f59e0b; }
.ach-locked .ach-badge-xp { color: var(--text-muted); }

/* Achievement Toast */
.achievement-toast {
  position: fixed; bottom: 30px; right: 30px; z-index: 10001;
  background: var(--glass-strong); border: 1px solid rgba(245,158,11,0.3);
  border-radius: 14px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  transform: translateY(120px); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  backdrop-filter: blur(20px);
}
.achievement-toast.show { transform: translateY(0); opacity: 1; }
.ach-toast-icon { font-size: 28px; }
.ach-toast-body { min-width: 0; }
.ach-toast-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.ach-toast-name { font-size: 15px; font-weight: 800; color: var(--text); }
.ach-toast-xp { font-size: 12px; font-weight: 700; color: #f59e0b; }

@media (max-width: 600px) {
  .ach-badge-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-level-card { flex-direction: column; text-align: center; gap: 12px; }
  .achievement-toast { bottom: 80px; right: 12px; left: 12px; }
}

/* ============================================================
   COMMUNITY PROTOCOLS
   ============================================================ */
.community-view { padding: 28px 28px 40px; max-width: 800px; animation: viewSlideUp 0.5s var(--smooth) both; }

.community-filters { margin-bottom: 24px; }
.community-sort, .community-goals {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}

.community-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin-bottom: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.community-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.community-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.community-card-goal {
  font-size: 11px; font-weight: 700; color: #14b8a6;
  background: rgba(20,184,166,0.08); border: 1px solid rgba(20,184,166,0.15);
  padding: 3px 10px; border-radius: 20px;
}
.community-card-goal i { margin-right: 4px; }
.community-card-time { font-size: 11px; color: var(--text-muted); }

.community-card-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.community-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }

.community-card-peptides {
  background: var(--bg-secondary); border-radius: 10px; padding: 12px 14px;
  font-size: 12px; color: var(--text); line-height: 1.6; font-family: 'SF Mono', monospace;
  margin-bottom: 10px; white-space: pre-wrap;
}

.community-card-meta {
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}
.community-card-notes {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  font-style: italic; margin-bottom: 10px;
}

.community-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.community-vote-row { display: flex; gap: 6px; }
.community-vote-btn {
  border: 1px solid var(--border); background: var(--glass); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 4px;
}
.community-vote-btn:hover { border-color: var(--teal); color: var(--teal); }
.community-voted-up { background: rgba(16,185,129,0.1); border-color: #10b981; color: #10b981; }
.community-voted-down { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #ef4444; }
.community-card-score { font-size: 12px; font-weight: 700; color: var(--text-secondary); }

/* Dark mode overrides for new features */
body.dark .dash-streak-card { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
body.dark .dash-stat-tile { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
body.dark .dash-stat-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
body.dark .dash-section-card { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
body.dark .ach-level-card { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.12); }
body.dark .ach-badge { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
body.dark .ach-badge:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
body.dark .ach-unlocked { border-color: rgba(245,158,11,0.15); }
body.dark .achievement-toast { background: #1e293b; border-color: rgba(245,158,11,0.2); }
body.dark .community-card { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
body.dark .community-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
body.dark .community-card-peptides { background: rgba(255,255,255,0.04); }
body.dark .community-vote-btn { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
