/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #151620;
  --bg-card: #1a1b2e;
  --bg-hover: #1e2038;
  --bg-active: #1a1540;
  --border-color: #1e2038;
  --text-primary: #e8eaed;
  --text-secondary: #8b95a5;
  --text-muted: #5a6577;
  --accent-primary: #8b5cf6;
  --accent-secondary: #a78bfa;
  --accent-teal: #06b6d4;
  --accent-green: #14f195;
  --accent-pink: #ec4899;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --gradient-main: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --gradient-cta: linear-gradient(135deg, #8b5cf6, #ec4899);
  --sidebar-width: 210px;
  --right-sidebar-width: 280px;
  --top-nav-height: 56px;
  --font-family: 'Jost', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Source Sans 3', 'Inter', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.splash-logo {
  width: 120px;
  height: 120px;
  animation: splashPulse 2s infinite ease-in-out;
}

.splash-wordmark {
  font-family: 'Jost', -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.splash-wordmark span {
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.splash-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #5a6577;
  letter-spacing: 3.5px;
  margin: 6px 0 0;
  text-align: center;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

.splash-loader {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.splash-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal));
  border-radius: 3px;
  animation: splashLoad 1.8s ease-in-out forwards;
}

@keyframes splashLoad {
  0% { width: 0%; }
  30% { width: 40%; }
  60% { width: 70%; }
  100% { width: 100%; }
}

.splash-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ===== TOP NAVIGATION BAR ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-nav-height);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.top-nav-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-word {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #e8eaed;
  letter-spacing: -0.8px;
}

.logo-accent {
  background: linear-gradient(90deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.logo-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 8px;
  font-weight: 600;
  color: #5a6577;
  letter-spacing: 2.8px;
  margin-top: 5px;
}

.top-nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-dropdown-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-dropdown-btn .fa-chevron-down {
  font-size: 8px;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 6px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  margin-top: 4px;
}

.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.15s;
}

.nav-dropdown-content a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.shop-btn:hover {
  color: var(--text-primary);
}

.cart-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.cart-nav-btn:hover {
  color: var(--text-primary);
}

.cart-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.account-btn-3d {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(60, 60, 80, 0.5);
  color: #fff;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.account-btn-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.account-btn-3d::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 22px 22px 0 0;
}

.account-btn-3d i {
  font-size: 12px;
  color: var(--accent-primary);
}

.account-btn-3d:hover {
  transform: translateY(-2px);
  background: rgba(70, 70, 95, 0.6);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  margin-top: var(--top-nav-height);
  height: calc(100vh - var(--top-nav-height));
}

/* ===== LEFT SIDEBAR ===== */
.left-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.12),
    inset -1px -1px 1px rgba(0, 0, 0, 0.08),
    0 2px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px) saturate(150%) brightness(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(1.1);
  overflow: hidden;
}

/* Top-edge glass reflection shine */
.sidebar-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1), transparent);
  border-radius: 50%;
}

/* Top glass highlight gradient */
.sidebar-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 10px 10px 0 0;
}

.sidebar-bottom {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mascot-container {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.mascot-image {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
}

.mascot-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1040, #2a1858, #0f1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--accent-primary);
  animation: mascotGlow 3s infinite alternate;
}

@keyframes mascotGlow {
  0% { box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.15); }
  100% { box-shadow: inset 0 0 40px rgba(139, 92, 246, 0.3); }
}

.connect-wallet-btn, .new-chat-btn {
  width: 100%;
  padding: 12px;
  background: #2a2a35;
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
}

.connect-wallet-btn:hover, .new-chat-btn:hover {
  background: #353540;
  transform: translateY(-1px);
}

/* ===== MAIN CHAT AREA ===== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-primary);
  position: relative;
}

.chat-header {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 20px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(80px);
  -webkit-backdrop-filter: blur(80px);
  border-radius: 50px;
  border: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-mode-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s;
}

.chat-mode-btn .chat-mode-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  mix-blend-mode: lighten;
}

.chat-mode-btn.active {
  background: transparent;
  color: #fff;
}

.chat-mode-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
}

.model-label {
  color: var(--text-muted);
}

.model-name {
  color: var(--text-primary);
  font-weight: 600;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s;
}

.chat-toggle.active {
  color: var(--text-primary);
}

.chat-toggle:hover {
  background: var(--bg-hover);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 72px 32px 120px;
  scroll-behavior: smooth;
}

.chat-messages.drag-over {
  outline: 2px dashed rgba(139, 92, 246, 0.5);
  outline-offset: -8px;
  background: rgba(139, 92, 246, 0.03);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.message {
  max-width: 850px;
  margin: 0 auto 12px;
}

.ai-message {
  padding-right: 60px;
  padding-left: 48px;
}

.message-content {
  line-height: 1.55;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
}

.message-content p {
  margin: 0;
  padding: 1px 0;
}

.message-content p + p {
  margin-top: 0;
}

/* Bullet paragraphs (start with "- ") — tighter, with custom bullet */
.message-content p:has(+ p) {
  margin-bottom: 0;
}

.message-content h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family);
  margin: 16px 0 6px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.message-content h3:first-child {
  margin-top: 4px;
}

.message-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 14px 0;
  opacity: 0.4;
}

/* Code Block */
.code-block {
  background: var(--bg-tertiary);
  border-radius: 10px;
  margin: 12px 0 16px;
  overflow: hidden;
}

.code-header {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--accent-primary);
  background: var(--bg-card);
  font-weight: 600;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-block pre {
  overflow-x: hidden;
}

/* Chat Input - Floating Glass Bar */
.chat-input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 32px 16px;
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.chat-input-container > * {
  pointer-events: auto;
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(80px);
  -webkit-backdrop-filter: blur(80px);
  border-radius: 20px;
  padding: 14px 16px 10px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* Top specular highlight — light catching the glass edge */
.chat-input-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Inner refraction glow */
.chat-input-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

.chat-input-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.chat-input-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  padding: 0;
  outline: none;
  font-family: var(--font-body);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
}

.input-tools-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.input-tools-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-tools-right {
  display: flex;
  align-items: center;
}

.input-tool-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  transition: all 0.2s;
}

.input-tool-btn:hover {
  color: #fff;
}

.input-tool-btn.sparkle { color: #ec4899; }
.input-tool-btn.fire { color: #ef4444; }

.input-tool-btn.mic-active {
  color: #ef4444;
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-teal);
  color: #fff;
  font-size: 13px;
  transition: all 0.2s;
}

.send-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.05);
}

.ai-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* AI Message Action Buttons */
.message-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-top: 4px;
}

.message-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
}

.message-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.message-action-btn.active {
  color: var(--text-primary);
}

.action-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
  padding: 0 4px;
  display: flex;
  align-items: center;
}

/* User message — right-aligned bubble */
.user-message {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 80px;
  padding-right: 0;
}

.user-message .message-content {
  background: rgba(6, 182, 212, 0.1);
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  display: inline-block;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.6;
}

.user-message .message-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-right: 4px;
}

/* AI message timestamp — inline with action buttons */
.ai-message .message-timestamp {
  display: none;
}

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
  width: var(--right-sidebar-width);
  min-width: var(--right-sidebar-width);
  background: var(--bg-secondary);
  position: relative;
  display: flex;
  flex-direction: column;
}

.right-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
}

.right-sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.right-sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.section-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  margin-bottom: 10px;
  padding: 0 4px;
}

/* AI Capability Cards */
.capability-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.capability-card:hover {
  background: var(--bg-hover);
}

.capability-card.active,
.agent-tool-card.active {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 1px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.capability-card.active::before,
.agent-tool-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1), transparent);
  border-radius: 50%;
}

.capability-card.active::after,
.agent-tool-card.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 10px 10px 0 0;
}

.capability-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.capability-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.capability-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.capability-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Agent Tool / Category Cards */
.agent-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.agent-tool-card:hover {
  background: var(--bg-hover);
}

.agent-tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.agent-tool-icon.recon { background: rgba(20, 241, 149, 0.15); color: #14f195; }
.agent-tool-icon.compare { background: rgba(79, 195, 247, 0.15); color: #4fc3f7; }
.agent-tool-icon.storage { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }

/* 3D icon images for product categories */
.tool-icon-3d {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: lighten;
}

/* Recent Chats */
.recent-chats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-chat-item {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-chat-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Help Bubble */
.intercom-bubble {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
  transition: all 0.2s;
  z-index: 10;
}

.intercom-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
}

/* ===== AI AVATAR & RESPONSE WRAPPER ===== */
.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-typing .ai-avatar {
  width: 46px;
  height: 46px;
}

.ai-response-wrapper {
  display: flex;
  gap: 0;
  align-items: flex-start;
  margin-left: -48px;
}

.ai-response-wrapper .ai-avatar {
  margin-right: 12px;
}

.ai-response-wrapper .message-content {
  flex: 1;
  min-width: 0;
}

/* ===== TYPING INDICATOR ===== */
.ai-typing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.typing-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.typing-label {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: calc(var(--top-nav-height) + 12px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-success { background: rgba(20, 241, 149, 0.15); border-left: 3px solid #14f195; }
.toast-success i { color: #14f195; }
.toast-info { background: rgba(139, 92, 246, 0.15); border-left: 3px solid var(--accent-primary); }
.toast-info i { color: var(--accent-primary); }
.toast-warning { background: rgba(245, 158, 11, 0.15); border-left: 3px solid #f59e0b; }
.toast-warning i { color: #f59e0b; }
.toast-error { background: rgba(239, 68, 68, 0.15); border-left: 3px solid #ef4444; }
.toast-error i { color: #ef4444; }

/* ===== CHAT BACKGROUND ===== */
.chat-area {
  background: var(--bg-primary);
}

/* ===== STACK BUILDER UI ===== */
.stack-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.stack-option-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: none !important;
  outline: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
  -webkit-appearance: none;
}

.stack-option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stack-option-btn i {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Stack Recommendation Card */
.stack-card {
  background: rgba(139, 92, 246, 0.05);
  border-radius: 16px;
  padding: 20px;
  margin: 12px 0;
}

.stack-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stack-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.stack-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
}

.stack-rationale {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 10px;
}

.stack-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.stack-item {
  padding: 12px 14px;
  background: rgba(15, 16, 24, 0.5);
  border-radius: 10px;
}

.stack-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.stack-item-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  mix-blend-mode: lighten;
  flex-shrink: 0;
}

.stack-item-header strong {
  flex: 1;
}

.stack-item-price {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 14px;
}

.stack-item-dose {
  font-size: 12px;
  color: var(--accent-teal);
  margin-bottom: 4px;
}

.stack-item-role {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stack-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.stack-action-btn.primary {
  background: var(--accent-primary);
  color: #fff;
}

.stack-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.stack-tier-btn {
  font-size: 12px;
  padding: 8px 12px;
}

/* ===== SUGGESTED FOLLOW-UP QUESTIONS ===== */
.suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
  padding-top: 4px;
}

.suggested-q {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  width: 100%;
}

.suggested-q:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
}

.suggested-q::before {
  content: '✦';
  color: var(--accent-primary);
  font-size: 10px;
  flex-shrink: 0;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  backdrop-filter: blur(4px);
}

.search-overlay.show {
  display: flex;
}

.search-panel {
  width: 560px;
  max-width: 95vw;
  max-height: 70vh;
  background: var(--bg-tertiary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-primary);
}

.search-header i {
  color: var(--text-muted);
  font-size: 14px;
}

.search-box {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-family);
}

.search-box::placeholder {
  color: var(--text-muted);
}

.search-close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}

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

.search-results {
  max-height: calc(70vh - 60px);
  overflow-y: auto;
  padding: 8px;
}

.search-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px;
}

.search-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 10px 12px 4px;
  text-transform: uppercase;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  text-align: left;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item i {
  color: var(--accent-primary);
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 13px;
}

.search-result-snippet {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.knowledge-item {
  color: var(--accent-teal);
}

/* ===== RECENT CHAT ENTRIES (dynamic) ===== */
.recent-chat-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.recent-chat-entry:hover {
  background: var(--bg-hover);
}

.recent-chat-entry.active {
  background: rgba(255, 255, 255, 0.05);
}

.recent-chat-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.recent-chat-entry.active .recent-chat-text {
  color: var(--text-primary);
}

.recent-chat-delete {
  display: none;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 10px;
  flex-shrink: 0;
}

.recent-chat-entry:hover .recent-chat-delete {
  display: flex;
}

.recent-chat-delete:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

/* ===== RESEARCH LIBRARY ===== */
.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.lib-filter-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.lib-filter-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.lib-filter-btn.active { color: #fff; background: var(--accent-primary); }

.lib-search-row {
  margin-bottom: 12px;
}

.lib-search-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: var(--font-family);
}

.lib-search-input:focus { border-color: var(--accent-primary); }

.lib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.lib-card {
  padding: 12px;
  background: transparent;
  border-radius: 12px;
  border: none;
  transition: all 0.2s;
}

.lib-card:hover { background: rgba(255,255,255,0.03); }
.lib-card.info-only-card { opacity: 0.8; }

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.cat-badge.in-stock { background: rgba(20,241,149,0.15); color: #14f195; }
.cat-badge.info-only { background: rgba(139,92,246,0.12); color: var(--accent-secondary); }
.lib-card.researching { background: rgba(255, 255, 255, 0.02); }

.lib-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.lib-card-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.lib-card-title {
  flex: 1;
  min-width: 0;
}

.lib-card-title strong { font-size: 13px; display: block; }
.lib-price { font-size: 12px; color: var(--accent-primary); font-weight: 600; flex-shrink: 0; }

.lib-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 2px 0 0;
}

.lib-card-actions {
  display: flex;
  gap: 6px;
}

.lib-research-btn, .lib-learn-btn {
  padding: 5px 10px;
  font-size: 11px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.lib-research-btn {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
}

.lib-research-btn:hover { background: rgba(139, 92, 246, 0.2); }
.lib-research-btn.active { background: var(--accent-primary); color: #fff; }

.lib-learn-btn {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-teal);
}

.lib-learn-btn:hover { background: rgba(6, 182, 212, 0.2); }

.lib-profile {
  padding: 14px;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 12px;
  margin-bottom: 14px;
}

.lib-profile h4 {
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lib-profile h4 i { color: var(--accent-primary); }

.lib-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lib-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-secondary);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.lib-tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 9px;
  padding: 0;
}

.lib-tag-remove:hover { color: var(--accent-red); }

.lib-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.lib-profile-cost {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
}

.lib-synergy, .lib-conflicts, .lib-protocol {
  margin-top: 12px;
  padding-top: 10px;
}

.lib-synergy h4, .lib-conflicts h4, .lib-protocol h4 {
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lib-synergy h4 i { color: var(--accent-teal); }
.lib-conflicts h4 i { color: var(--accent-orange); }
.lib-protocol h4 i { color: var(--accent-primary); }

.synergy-item, .conflict-item {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 4px 0;
  display: flex;
  gap: 8px;
}

.synergy-item i, .conflict-item i {
  margin-top: 3px;
  flex-shrink: 0;
  font-size: 10px;
}

.lib-profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.lib-analyze-btn {
  flex: 1;
  padding: 10px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.lib-analyze-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3); }

.lib-shop-btn {
  flex: 1;
  padding: 10px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-teal);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: var(--font-family);
  text-decoration: none;
}

.lib-shop-btn:hover { background: rgba(6, 182, 212, 0.25); }

/* ===== HEALTH REPORT ===== */
.health-report {
  padding: 4px 0;
}

.report-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-header h2 i { color: var(--accent-primary); }
.report-date-main { font-size: 13px; color: var(--text-muted); }
.report-subtitle { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }

.report-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.report-section h3 {
  font-size: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-section h3 i { color: var(--accent-primary); font-size: 14px; }

.report-chart-container {
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 16px 8px 8px;
  margin-bottom: 8px;
}

.report-chart {
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-summary {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
}

.report-protocol-row {
  padding: 8px 0;
  font-size: 13px;
}

.report-protocol-row + .report-protocol-row {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.report-date-small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.report-blood-table {
  font-size: 13px;
}

.report-blood-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.report-blood-row + .report-blood-row {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.report-notes {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.report-note {
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.report-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px;
  text-align: center;
}

.report-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.report-print-btn, .report-copy-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.report-print-btn {
  background: var(--accent-primary);
  color: #fff;
}

.report-print-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3); }

.report-copy-btn {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-teal);
}

.report-copy-btn:hover { background: rgba(6, 182, 212, 0.25); }

/* Report wellness bars */
.report-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.report-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 70px;
  flex-shrink: 0;
}

.report-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.report-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.report-bar-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 35px;
  text-align: right;
  flex-shrink: 0;
}

.report-disclaimer {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 12px;
}

/* ===== NOTIFICATIONS ===== */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.notif-actions-row {
  display: flex;
  gap: 6px;
}

.notif-action-btn {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-family);
  transition: all 0.15s;
}

.notif-action-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s;
  cursor: pointer;
}

.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(255,255,255,0.02); }
.notif-item.read { opacity: 0.6; }

.notif-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-content strong {
  font-size: 13px;
  display: block;
}

.notif-content p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0;
  line-height: 1.4;
}

.notif-date {
  font-size: 10px;
  color: var(--text-muted);
}

.notif-dismiss {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 10px;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}

.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ===== SAVED PANEL ===== */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.saved-list::-webkit-scrollbar { width: 6px; }
.saved-list::-webkit-scrollbar-track { background: transparent; }
.saved-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.saved-item, .saved-chat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.saved-item:hover, .saved-chat-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.saved-item-content, .saved-chat-info {
  flex: 1;
  min-width: 0;
}

.saved-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.saved-chat-info strong {
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-date {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.saved-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 10px;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.15s;
}

.saved-item:hover .saved-delete,
.saved-chat-item:hover .saved-delete { opacity: 1; }
.saved-delete:hover { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

/* ===== PROFILE PANEL ===== */
.profile-modal-inner {
  overflow-y: auto !important;
  display: block !important;
}

.profile-modal-inner::-webkit-scrollbar { width: 6px; }
.profile-modal-inner::-webkit-scrollbar-track { background: transparent; }
.profile-modal-inner::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.profile-header-section {
  text-align: center;
  padding: 24px 20px 16px;
}

.profile-avatar {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-header-section h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.profile-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  margin: 0 16px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.profile-section {
  padding: 12px 20px;
}

.profile-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.profile-activity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.activity-row i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  font-size: 12px;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.profile-link:hover { color: var(--text-primary); }
.profile-link i { color: var(--text-muted); width: 16px; text-align: center; }

.profile-data-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-family);
  margin-bottom: 6px;
  transition: all 0.2s;
}

.profile-data-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.profile-data-btn.danger:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* ===== AUTH UI ===== */
.auth-section {
  padding: 20px 0;
  text-align: center;
}

.auth-section h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.auth-social-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 16px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
  border: none;
}

.google-btn { background: #fff; color: #333; }
.google-btn:hover { background: #f0f0f0; }

.x-btn { background: #1a1a2e; color: #fff; border: 1px solid rgba(255,255,255,0.15) !important; }
.x-btn:hover { background: #2a2a3e; }

.telegram-btn { background: #0088cc; color: #fff; }
.telegram-btn:hover { background: #0077b5; }

.email-btn { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.08) !important; }
.email-btn:hover { background: var(--bg-hover); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}

.auth-email-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.auth-create-btn {
  width: 100%;
  padding: 12px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s;
  margin-top: 4px;
}

.auth-create-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

.password-toggle:hover { color: var(--text-primary); }

/* ===== PRICE LIST ===== */
.price-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.price-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.price-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
}

.price-link:hover {
  color: var(--accent-teal);
}

.price-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-teal);
  white-space: nowrap;
}

/* ===== PHOTO IN CHAT ===== */
.chat-photo {
  max-width: 280px;
  max-height: 280px;
  border-radius: 12px;
  margin-bottom: 8px;
  display: block;
}

/* ===== REMINDER MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1000;
}

.modal-overlay.show {
  display: block;
}

.reminder-modal {
  position: fixed;
  left: var(--sidebar-width);
  top: var(--top-nav-height);
  height: calc(100vh - var(--top-nav-height));
  width: 380px;
  max-width: calc(100vw - var(--sidebar-width));
  background: var(--bg-primary);
  padding: 28px;
  overflow-y: auto;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .reminder-modal {
  transform: translateX(0);
}

.reminder-modal h2 {
  font-size: 20px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.reminder-modal h2 i {
  color: var(--accent-primary);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.reminder-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-input {
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), inset 0 -1px 0 rgba(0,0,0,0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.form-input:focus {
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12), inset 0 1px 0 rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-input option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

select.form-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%235a6577' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  background-repeat: no-repeat, no-repeat;
  background-position: right 14px center, 0 0;
  background-size: 12px 8px, auto;
  padding-right: 36px;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7) opacity(0.55);
  cursor: pointer;
}

.reminder-create-btn {
  position: relative;
  padding: 14px;
  border: none;
  border-radius: 13px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  margin-top: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #06b6d4 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 10px 28px rgba(139, 92, 246, 0.32);
  transition: transform 0.2s ease, box-shadow 0.25s ease, background-position 0.6s ease;
}

.reminder-create-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.8s ease;
  pointer-events: none;
}

.reminder-create-btn:hover {
  transform: translateY(-1px);
  background-position: 100% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 14px 38px rgba(139, 92, 246, 0.5);
}

.reminder-create-btn:hover::after { left: 125%; }

.reminder-create-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 4px 14px rgba(0,0,0,0.25);
}

.reminder-list {
  margin-top: 16px;
}

.reminder-list h4 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.reminder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: 10px;
  margin-bottom: 6px;
}

.reminder-item.disabled {
  opacity: 0.4;
}

.reminder-info strong {
  font-size: 13px;
}

.reminder-schedule {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.reminder-actions {
  display: flex;
  gap: 6px;
}

.reminder-toggle-btn, .reminder-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.reminder-toggle-btn:hover {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateY(-1px);
}

.reminder-delete-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.32);
  transform: translateY(-1px);
}

.modal-close-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s;
  flex-shrink: 0;
}

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

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.camera-btn { color: rgba(255, 255, 255, 0.7) !important; }
.reminder-btn { color: rgba(255, 255, 255, 0.7) !important; }

/* Mobile tools toggle — hidden on desktop */
.tools-toggle-mobile { display: none; }
.mobile-tools-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s;
}
.mobile-tools-btn:hover { color: var(--text-primary); }

/* Sidebar close button — hidden on desktop */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  z-index: 5;
  background: none;
  border: none;
  cursor: pointer;
}
.sidebar-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* Mobile-only nav section — hidden on desktop */
.mobile-nav-section { display: none; }
.mobile-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 8px 16px;
}

@media (max-width: 768px) {
  .tools-toggle-mobile { display: flex; }
  .sidebar-close-btn { display: flex; }
  .mobile-nav-section { display: block; }
  .mobile-tools-btn { display: flex; }
}

/* ===== HEALTH CHECK PANEL (slide-in sidebar) ===== */
.health-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 200;
}

.health-panel-overlay.show {
  display: block;
}

.health-modal {
  position: fixed;
  left: var(--sidebar-width);
  top: var(--top-nav-height);
  height: calc(100vh - var(--top-nav-height));
  width: 400px;
  max-width: calc(100vw - var(--sidebar-width));
  background:
    linear-gradient(180deg, rgba(20, 22, 32, 0.92) 0%, rgba(10, 11, 18, 0.96) 100%);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(139, 92, 246, 0.10);
}

.health-modal::after {
  content: "";
  position: absolute;
  top: -120px;
  left: -20%;
  width: 140%;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.22) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
}

.health-modal::-webkit-scrollbar {
  width: 6px;
}

.health-modal::-webkit-scrollbar-track {
  background: transparent;
}

.health-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.3), rgba(6, 182, 212, 0.2));
  border-radius: 3px;
}

.health-panel-overlay.show .health-modal {
  transform: translateX(0);
}

/* Same for reminder panel */
.reminder-modal::-webkit-scrollbar {
  width: 6px;
}

.reminder-modal::-webkit-scrollbar-track {
  background: transparent;
}

.reminder-modal::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.health-tabs {
  display: flex;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  padding: 10px 10px 10px;
  gap: 4px;
  z-index: 5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.health-tab {
  flex: 1;
  position: relative;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.25s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  font-family: var(--font-family);
  outline: none;
}

.health-tab i {
  font-size: 12px;
  opacity: 0.85;
}

.health-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.health-tab:focus-visible {
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.5);
}

.health-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(6, 182, 212, 0.20));
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 14px rgba(139, 92, 246, 0.28);
}

.health-tab.active i {
  color: #c4b5fd;
  opacity: 1;
}

.health-tab-content {
  display: none;
  padding: 22px 22px 28px;
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

.health-tab-content.active {
  display: flex;
  flex-direction: column;
}

.health-tab-content::-webkit-scrollbar {
  width: 6px;
}

.health-tab-content::-webkit-scrollbar-track {
  background: transparent;
}

.health-tab-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.25), rgba(6, 182, 212, 0.15));
  border-radius: 3px;
}

.health-tab-content h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e8eaed;
}

.health-tab-content h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.55);
  flex-shrink: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent) 1;
}

.protocol-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-record-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.health-record-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6), 0 0 2px rgba(255, 255, 255, 0.4) inset;
}

.health-record-item:hover {
  transform: translateX(2px);
  border-color: rgba(167, 139, 250, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
}

.health-record-item.disabled {
  opacity: 0.5;
}

.health-record-item.disabled::before {
  background: #3a3f4b;
  box-shadow: none;
}

.health-record-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.health-record-info strong {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #e8eaed;
}

.health-record-detail {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.health-record-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  letter-spacing: 0.1px;
}

.empty-state {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-style: italic;
  line-height: 1.5;
}

.form-row-inline {
  display: flex;
  gap: 10px;
}

.log-section {
  padding: 16px 0;
}

.log-section + .log-section {
  border-top: 1px solid;
  border-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent) 1;
}

.log-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #e8eaed;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.1px;
}

.log-section h4 i {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.18));
  border: 1px solid rgba(167, 139, 250, 0.22);
  color: #c4b5fd;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px rgba(139, 92, 246, 0.15);
  flex-shrink: 0;
}

.log-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: -6px 0 8px 0;
  font-style: italic;
}

.log-section textarea.form-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ===== Scan upload (Bloodwork / DEXA / Imaging / Genetic) ===== */
.scan-upload-row { margin: -2px 0 8px; }

.scan-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-family: var(--font-family);
  color: #c4b5fd;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.06));
  border: 1px dashed rgba(167, 139, 250, 0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.scan-upload-btn:hover {
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.20), rgba(6, 182, 212, 0.10));
  border-color: rgba(167, 139, 250, 0.55);
  color: #e8eaed;
  transform: translateY(-1px);
}

.scan-upload-btn i { font-size: 13px; }

.scan-status {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 6px 0 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.45;
}

.scan-status:empty { display: none; }

.scan-status i { margin-right: 6px; }

.scan-status-busy { color: #c4b5fd; }
.scan-status-ok { color: #4ade80; }
.scan-status-warn { color: #fbbf24; }
.scan-status-error { color: #f87171; }

.scan-attached-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 9px;
  font-size: 11px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-attached-chip .scan-attached-size {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 2px;
}

.scan-extracted-details {
  margin-top: 4px;
  font-size: 11px;
}

.scan-extracted-details summary {
  cursor: pointer;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  user-select: none;
  outline: none;
  padding: 2px 0;
  transition: color 0.15s ease;
}

.scan-extracted-details summary:hover { color: #c4b5fd; }

.scan-extracted-details[open] summary { color: #c4b5fd; }

.scan-extracted-pre {
  margin: 6px 0 0;
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.record-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 9px;
  font-size: 10.5px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.record-file-chip:hover {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(167, 139, 250, 0.35);
}

.log-submit-btn {
  position: relative;
  padding: 9px 18px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.10));
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-family);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.log-submit-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.26), rgba(139, 92, 246, 0.16));
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
  color: #e8eaed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px rgba(139, 92, 246, 0.2);
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.records-list::-webkit-scrollbar {
  width: 6px;
}

.records-list::-webkit-scrollbar-track {
  background: transparent;
}

.records-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* ===== WELLNESS CHECK-IN ===== */
.wellness-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.wellness-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wellness-item label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.wellness-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  outline: none;
}

.wellness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
}

.wellness-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.side-effects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
}

.side-effect-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
  cursor: pointer;
}

.side-effect-check input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 14px;
  height: 14px;
}

/* ===== RESPONSIVE ===== */
/* ===== TABLET (1200px) ===== */
@media (max-width: 1200px) {
  .right-sidebar {
    width: 240px;
    min-width: 240px;
  }
}

/* ===== SMALL TABLET (1024px) ===== */
@media (max-width: 1024px) {
  .right-sidebar {
    position: fixed;
    right: -300px;
    top: var(--top-nav-height);
    height: calc(100vh - var(--top-nav-height));
    z-index: 90;
    transition: right 0.3s ease;
    width: 280px;
    min-width: 280px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    background: var(--bg-primary);
  }
  .right-sidebar.mobile-open {
    right: 0;
  }
}

/* ===== MOBILE (768px) ===== */
@media (max-width: 768px) {
  /* Mobile menu button */
  .mobile-menu-btn {
    display: flex;
  }

  /* Hide desktop-only nav */
  .top-nav-center { display: none; }
  .shop-btn, .cart-nav-btn, .account-btn, .account-btn-img, .account-btn-3d { display: none; }

  /* Top nav — glass see-through on mobile */
  .top-nav {
    padding: 0 12px;
    height: 48px;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-bottom: none;
  }
  :root { --top-nav-height: 48px; }

  .logo-img { height: 40px; }
  .logo-mark { width: 30px; height: 30px; }
  .logo-word { font-size: 20px; letter-spacing: -0.5px; }
  .logo-tag { font-size: 7px; letter-spacing: 2.2px; margin-top: 4px; }

  /* Chat uses full screen — content goes behind glass nav */
  .chat-messages {
    padding: 8px 12px 140px;
  }

  /* Left sidebar — slide-in overlay */
  .left-sidebar {
    position: fixed;
    left: -260px;
    top: var(--top-nav-height);
    height: calc(100vh - var(--top-nav-height));
    width: 260px;
    min-width: 260px;
    z-index: 90;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    background: var(--bg-primary);
  }
  .left-sidebar.mobile-open {
    left: 0;
  }

  /* Mobile backdrop when sidebar open */
  .mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--top-nav-height);
    background: rgba(0,0,0,0.5);
    z-index: 89;
  }
  .mobile-backdrop.show { display: block; }

  /* Chat fills entire screen */
  .chat-area {
    width: 100%;
  }

  .chat-messages {
    padding: 8px 10px 140px;
  }

  .chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px 24px;
    background: var(--bg-primary);
    z-index: 50;
  }

  .chat-input-wrapper {
    background: rgba(255, 255, 255, 0.04);
  }

  /* Chat header — hidden on mobile */
  .chat-header { display: none; }

  /* Hide disclaimer on mobile — saves space */
  .ai-disclaimer { display: none; }

  /* Input bar — compact touch targets */
  .chat-input { font-size: 16px; } /* Prevents iOS zoom on focus */
  .input-tool-btn {
    width: 36px; height: 36px;
    min-width: 36px; min-height: 36px;
    font-size: 15px;
  }
  .input-tools-left { gap: 0; }
  .send-btn { width: 44px; height: 44px; font-size: 16px; }
  .chat-input-wrapper { padding: 10px 10px 6px; }
  .input-tools-bottom { margin-top: 4px; }

  /* Messages — compact on mobile */
  .message-content { font-size: 14px; line-height: 1.4; }
  .message-content p { margin-bottom: 1px; margin-top: 0; }
  .message-content p + p { margin-top: 1px; }
  .message-content h3 { margin: 8px 0 4px; font-size: 14px; }
  .message { max-width: 100%; }
  .ai-message { padding-left: 8px; padding-right: 12px; }

  /* Code blocks — horizontal scroll */
  .code-block pre {
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .code-block code { font-size: 11px; white-space: pre; }

  /* Photo */
  .chat-photo { max-width: 220px; }

  /* Stack builder */
  .stack-options { gap: 6px; }
  .stack-option-btn {
    font-size: 12px;
    padding: 10px 14px;
    width: 100%; /* Full width on mobile */
  }
  .stack-card { padding: 14px; }
  .stack-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .stack-actions { flex-direction: column; }
  .stack-action-btn { width: 100%; justify-content: center; }

  /* Research library grid — single column */
  .lib-grid { grid-template-columns: 1fr; }
  .lib-filters { gap: 4px; }
  .lib-filter-btn { padding: 6px 10px; font-size: 10px; }
  .lib-card { padding: 10px; }
  .lib-card-icon { width: 32px; height: 32px; }
  .lib-profile-actions { flex-direction: column; }
  .lib-analyze-btn, .lib-shop-btn { width: 100%; }

  /* Health check panel — full width on mobile */
  .health-modal {
    width: 100%;
    max-width: 100%;
    left: 0;
    margin-left: 0;
    transform: translateX(-100%);
  }
  .health-panel-overlay.show .health-modal {
    transform: translateX(0);
  }

  /* Reminder panel — full width on mobile */
  .reminder-modal {
    width: 100%;
    max-width: 100%;
    left: 0;
    margin-left: 0;
    transform: translateX(-100%);
  }
  .modal-overlay.show .reminder-modal {
    transform: translateX(0);
  }

  /* Health tabs */
  .health-tabs { padding: 6px 6px 0; }
  .health-tab { padding: 10px 4px; font-size: 11px; gap: 4px; }
  .health-tab i { font-size: 12px; }
  .health-tab-content { padding: 16px 14px; }

  /* Form inputs — touch friendly */
  .form-input { padding: 12px; font-size: 16px; } /* 16px prevents iOS zoom */
  .form-row-inline { flex-direction: column; gap: 8px; }
  .log-submit-btn { padding: 12px 16px; font-size: 13px; width: 100%; justify-content: center; }
  .reminder-create-btn { padding: 14px; }

  /* Wellness sliders */
  .wellness-item label { width: 80px; font-size: 11px; }
  .wellness-slider { height: 8px; }
  .wellness-slider::-webkit-slider-thumb { width: 22px; height: 22px; } /* Bigger for touch */
  .side-effects-grid { grid-template-columns: 1fr; }
  .side-effect-check { padding: 8px 0; font-size: 13px; }

  /* Report */
  .report-actions { flex-direction: column; }
  .report-print-btn, .report-copy-btn { width: 100%; }
  .report-bar-label { width: 60px; font-size: 11px; }
  .report-chart-container { padding: 10px 4px; overflow-x: auto; }

  /* Search modal */
  .search-panel { max-width: 100%; border-radius: 0; max-height: 100vh; }
  .search-overlay { padding-top: 0; }
  .search-box { font-size: 16px; }

  /* Suggested questions — compact on mobile */
  .suggested-q { padding: 8px 10px; font-size: 13px; min-height: unset; }
  .suggested-questions { gap: 0; margin-top: 4px; }

  /* Message actions — 44px touch targets */
  .message-action-btn { width: 44px; height: 44px; font-size: 16px; }

  /* Section headings */
  .section-heading { font-size: 10px; }

  /* Right sidebar on mobile */
  .right-sidebar {
    width: 100%;
    min-width: 100%;
    right: -100%;
  }

  /* Toast notifications — full width on mobile */
  .toast-container {
    left: 12px;
    right: 12px;
    top: calc(var(--top-nav-height) + 8px);
  }
  .toast { font-size: 12px; padding: 10px 14px; }

  /* Price list — compact */
  .price-row { padding: 6px 8px; }
  .price-link { font-size: 12px; }
  .price-val { font-size: 12px; }

  /* User message bubble — less left padding */
  .user-message { padding-left: 40px; }
  .ai-message { padding-left: 6px; padding-right: 14px; }

  /* AI avatar — smaller on mobile */
  .ai-avatar { width: 28px; height: 28px; }
  .ai-typing .ai-avatar { width: 36px; height: 36px; }
  .ai-response-wrapper { gap: 8px; }

  /* Chat header pill — tighter */
  .chat-header { left: 8px; right: 8px; padding: 4px 14px; }

  /* Profile stats — wrap if needed */
  .profile-stats { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .profile-stat { min-width: 60px; }
  .profile-section { padding: 10px 16px; }

  /* Notifications/Saved panels — full width */
  .notif-item { padding: 8px 10px; }
  .notif-content strong { font-size: 12px; }
  .notif-content p { font-size: 11px; }

  /* Splash screen — smaller logo */
  .splash-logo { width: 96px; height: 96px; }
  .splash-wordmark { font-size: 26px; }
  .splash-loader { width: 200px; }

  /* 7 action buttons — wrap to 2 rows if needed */
  .message-actions { flex-wrap: wrap; gap: 2px; }

  /* Code blocks — wrap on mobile, don't scroll */
  .code-block code { white-space: pre-wrap; word-wrap: break-word; }
  .code-block pre { overflow-x: hidden; }

  /* Compare/Dosage wizard buttons — scroll container */
  .stack-options { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Typing indicator */
  .typing-label { font-size: 12px; }
  .ai-typing { gap: 8px; }

  /* Notification badge */
  .notif-badge { top: 2px; right: 4px; min-width: 14px; height: 14px; font-size: 8px; }

  /* Profile header */
  .profile-header-section { padding: 16px 14px 12px; }
  .profile-avatar { font-size: 40px; }
  .profile-header-section h3 { font-size: 16px; }

  /* Activity rows */
  .activity-row { font-size: 12px; gap: 8px; }

  /* Saved panel items */
  .saved-preview { font-size: 11px; }
  .saved-chat-info strong { font-size: 12px; }

  /* Profile data buttons */
  .profile-data-btn { font-size: 12px; }
  .profile-link { font-size: 12px; padding: 8px 0; }
}

/* ===== SMALL MOBILE (480px) ===== */
@media (max-width: 480px) {
  .chat-messages { padding: 8px 10px 120px; }
  .chat-input-container { padding: 8px 8px 20px; }

  .lib-card-top { gap: 6px; }
  .lib-card-icon { width: 28px; height: 28px; }
  .lib-card-title strong { font-size: 12px; }
  .lib-desc { font-size: 10px; }
  .lib-price { font-size: 11px; }

  .stack-item { padding: 10px; }
  .stack-item-header { flex-direction: column; align-items: flex-start; gap: 2px; }
  .stack-item-icon { width: 24px; height: 24px; }

  .code-block code { font-size: 10px; }

  .capability-card, .agent-tool-card { padding: 8px 10px; }
  .tool-icon-3d { width: 32px; height: 32px; }
  .capability-name { font-size: 12px; }
  .capability-desc { font-size: 10px; }

  /* User message tighter */
  .user-message { padding-left: 30px; }
  .user-message .message-content { max-width: 85%; font-size: 13px; }

  /* Action buttons smaller */
  .message-action-btn { width: 36px; height: 36px; font-size: 14px; }

  /* Profile compact */
  .profile-stats { gap: 4px; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 9px; }
  .profile-avatar { font-size: 36px; }

  /* Toast compact */
  .toast { font-size: 11px; padding: 8px 12px; }

  /* Price rows tighter */
  .price-row { padding: 5px 6px; }
  .price-link { font-size: 11px; }
  .price-val { font-size: 11px; }

  /* Report bars compact */
  .report-bar-label { width: 50px; font-size: 10px; }
}

/* ===== EXTRA SMALL (400px) ===== */
@media (max-width: 400px) {
  .logo-img { height: 24px; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-word { font-size: 16px; }
  .logo-tag { display: none; }
  .top-nav { padding: 0 8px; }
  .mobile-menu-btn { width: 36px; height: 36px; font-size: 16px; }
  .chat-header-right { display: none; }
  .chat-messages { padding: 8px 8px 115px; }
  .message-content { font-size: 13px; line-height: 1.35; }
  .suggested-q { font-size: 12px; padding: 6px 8px; }
  .user-message { padding-left: 20px; }
  .ai-message { padding-left: 4px; padding-right: 8px; }
  .ai-avatar { width: 24px; height: 24px; }
  .message-actions { gap: 0; }
  .message-action-btn { width: 32px; height: 32px; font-size: 13px; }
}

/* ===== TOUCH DEVICE HELPERS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects that don't work on touch */
  .sidebar-item:hover { background: transparent; }
  .capability-card:hover { background: transparent; }
  .agent-tool-card:hover { background: transparent; }
  .recent-chat-entry:hover .recent-chat-delete { display: flex; }

  /* 44px minimum tap targets */
  .sidebar-item { padding: 14px 16px; min-height: 44px; }
  .capability-card, .agent-tool-card { padding: 12px; min-height: 44px; }
  .recent-chat-entry { padding: 12px; min-height: 44px; }
  .recent-chat-delete { display: flex; width: 44px; height: 44px; }
  .chat-toggle { padding: 10px 14px; min-height: 44px; }
  .stack-option-btn { padding: 14px 16px; min-height: 44px; }
  .lib-research-btn, .lib-learn-btn { padding: 10px 14px; min-height: 44px; }
}

/* ===== PWA INSTALL BANNER ===== */
.install-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  /* Liquid-glass effect — same family as the chat input */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(139, 92, 246, 0.12);
  overflow: hidden;
  z-index: 9999;
  max-width: 420px;
  width: calc(100% - 32px);
  animation: slideUp 0.3s ease-out;
}

/* Top specular highlight — light catching the glass edge */
.install-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.30), transparent);
  pointer-events: none;
}

/* Inner refraction glow — soft top wash */
.install-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}

/* Children render above the glass overlays */
.install-banner > * { position: relative; z-index: 1; }

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.install-banner-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 10px;
  /* Subtle inner-glow plate so the gradient glyph reads on any banner bg */
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  padding: 4px;
}
[data-theme="light"] .install-banner-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.06));
  border-color: rgba(139, 92, 246, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-banner-text strong {
  font-size: 14px;
  color: #e8eaed;
}

.install-banner-text span {
  font-size: 12px;
  color: #5a6577;
}

.install-banner-btn {
  padding: 8px 20px;
  background: #8b5cf6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  white-space: nowrap;
  transition: background 0.2s;
}

.install-banner-btn:hover {
  background: #7c3aed;
}

.install-banner-close {
  background: none;
  border: none;
  color: #5a6577;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.install-banner-close:hover {
  color: #e8eaed;
}

/* ===== ACCESS GRANTED success state (gate) ===== */
.gate-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 0 16px;
  animation: gateSuccessIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gate-success-icon {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(20, 241, 149, 0.22), rgba(6, 182, 212, 0.10) 60%, transparent);
  box-shadow:
    0 0 0 6px rgba(20, 241, 149, 0.08),
    0 0 36px rgba(20, 241, 149, 0.45),
    0 0 80px rgba(6, 182, 212, 0.25);
  animation: gateRingPulse 1.6s 0.6s ease-out infinite;
}

.gate-check-svg {
  width: 84px;
  height: 84px;
  display: block;
  overflow: visible;
}

.gate-check-ring {
  fill: none;
  stroke: rgba(20, 241, 149, 0.85);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  filter: drop-shadow(0 0 6px rgba(20, 241, 149, 0.6));
  animation: gateRingDraw 0.55s 0.05s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.gate-check-mark {
  fill: none;
  stroke: #4ade80;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  filter: drop-shadow(0 0 10px rgba(20, 241, 149, 0.7));
  animation: gateCheckDraw 0.4s 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.gate-success-title {
  font-family: 'Jost', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4.5px;
  background: linear-gradient(90deg, #4ade80, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 24px rgba(20, 241, 149, 0.35);
  opacity: 0;
  animation: gateTextFade 0.5s 0.85s ease-out forwards;
}

.gate-success-sub {
  font-size: 12px;
  color: var(--text-muted, #5a6577);
  letter-spacing: 0.4px;
  opacity: 0;
  animation: gateTextFade 0.5s 1s ease-out forwards;
}

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

@keyframes gateRingDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes gateCheckDraw {
  to { stroke-dashoffset: 0; }
}

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

@keyframes gateRingPulse {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(20, 241, 149, 0.08),
      0 0 36px rgba(20, 241, 149, 0.45),
      0 0 80px rgba(6, 182, 212, 0.25);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(20, 241, 149, 0.04),
      0 0 50px rgba(20, 241, 149, 0.6),
      0 0 100px rgba(6, 182, 212, 0.35);
  }
}

/* ===== USER MENU (top nav account dropdown) ===== */
.user-menu {
  position: relative;
}

.account-btn-3d .user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-menu-dropdown[hidden] { display: none; }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: linear-gradient(180deg, rgba(20, 22, 32, 0.94), rgba(10, 11, 18, 0.96));
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  z-index: 999;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(139, 92, 246, 0.10);
  animation: userMenuIn 0.18s ease-out;
}

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

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.user-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.18));
}

.user-menu-avatar.user-menu-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #c4b5fd;
}

.user-menu-info {
  min-width: 0;
  flex: 1;
}

.user-menu-name {
  font-family: 'Jost', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #e8eaed;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 11.5px;
  color: var(--text-muted, #5a6577);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-menu-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #f87171;
  font-family: 'Jost', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.user-menu-signout:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  transform: translateY(-1px);
}

.user-menu-signout i { font-size: 11px; }

/* ============================================================
   Recommended Lab Panels — practitioner-facing request lists
   ============================================================ */
.panel-intro {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 12px;
}

.panel-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-selector-row label {
  font-size: 12px;
  font-weight: 600;
  color: #e8eaed;
  letter-spacing: 0.2px;
}

.panel-selector-row select {
  flex: 1;
}

.panel-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 6px 0 16px;
}

.panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-family: 'Jost', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #c4b5fd;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.panel-action-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.10));
  border-color: rgba(167, 139, 250, 0.55);
  color: #e8eaed;
  transform: translateY(-1px);
}

.panel-action-btn.primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #06b6d4 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-action-btn.primary:hover {
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}

.panel-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11.5px;
}

.panel-toolbar button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.panel-toolbar button:hover {
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}

.panel-group {
  margin-bottom: 14px;
}

.panel-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #c4b5fd;
  margin: 0 0 6px;
  padding-left: 2px;
}

.panel-test-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.panel-test-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.panel-test-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #8b5cf6;
}

.panel-test-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.panel-test-label {
  flex: 1;
  font-size: 13px;
  color: #e8eaed;
  line-height: 1.4;
}

.panel-test-method {
  display: block;
  font-size: 10.5px;
  color: #8b95a5;
  font-style: italic;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.panel-status {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 4px 0 10px;
}

.panel-prefill-btn {
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.10), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  font-family: 'Jost', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.panel-prefill-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.08));
  color: #e8eaed;
  border-color: rgba(167, 139, 250, 0.5);
}

/* Print-only area, populated on demand */
#panel-print-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #panel-print-area,
  #panel-print-area * {
    visibility: visible !important;
  }
  #panel-print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 48px 56px;
    background: #fff;
    color: #111;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12pt;
  }
  #panel-print-area h1 {
    font-size: 20pt;
    margin: 0 0 6px;
    color: #111;
  }
  #panel-print-area .pp-subtitle {
    font-size: 11pt;
    color: #444;
    margin: 0 0 18px;
  }
  #panel-print-area .pp-intro {
    font-size: 11pt;
    color: #333;
    margin: 0 0 18px;
    line-height: 1.5;
  }
  #panel-print-area ol {
    padding-left: 24pt;
    line-height: 1.5;
  }
  #panel-print-area ol li {
    margin-bottom: 4pt;
  }
  #panel-print-area .pp-method {
    color: #555;
    font-style: italic;
    font-size: 10.5pt;
  }
  #panel-print-area .pp-footer {
    margin-top: 32pt;
    padding-top: 14pt;
    border-top: 1pt solid #aaa;
    font-size: 10.5pt;
    color: #555;
    display: flex;
    justify-content: space-between;
  }
  #panel-print-area .pp-signature {
    margin-top: 36pt;
    font-size: 10.5pt;
    color: #333;
  }
  #panel-print-area .pp-signature .line {
    display: inline-block;
    width: 260pt;
    border-bottom: 1pt solid #333;
    margin-left: 8pt;
    vertical-align: middle;
  }
}

/* ============================================================
   Theme toggle button (top nav)
   ============================================================ */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.10), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.22);
  color: #c4b5fd;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  margin-right: 6px;
}
.theme-toggle-btn:hover {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.18), rgba(6, 182, 212, 0.08));
  border-color: rgba(167, 139, 250, 0.45);
  color: #e8eaed;
  transform: translateY(-1px);
}
.theme-toggle-btn:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.6);
  outline-offset: 2px;
}

/* ============================================================
   LIGHT THEME
   Triggered when <html data-theme="light"> is set by js/theme.js.
   We override the design-token variables first; many components
   that already use var(--bg-*) / var(--text-*) adapt for free.
   Components with hardcoded dark colors are overridden below.
   ============================================================ */
[data-theme="light"] {
  --bg-primary:   #fbfbfd;
  --bg-secondary: #ffffff;
  --bg-tertiary:  #f3f4f7;
  --bg-card:      #ffffff;
  --bg-hover:     #eef0f5;
  --bg-active:    #e7e3fb;
  --border-color: #e3e5ec;
  --text-primary:   #1a1b25;
  --text-secondary: #5a6577;
  --text-muted:     #8b95a5;
  /* Brand accents stay the same — they pop in both themes. */
}

[data-theme="light"] body,
[data-theme="light"] html {
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Top nav surface */
[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .logo-word {
  color: var(--text-primary);
}

/* Theme toggle in light mode */
[data-theme="light"] .theme-toggle-btn {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(6, 182, 212, 0.02));
  border-color: rgba(139, 92, 246, 0.25);
  color: #7c3aed;
}
[data-theme="light"] .theme-toggle-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.05));
  border-color: rgba(139, 92, 246, 0.45);
  color: #5b21b6;
}

/* Health Check / profile / reminders modal surfaces — hardcoded dark gradients */
[data-theme="light"] .health-modal,
[data-theme="light"] .reminder-modal,
[data-theme="light"] .profile-modal-inner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 249, 252, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(0, 0, 0, 0.04),
    0 30px 80px rgba(20, 25, 50, 0.18),
    0 0 60px rgba(139, 92, 246, 0.06);
  color: var(--text-primary);
}
[data-theme="light"] .health-modal::after {
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.10) 0%, transparent 65%);
}

/* Modal text-on-dark fixups */
[data-theme="light"] .health-modal h3,
[data-theme="light"] .health-modal h4,
[data-theme="light"] .modal-subtitle,
[data-theme="light"] .log-section h4,
[data-theme="light"] .panel-group-title,
[data-theme="light"] .panel-test-label {
  color: var(--text-primary);
}
[data-theme="light"] .modal-subtitle,
[data-theme="light"] .log-hint,
[data-theme="light"] .panel-status,
[data-theme="light"] .scan-status,
[data-theme="light"] .panel-test-method {
  color: var(--text-secondary);
}

/* Form inputs in light mode */
[data-theme="light"] .form-input,
[data-theme="light"] select.form-input,
[data-theme="light"] input.form-input,
[data-theme="light"] textarea.form-input {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
[data-theme="light"] .form-input::placeholder { color: var(--text-muted); }
[data-theme="light"] .form-input:focus {
  border-color: rgba(139, 92, 246, 0.55);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
[data-theme="light"] .form-row label {
  color: var(--text-secondary);
}

/* Tabs — health modal tab bar */
[data-theme="light"] .health-tab {
  color: var(--text-secondary);
}
[data-theme="light"] .health-tab:hover:not(.active) {
  background: rgba(139, 92, 246, 0.06);
  color: var(--text-primary);
}
[data-theme="light"] .health-tab.active {
  color: #5b21b6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.10), rgba(6, 182, 212, 0.05));
}

/* Records / cards inside modal */
[data-theme="light"] .health-record-item,
[data-theme="light"] .panel-test-row:hover {
  background: rgba(20, 25, 50, 0.03);
}
[data-theme="light"] .health-record-info strong { color: var(--text-primary); }
[data-theme="light"] .health-record-meta { color: var(--text-secondary); }

/* Recommended-panel surface */
[data-theme="light"] .panel-intro {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.02));
  border-color: rgba(139, 92, 246, 0.18);
  color: var(--text-secondary);
}
[data-theme="light"] .panel-action-btn {
  color: #5b21b6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.07), rgba(6, 182, 212, 0.03));
  border-color: rgba(139, 92, 246, 0.25);
}
[data-theme="light"] .panel-action-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.06));
  color: var(--text-primary);
  border-color: rgba(139, 92, 246, 0.45);
}
[data-theme="light"] .panel-action-btn.primary {
  color: #ffffff;
}
[data-theme="light"] .panel-prefill-btn {
  color: #5b21b6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(6, 182, 212, 0.02));
  border-color: rgba(139, 92, 246, 0.25);
}

/* Welcome modal (intro overlay) */
[data-theme="light"] .welcome-overlay {
  background: rgba(240, 242, 250, 0.78);
}
[data-theme="light"] .welcome-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 249, 252, 0.99) 100%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.05) inset,
    0 30px 80px rgba(20, 25, 50, 0.22),
    0 0 60px rgba(139, 92, 246, 0.10);
}
[data-theme="light"] .welcome-word,
[data-theme="light"] .welcome-title { color: var(--text-primary); }
[data-theme="light"] .welcome-subtitle,
[data-theme="light"] .welcome-feature-desc { color: var(--text-secondary); }
[data-theme="light"] .welcome-feature {
  background: rgba(20, 25, 50, 0.03);
  border-color: rgba(20, 25, 50, 0.06);
}
[data-theme="light"] .welcome-feature:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.20);
}
[data-theme="light"] .welcome-feature-title { color: var(--text-primary); }
[data-theme="light"] .welcome-fineprint { color: var(--text-muted); }

/* Sidebar */
[data-theme="light"] .sidebar,
[data-theme="light"] .right-sidebar {
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
}

/* Account button in light mode */
[data-theme="light"] .account-btn-3d {
  color: var(--text-primary);
}

/* Toast notifications (if hardcoded) */
[data-theme="light"] .toast {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(20, 25, 50, 0.15);
}

/* ============================================================
   Download Calendar button (Health Check → Protocol tab)
   ============================================================ */
.calendar-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  margin: 0 0 12px;
  font-family: 'Jost', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #c4b5fd;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.calendar-export-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.10));
  border-color: rgba(167, 139, 250, 0.55);
  color: #e8eaed;
  transform: translateY(-1px);
}
.calendar-export-btn i { font-size: 12px; }
[data-theme="light"] .calendar-export-btn {
  color: #5b21b6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.07), rgba(6, 182, 212, 0.03));
  border-color: rgba(139, 92, 246, 0.25);
}
[data-theme="light"] .calendar-export-btn:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.06));
  color: #1a1b25;
}

/* ============================================================
   FAQ modal
   ============================================================ */
.faq-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(8, 8, 12, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.faq-overlay.show { opacity: 1; pointer-events: auto; }

.faq-modal {
  position: relative;
  max-width: 640px; width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(20, 22, 32, 0.95) 0%, rgba(10, 11, 18, 0.98) 100%);
  border: 1px solid rgba(167, 139, 250, 0.20);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(139, 92, 246, 0.12);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-overlay.show .faq-modal { transform: translateY(0) scale(1); }

.faq-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.faq-header h2 {
  font-family: 'Jost', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.2px;
}
.faq-header h2 i { color: #c4b5fd; font-size: 16px; }
.faq-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.faq-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

.faq-body {
  padding: 8px 22px 22px;
  overflow-y: auto;
}
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 0;
}
.faq-item[open] { padding-bottom: 14px; }
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  padding: 14px 0;
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  font-family: 'Jost', sans-serif;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q-text { flex: 1; padding-right: 12px; }
.faq-chevron {
  font-size: 11px; color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-a {
  font-size: 13.5px; line-height: 1.6;
  color: var(--text-secondary);
  padding: 0 26px 4px 0;
}
.faq-a a { color: #c4b5fd; text-decoration: underline; }
.faq-a a:hover { color: #e8eaed; }

.faq-footer {
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.faq-footer a { color: #c4b5fd; text-decoration: underline; }

/* Light-theme variant */
[data-theme="light"] .faq-overlay {
  background: rgba(240, 242, 250, 0.78);
}
[data-theme="light"] .faq-modal {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 249, 252, 0.99) 100%);
  border-color: rgba(139, 92, 246, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 30px 80px rgba(20, 25, 50, 0.18),
    0 0 60px rgba(139, 92, 246, 0.06);
}
[data-theme="light"] .faq-header {
  border-bottom-color: rgba(20, 25, 50, 0.08);
}
[data-theme="light"] .faq-header h2 i { color: #7c3aed; }
[data-theme="light"] .faq-close {
  background: rgba(20, 25, 50, 0.04);
}
[data-theme="light"] .faq-close:hover {
  background: rgba(20, 25, 50, 0.08);
}
[data-theme="light"] .faq-item {
  border-bottom-color: rgba(20, 25, 50, 0.08);
}
[data-theme="light"] .faq-a a { color: #7c3aed; }
[data-theme="light"] .faq-a a:hover { color: #5b21b6; }
[data-theme="light"] .faq-footer {
  border-top-color: rgba(20, 25, 50, 0.08);
}
[data-theme="light"] .faq-footer a { color: #7c3aed; }

/* Install banner — light theme glass variant */
[data-theme="light"] .install-banner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.70) 100%),
    rgba(255, 255, 255, 0.20);
  border-color: rgba(139, 92, 246, 0.30);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 12px 36px rgba(20, 25, 50, 0.16),
    0 0 40px rgba(139, 92, 246, 0.10);
}
[data-theme="light"] .install-banner::before {
  background: linear-gradient(90deg, transparent, rgba(20, 25, 50, 0.15), transparent);
}
[data-theme="light"] .install-banner::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, transparent 100%);
}
[data-theme="light"] .install-banner-text strong { color: var(--text-primary); }
[data-theme="light"] .install-banner-text span   { color: var(--text-secondary); }
[data-theme="light"] .install-banner-close       { color: var(--text-secondary); }
[data-theme="light"] .install-banner-close:hover { color: var(--text-primary); }

/* Right-sidebar tool icons: in dark mode they use `mix-blend-mode: lighten`
   so they blend with the dark surface. On a light surface that blend mode
   washes them out entirely (white background wins → icon invisible).
   Disabling the blend mode lets the actual icon art render unchanged. */
[data-theme="light"] .tool-icon-3d {
  mix-blend-mode: normal;
}

/* Chat input "liquid glass" — designed for dark; needs explicit light overrides
   so it doesn't become "near-transparent white on white" (invisible). */
[data-theme="light"] .chat-input-wrapper {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(20, 25, 50, 0.10);
  box-shadow: 0 8px 32px rgba(20, 25, 50, 0.08);
}
[data-theme="light"] .chat-input-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 92, 246, 0.40);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}
/* Hide the white specular highlights — they read as artifacts on light bg */
[data-theme="light"] .chat-input-wrapper::before,
[data-theme="light"] .chat-input-wrapper::after {
  display: none;
}
[data-theme="light"] .chat-input::placeholder {
  color: var(--text-muted);
}
[data-theme="light"] .input-tool-btn {
  color: var(--text-secondary);
}
[data-theme="light"] .input-tool-btn:hover {
  color: var(--text-primary);
  background: rgba(20, 25, 50, 0.04);
}
/* `.camera-btn` and `.reminder-btn` use `color: ... !important` to force
   white in dark mode, which beats our generic light-mode override. Match
   the specificity + !important so they're visible on the white input. */
[data-theme="light"] .camera-btn,
[data-theme="light"] .reminder-btn {
  color: var(--text-secondary) !important;
}
[data-theme="light"] .camera-btn:hover,
[data-theme="light"] .reminder-btn:hover {
  color: var(--text-primary) !important;
}
/* Keep the explicit accent colors on .sparkle (.fire) — they already pop in both themes. */

/* Smooth fades on theme switch (optional polish) */
html { transition: background-color 0.25s ease; }
body { transition: background-color 0.25s ease, color 0.25s ease; }
