:root {
  /* Backgrounds — wider separation between levels */
  --bg: #0f1318;
  --surface: #181e27;
  --surface2: #212a36;
  --hover: #2a3545;
  --elevated: #334155;
  --overlay: rgba(0, 0, 0, 0.6);
  /* Borders — more visible */
  --border: #2a3545;
  --border-light: #3d4f63;
  --border-focus: #5bb8a9;
  /* Text — higher contrast */
  --text: #eaf0f6;
  --text2: #a0b1c5;
  --text3: #7d91a8;
  --disabled: #5a6d82;
  /* Accent — soft teal */
  --accent: #5bb8a9;
  --accent2: #4da396;
  --accent-dim: rgba(91, 184, 169, 0.12);
  --accent-secondary: #6ba3c7;
  --accent-secondary-dim: rgba(107, 163, 199, 0.12);
  /* Glow */
  --accent-glow: rgba(91, 184, 169, 0.06);
  /* Semantic */
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.10);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.10);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.10);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.10);
  --pink: #c084fc;
  --pink-dim: rgba(192, 132, 252, 0.10);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.10);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.10);
  /* Utility */
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.15s ease;
  --transition-slow: 0.3s ease;
  --font: -apple-system, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
}

::selection { background: rgba(91, 184, 169, 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Lucide icons */
[data-lucide] { display: inline-block; vertical-align: middle; }
[data-lucide] svg { stroke-width: 1.75; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(91, 184, 169, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 80%, rgba(107, 163, 199, 0.03) 0%, transparent 60%);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  background: rgba(24, 30, 39, 0.82);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.3s ease;
  overflow: hidden;
  box-shadow: 1px 0 12px rgba(0, 0, 0, 0.3);
}
.sidebar.collapsed { width: 60px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 12px 12px 16px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon { flex-shrink: 0; }
.sidebar.collapsed .sidebar-logo .logo-text { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 20px 0 12px; }

.sidebar-time {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-time .time-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text2);
}
.sidebar.collapsed .sidebar-time { justify-content: center; padding: 0 0 12px; }
.sidebar.collapsed .sidebar-time .time-date { display: none; }

/* ── Dashboard Command Center ── */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard-header-left .header-icon { color: var(--accent); display: flex; align-items: center; }
.dashboard-header-left .header-greeting { font-size: 16px; font-weight: 600; }
.dashboard-header-left .header-day { font-size: 13px; color: var(--text3); }
.hero-readiness {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.hero-readiness-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.hero-readiness-ring svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}
.hero-readiness-score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
}
.hero-readiness-info {
  flex: 1; min-width: 0;
}
.hero-readiness-level {
  font-size: 16px; font-weight: 700; margin-bottom: 2px;
}
.hero-readiness-hint {
  font-size: 12px; color: var(--text2); margin-bottom: 6px;
}
.hero-readiness-rec {
  font-size: 12px; color: var(--text3); line-height: 1.4;
}
.hero-readiness-cta {
  flex-shrink: 0;
}
.hero-readiness-cta .btn {
  white-space: nowrap;
}
.readiness-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.readiness-ring svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}
.readiness-ring-track {
  fill: none;
  stroke-width: 4;
}
.readiness-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.readiness-ring-score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}
.readiness-block {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.readiness-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.readiness-level {
  font-size: 13px;
  font-weight: 600;
}
.readiness-hint {
  font-size: 11px;
  color: var(--text3);
}
/* ── Action Now Card ── */
.action-now-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--transition);
}
.action-now-card:hover { border-color: var(--accent); }
.action-now-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.action-now-text { flex: 1; font-size: 13px; font-weight: 500; }
.action-now-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
/* ── Confetti ── */
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120px) rotate(360deg); opacity: 0; }
}
.confetti-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; overflow: hidden;
}
.confetti-piece {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  animation: confetti-fall 1.8s ease-out forwards;
}
/* ── Success Pulse ── */
@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(152, 195, 121, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(152, 195, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(152, 195, 121, 0); }
}
.success-pulse { animation: success-pulse 0.6s ease-out; }
/* ── Streak milestone glow ── */
@keyframes milestone-glow {
  0% { box-shadow: 0 0 0 0 rgba(229, 192, 123, 0.6); }
  50% { box-shadow: 0 0 16px 4px rgba(229, 192, 123, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(229, 192, 123, 0); }
}
.streak-milestone {
  border-color: var(--yellow) !important;
  background: var(--yellow-dim) !important;
  animation: milestone-glow 1.5s ease-out;
}
.streak-milestone .streak-item-icon { color: var(--yellow) !important; }
.streak-milestone .streak-item-value { color: var(--yellow) !important; }
.streak-milestone-badge {
  font-size: 10px; font-weight: 600; color: var(--yellow);
  background: var(--yellow-dim); padding: 1px 6px;
  border-radius: 8px; margin-top: 4px;
}

/* ── Readiness Popover ── */
.readiness-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: var(--elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 100;
  opacity: 0;
  transform: scale(0.95) translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.readiness-popover.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.readiness-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: var(--elevated);
  border-left: 1px solid var(--border-light);
  border-top: 1px solid var(--border-light);
  transform: rotate(45deg);
}
.readiness-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.readiness-popover-score {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
}
.readiness-popover-info { display: flex; flex-direction: column; gap: 2px; }
.readiness-popover-level { font-size: 14px; font-weight: 600; }
.readiness-popover-hint { font-size: 12px; color: var(--text3); }
.readiness-factor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.readiness-factor-label {
  font-size: 12px;
  color: var(--text2);
  width: 80px;
  flex-shrink: 0;
}
.readiness-factor-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.readiness-factor-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.readiness-factor-val {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text3);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.readiness-modifier {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--orange-dim);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--orange);
}
.readiness-modifier-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--orange);
}
.readiness-modifier-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  float: right;
  margin-top: -16px;
}
.readiness-modifier-note {
  font-size: 10px;
  color: var(--text3);
  margin-top: 3px;
  line-height: 1.3;
}
.readiness-recommendation {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}
.readiness-recommendation strong { color: var(--text); }
.readiness-popover-time {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text3);
  text-align: right;
}

/* Daily Brief */
.daily-brief {
  background: linear-gradient(135deg, rgba(91, 184, 169, 0.06) 0%, rgba(91, 184, 169, 0.02) 100%);
  border-left: 3px solid var(--teal, #5bb8a9);
  border-radius: var(--radius, 8px);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.daily-brief-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text3);
}
.daily-brief-header .brief-title {
  font-weight: 600;
  color: var(--text2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.daily-brief-header .brief-time {
  margin-left: auto;
  font-size: 11px;
}
.daily-brief-greeting {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
}
.daily-brief-readiness {
  font-size: 13px;
  color: var(--text2);
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.4;
}
.daily-brief-priorities {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.daily-brief-priority {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.daily-brief-priority .priority-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(82, 139, 255, 0.12));
  color: var(--accent, #528bff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.daily-brief-observation {
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.daily-brief-observation.positive {
  border-left: 3px solid var(--green);
  background: var(--green-dim, rgba(152, 195, 121, 0.12));
  color: var(--green);
}
.daily-brief-observation.warning {
  border-left: 3px solid var(--yellow);
  background: var(--yellow-dim, rgba(229, 192, 123, 0.12));
  color: var(--yellow);
}
.daily-brief-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  font-size: 13px;
  color: var(--text3);
}
.daily-brief-loading .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal, #5bb8a9);
  animation: briefPulse 1.2s ease-in-out infinite;
}
@keyframes briefPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
.daily-brief-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text3);
}
.daily-brief-placeholder .btn {
  margin-left: auto;
  font-size: 12px;
}
@media (max-width: 600px) {
  .daily-brief { padding: 12px 14px; }
  .daily-brief-priority .priority-num { width: 20px; height: 20px; font-size: 10px; }
}

/* Attention block */
.attention-block {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--transition);
}
.attention-item:hover { background: var(--hover); }
.attention-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.attention-text { flex: 1; font-size: 13px; }
.attention-action {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.attention-action:hover { background: var(--accent-dim); border-color: var(--accent); }

/* Welcome-back card */
.welcome-back-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeSlideIn 0.3s ease;
}
.welcome-back-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 8px;
}
.welcome-back-body {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.5;
}
.welcome-back-actions {
  display: flex;
  gap: 10px;
}

/* Inline checkin */
.inline-checkin-wrap {
  margin-bottom: 20px;
  animation: fadeSlideIn 0.3s ease;
}
.inline-checkin-card {
  border: 1px solid var(--border);
  padding: 20px;
}
.inline-checkin-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.inline-checkin-header .btn-icon {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.inline-checkin-header .btn-icon:hover {
  background: var(--hover);
  color: var(--text);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Timeline */
.timeline-section {
  margin-bottom: 20px;
}
.timeline-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 12px;
}
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  opacity: 0;
  animation: timelineSlideIn 0.3s ease forwards;
}
.timeline-item:hover { background: var(--hover); }
@keyframes timelineSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.timeline-dot {
  position: absolute;
  left: -23px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-light);
  border: 2px solid var(--bg);
  z-index: 1;
  flex-shrink: 0;
}
.timeline-item.status-done .timeline-dot { background: var(--green); }
.timeline-item.status-current .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(91, 184, 169, 0.5);
}
.timeline-item.status-missed .timeline-dot { background: var(--red); opacity: 0.6; }
.timeline-item.status-planned .timeline-dot { background: var(--border-light); }

.timeline-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  min-width: 40px;
  flex-shrink: 0;
}
.timeline-icon {
  display: flex;
  align-items: center;
  color: var(--text3);
  flex-shrink: 0;
}
.timeline-item.status-done .timeline-icon { color: var(--green); }
.timeline-item.status-current .timeline-icon { color: var(--accent); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-meta {
  font-size: 11px;
  color: var(--text3);
}
.timeline-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.timeline-badge.done { background: var(--green-dim); color: var(--green); }
.timeline-badge.current { background: var(--accent-dim); color: var(--accent); }
.timeline-badge.missed { background: var(--red-dim); color: var(--red); }
.timeline-item.status-current { background: var(--accent-dim); }
.timeline-item.status-done { opacity: 0.7; }
.timeline-item.status-done .timeline-title { text-decoration: line-through; text-decoration-color: var(--text3); }

/* Insights block */
.insights-block {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.insight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.insight-item.positive { border-left-color: var(--green); }
.insight-item.warning { border-left-color: var(--yellow); }
.insight-item.neutral { border-left-color: var(--blue); }
.insight-icon { display: flex; align-items: center; flex-shrink: 0; }
.insight-item.positive .insight-icon { color: var(--green); }
.insight-item.warning .insight-icon { color: var(--yellow); }
.insight-item.neutral .insight-icon { color: var(--blue); }

/* Week progress */
.week-progress {
  margin-bottom: 20px;
}
.week-progress-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 12px;
}
.week-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.week-progress-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.week-progress-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.week-progress-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.week-progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.week-progress-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s ease;
}

/* Dashboard skeleton loading */
.dashboard-skeleton { display: flex; flex-direction: column; gap: 16px; }
.skeleton-header {
  height: 52px;
  background: var(--surface);
  border-radius: var(--radius);
  animation: skeletonPulse 1.5s ease infinite;
}
.skeleton-timeline {
  height: 200px;
  background: var(--surface);
  border-radius: var(--radius);
  animation: skeletonPulse 1.5s ease infinite;
  animation-delay: 0.1s;
}
.skeleton-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.skeleton-metric {
  height: 120px;
  background: var(--surface);
  border-radius: var(--radius);
  animation: skeletonPulse 1.5s ease infinite;
}
.skeleton-metric:nth-child(2) { animation-delay: 0.1s; }
.skeleton-metric:nth-child(3) { animation-delay: 0.2s; }
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.meal-slot.current { border-left: 3px solid var(--accent); background: var(--accent-dim); }
.meal-slot-now { font-size: 11px; font-weight: 600; color: var(--accent); margin-left: 8px; }
.meal-slot-next { font-size: 11px; color: var(--text3); margin-left: 8px; }

.checkin-time-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--yellow-dim);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--yellow);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 16px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .sidebar-group-label { opacity: 0; height: 24px; padding: 16px 0 6px; }

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  width: 100%;
  text-align: left;
}
.sidebar-btn .btn-icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.sidebar-btn .btn-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .sidebar-btn .btn-label { display: none; }
.sidebar.collapsed .sidebar-btn { justify-content: center; padding: 10px 0; }

.sidebar-btn:hover { color: var(--text); background: var(--hover); }
.sidebar-btn.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.sidebar-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-btn .stream-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute; top: 8px; right: 8px;
  animation: stream-pulse 1.5s ease infinite;
}
@keyframes stream-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-footer .sidebar-btn { margin-bottom: 4px; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text3);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}
.sidebar-toggle:hover { color: var(--text2); background: var(--hover); }
.sidebar-toggle .toggle-icon { flex-shrink: 0; transition: transform 0.3s ease; }
.sidebar.collapsed .sidebar-toggle .toggle-icon { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-toggle .toggle-label { display: none; }

/* ── Main ── */
.app-content {
  margin-left: 220px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
}
.sidebar.collapsed ~ .app-content { margin-left: 60px; }
.main { padding: 24px; max-width: 1200px; margin: 0 auto; scroll-behavior: smooth; }

.view { display: none; opacity: 0; transform: translateY(8px); }
.view.active { display: block; animation: viewEnter 0.3s ease forwards; }
@keyframes viewEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Card entrance & hover */
.main .card {
  animation: cardEnter 0.4s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.main .card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); border-color: var(--border-light); }
@keyframes cardEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Staggered card entrance in grids */
.dashboard-grid .card:nth-child(1) { animation-delay: 0s; }
.dashboard-grid .card:nth-child(2) { animation-delay: 0.05s; }
.dashboard-grid .card:nth-child(3) { animation-delay: 0.1s; }
.dashboard-grid .card:nth-child(4) { animation-delay: 0.15s; }
.dashboard-grid .card:nth-child(5) { animation-delay: 0.2s; }
.dashboard-grid .card:nth-child(6) { animation-delay: 0.25s; }

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Buttons ── */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover { background: var(--hover); border-color: var(--border-light); transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }

.btn-success { background: var(--green); border-color: var(--green); color: var(--bg); }
.btn-success:hover { opacity: 0.9; }

.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 12px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Forms ── */
input, textarea, select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

textarea { resize: vertical; min-height: 60px; }

label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 4px;
}

.field { margin-bottom: 16px; }

.field-required label::after { content: ' *'; color: var(--red); }

/* ── Scale input ── */
.scale-input {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.scale-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scale-btn:hover { border-color: var(--accent); color: var(--text); }
.scale-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}

/* ── Multiselect ── */
.multiselect-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ms-option {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.ms-option:hover { border-color: var(--accent); color: var(--text); }
.ms-option.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Onboarding ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.onboarding-container {
  max-width: 640px;
  width: 100%;
  padding: 40px 24px;
}

.onboarding-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition-slow);
}

.progress-step.done { background: var(--green); }
.progress-step.current { background: var(--accent); }

.onboarding-header {
  margin-bottom: 32px;
}

.onboarding-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.onboarding-header p {
  color: var(--text2);
  font-size: 13px;
}

.onboarding-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Welcome screen ── */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  text-align: center;
}

.welcome-screen h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.welcome-screen p {
  color: var(--text2);
  font-size: 15px;
  max-width: 500px;
  margin-bottom: 32px;
}

/* ── Expert Chat ── */
.experts-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 48px);
}

.experts-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.experts-cards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.expert-card {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.expert-card:hover { border-color: var(--border-light); background: var(--hover); }
.expert-card.active { border-color: var(--accent); background: var(--accent-dim); }

.expert-card-icon { color: var(--accent); flex-shrink: 0; display: flex; align-items: center; }
.expert-card-icon svg { width: 18px; height: 18px; }
.expert-card-info { min-width: 0; }
.expert-card-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.expert-card-role { font-size: 10px; color: var(--text3); line-height: 1.2; }

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info h3 { font-size: 14px; font-weight: 600; }
.chat-header-info p { font-size: 11px; color: var(--text3); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
}
.chat-msg.user { white-space: pre-wrap; }
.chat-msg.assistant { white-space: normal; }

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-dim);
  border: 1px solid rgba(91, 184, 169, 0.2);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.chat-msg.assistant h1, .chat-msg.assistant h2, .chat-msg.assistant h3 { margin: 12px 0 6px; }
.chat-msg.assistant h2 { font-size: 15px; color: var(--green); }
.chat-msg.assistant h3 { font-size: 14px; color: var(--cyan); }
.chat-msg.assistant ul, .chat-msg.assistant ol { padding-left: 20px; margin: 6px 0; }
.chat-msg.assistant li { margin: 3px 0; }
.chat-msg.assistant strong { color: var(--yellow); }
.chat-msg.assistant code { background: var(--elevated); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.chat-msg.assistant p { margin: 6px 0; }

/* Tables in chat */
.chat-msg.assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  white-space: normal;
}
.chat-msg.assistant th,
.chat-msg.assistant td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
}
.chat-msg.assistant th {
  background: var(--elevated);
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.chat-msg.assistant tr:hover td {
  background: rgba(91, 184, 169, 0.04);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
}
.typing-indicator .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat status bar */
.chat-status-bar {
  padding: 4px 16px 0;
  font-size: 11px;
  color: var(--text3);
  height: 20px;
  transition: opacity var(--transition);
}
.chat-status-bar:empty { opacity: 0; }
.chat-routing-banner {
  display: flex; align-items: center; padding: 8px 16px;
  background: var(--orange-dim); color: var(--orange);
  font-size: 12px; border-top: 1px solid rgba(209, 154, 102, 0.2);
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input-area textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
}

.chat-history-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.chat-history-title {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 2px 6px;
  flex-shrink: 0;
}

.history-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 12px;
  color: var(--text2);
  position: relative;
  border: 1px solid transparent;
}

.history-item:hover { background: var(--hover); }
.history-item.active { background: var(--accent-dim); border-color: rgba(91, 184, 169, 0.2); }
.history-item.active .history-item-title { color: var(--accent); }

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.history-item-title {
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text3);
}

.history-item-msgs {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text3);
  white-space: nowrap;
}

.history-item-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text3);
  background: var(--surface2);
  border: none;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.history-item-delete:hover { color: var(--red); background: var(--red-dim); }
.history-item:hover .history-item-delete { display: flex; }

.chat-history-empty {
  text-align: center;
  color: var(--text3);
  font-size: 11px;
  padding: 20px 8px;
}

.chat-header-actions { display: flex; gap: 6px; align-items: center; }
.mobile-only { display: none; }
.mobile-chat-history-overlay { display: none; }
.mobile-chat-history-sheet { display: none; }

/* ── Stub views ── */
.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text3);
}

.stub-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.stub-text { font-size: 14px; }

/* ── Check-in ── */
.checkin-container { max-width: 600px; margin: 0 auto; }

.checkin-phase-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 8px;
}

.checkin-phase-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.checkin-phase-desc {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 24px;
}

.star-rating {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.star-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--border-light);
  transition: color var(--transition), transform var(--transition);
}

.star-btn:hover { transform: scale(1.15); }
.star-btn.active { color: var(--yellow); }

.big-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.big-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-btn:hover { border-color: var(--accent); color: var(--text); }
.big-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.activity-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.activity-btn {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.activity-btn:hover { border-color: var(--accent); color: var(--text); }
.activity-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.optional-toggle {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  padding: 4px 0;
  margin-bottom: 6px;
}

.optional-toggle:hover { text-decoration: underline; }

.optional-field { display: none; }
.optional-field.open { display: block; }

.checkin-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-item {
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.summary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 2px;
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.readiness-result {
  text-align: center;
  padding: 24px 0;
}

.readiness-result-score {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.readiness-result-label {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card { padding: 16px; }

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
}

.metric-card-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-card-sub {
  font-size: 11px;
  color: var(--text2);
}

.metric-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }
.metric-delta.stable { color: var(--text3); }

.data-freshness {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}
.data-freshness.stale { color: var(--yellow); }

.show-more-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}
.show-more-btn:hover { background: var(--hover); color: var(--text); }

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  margin-top: 8px;
}

.spark-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height var(--transition-slow);
}

.trend-arrow {
  font-size: 14px;
  font-weight: 700;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-stable { color: var(--text3); }

/* ── Quick Stats ── */
.quick-stats {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 0;
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 16px;
}
.quick-stats:hover { background: var(--hover); }
.quick-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}
.quick-stat-icon { color: var(--text3); flex-shrink: 0; }
.quick-stat-info { display: flex; flex-direction: column; }
.quick-stat-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.quick-stat-value { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.quick-stat-delta { font-size: 11px; margin-left: 4px; }
.quick-stat-sep { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }

/* ── Streaks ── */
.streaks-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.streak-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.streak-item-icon { color: var(--text3); margin-bottom: 6px; }
.streak-item-value { font-size: 24px; font-weight: 800; color: var(--text); font-family: var(--font-mono); }
.streak-item-label { font-size: 11px; color: var(--text3); margin-top: 2px; }
.streak-hot {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.streak-hot .streak-item-icon { color: var(--accent); }
.streak-hot .streak-item-value { color: var(--accent); }

/* ── Tomorrow Preview ── */
.tomorrow-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.tomorrow-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
}
.tomorrow-preview-training {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.tomorrow-preview-notes {
  font-size: 12px;
  color: var(--text2);
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--yellow);
}

@media (max-width: 600px) {
  .quick-stats { flex-direction: column; padding: 10px 0; }
  .quick-stat { padding: 8px 16px; }
  .quick-stat-sep { width: 80%; height: 1px; }
  .streaks-row { flex-direction: column; }
}

.alerts-section { margin-top: 24px; }

.alert-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 12px;
}

.alert-icon { font-size: 16px; }

/* ── Notification banner ── */
.notification-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.notification-banner > * {
  pointer-events: auto;
}
.notification-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  animation: slideInRight 0.3s ease;
}
.notification-card--compact { padding: 10px 12px; }
.notification-card--compact .notif-header { margin-bottom: 0; }
.notification-card.cat-training { border-left-color: var(--blue); }
.notification-card.cat-nutrition { border-left-color: var(--green); }
.notification-card .notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.notification-card .notif-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.notification-card .notif-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 16px;
  transition: color var(--transition);
}
.notification-card .notif-close:hover { color: var(--text); }
.notification-card .notif-message {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
  line-height: 1.4;
}
.notification-card .notif-changes {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0;
  list-style: none;
}
.notification-card .notif-changes li {
  font-size: 11px;
  color: var(--text2);
  padding: 2px 0;
  line-height: 1.4;
}
.notification-card .notif-changes li::before {
  content: '›';
  margin-right: 6px;
  color: var(--text3);
  font-weight: 600;
}
.notification-card.dismissing {
  animation: slideOutRight 0.25s ease forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
@media (max-width: 600px) {
  .notification-banner {
    top: auto;
    bottom: 70px;
    right: 8px;
    left: 8px;
    max-width: none;
  }
}

/* ── New notification categories & priorities ── */
.notification-card.cat-recovery { border-left-color: var(--pink); }
.notification-card.cat-health { border-left-color: var(--red); }
.notification-card.cat-system { border-left-color: var(--accent); }
.notification-card.priority-high { border-left-width: 4px; }
.notification-card.priority-critical { border-left-width: 5px; box-shadow: var(--shadow-lg), 0 0 12px var(--red-dim); }
.notif-impact-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.notif-impact-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px;
}
.notif-impact-badge.impact-cancel { background: var(--red-dim); color: var(--red); }
.notif-impact-badge.impact-modify, .notif-impact-badge.impact-reduce { background: var(--orange-dim); color: var(--orange); }
.notif-impact-badge.impact-adjust { background: var(--yellow-dim); color: var(--yellow); }
.notif-impact-badge.impact-protocol { background: var(--cyan-dim); color: var(--cyan); }
.notif-impact-badge.impact-none { background: var(--green-dim); color: var(--green); }
.notif-action-btn {
  display: inline-block; margin-top: 8px; padding: 4px 12px;
  font-size: 11px; font-weight: 600; border-radius: var(--radius-sm);
  background: var(--accent-dim); color: var(--accent); border: none; cursor: pointer;
  transition: background var(--transition);
}
.notif-action-btn:hover { background: rgba(91, 184, 169, 0.2); }
.notif-undo-btn {
  display: inline-block; margin-top: 8px; margin-left: 6px; padding: 4px 12px;
  font-size: 11px; font-weight: 600; border-radius: var(--radius-sm);
  background: var(--orange-dim); color: var(--orange); border: none; cursor: pointer;
  transition: background var(--transition);
}
.notif-undo-btn:hover { background: rgba(209, 154, 102, 0.25); }
.notif-undo-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Sidebar notification bell ── */
.sidebar-notif-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.sidebar-notif-btn:hover { color: var(--accent); background: var(--hover); }
.sidebar-notif-btn svg { pointer-events: none; }
.notif-badge {
  position: absolute; top: 2px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; pointer-events: none;
}
.notif-badge.mobile { position: absolute; top: -2px; right: -6px; min-width: 16px; height: 16px; font-size: 9px; }

/* ── Notification panel (slide-in) ── */
.notif-panel-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: var(--overlay);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.notif-panel-overlay.open { opacity: 1; pointer-events: auto; }
.notif-panel {
  position: fixed; top: 0; right: -420px; bottom: 0;
  width: 420px; max-width: 100vw;
  z-index: 1101;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transition: right 0.25s ease;
}
.notif-panel.open { right: 0; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600; color: var(--text);
}
.notif-panel-list {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.notif-panel-list .notif-panel-item {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface2); border-left: 3px solid var(--accent);
  transition: background var(--transition);
}
.notif-panel-list .notif-panel-item:hover { background: var(--hover); }
.notif-panel-list .notif-panel-item.unread { background: var(--accent-dim); }
.notif-panel-list .notif-panel-item .npi-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.notif-panel-list .notif-panel-item .npi-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.notif-panel-list .notif-panel-item .npi-time {
  font-size: 10px; color: var(--text3); white-space: nowrap;
}
.notif-panel-list .notif-panel-item .npi-message {
  font-size: 12px; color: var(--text2); line-height: 1.4;
}
.notif-panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; color: var(--text3); font-size: 13px; gap: 8px; padding: 40px;
}

/* ── Reactive banners ── */
.reactive-banner {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.5;
}
.reactive-banner .rb-icon { flex-shrink: 0; margin-top: 2px; }
.reactive-banner .rb-text { flex: 1; }
.reactive-banner .rb-title { font-weight: 600; margin-bottom: 4px; }
.reactive-banner.cancelled { background: var(--red-dim); border: 1px solid rgba(248, 113, 113, 0.2); color: var(--red); }
.reactive-banner.modified { background: var(--orange-dim); border: 1px solid rgba(251, 146, 60, 0.2); color: var(--orange); }

/* ── Meal feedback ── */
.meal-feedback {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 8px;
  font-size: 12px; line-height: 1.4; display: flex; align-items: center; gap: 8px;
  animation: slideInRight 0.3s ease;
}
.meal-feedback.alcohol { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(251, 146, 60, 0.15); }
.meal-feedback.surplus { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251, 191, 36, 0.15); }
.meal-feedback.deficit { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.15); }

/* ── System activity ── */
.trigger-list { display: flex; flex-direction: column; gap: 6px; }
.trigger-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface2); border-radius: var(--radius-sm);
  font-size: 12px;
}
.trigger-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.trigger-dot.severity-critical { background: var(--red); box-shadow: 0 0 6px var(--red); }
.trigger-dot.severity-high { background: var(--orange); }
.trigger-dot.severity-medium { background: var(--yellow); }
.trigger-dot.severity-low { background: var(--text3); }
.trigger-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-weight: 600; }

/* ── Blood work analysis ── */
.bw-analysis-block { margin-top: 12px; padding: 14px; background: var(--surface2); border-radius: var(--radius); }
.bw-analysis-block .bw-analysis-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text2); margin-bottom: 8px; }
.bw-analysis-block .bw-summary { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 10px; }
.bw-alert-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.bw-alert-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.bw-alert-dot.status-low { background: var(--yellow); }
.bw-alert-dot.status-high { background: var(--orange); }
.bw-alert-dot.status-critical { background: var(--red); }
.bw-marker-tag.status-ok { border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.06); }
.bw-marker-tag.status-low, .bw-marker-tag.status-high { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.06); }
.bw-marker-tag.status-critical { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.06); }
.bw-recs { margin-top: 8px; }
.bw-recs li { font-size: 12px; color: var(--text2); padding: 2px 0; line-height: 1.4; }
.bw-recs li::before { content: '•'; margin-right: 6px; color: var(--accent); }

/* ── Assessment view ── */
.assessment-content {
  line-height: 1.7;
}

.assessment-content h2 {
  font-size: 16px;
  color: var(--green);
  margin: 24px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.assessment-content h3 { font-size: 14px; color: var(--cyan); margin: 16px 0 6px; }
.assessment-content ul, .assessment-content ol { padding-left: 20px; margin: 6px 0; }
.assessment-content li { margin: 4px 0; }
.assessment-content strong { color: var(--yellow); }
.assessment-content p { margin: 8px 0; }

/* ── Loading ── */
.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Training ── */
.training-container { max-width: 800px; margin: 0 auto; }

.training-today-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.training-today-icon { font-size: 28px; }

.training-today-title { font-size: 18px; font-weight: 700; }

.training-today-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.workout-exercise {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.workout-exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.workout-exercise-name { font-size: 13px; font-weight: 600; }

.workout-exercise-target { font-size: 11px; color: var(--text3); }

.set-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.set-row-label {
  font-size: 11px;
  color: var(--text3);
  width: 24px;
  flex-shrink: 0;
}

.set-input {
  width: 70px;
  padding: 5px 8px;
  font-size: 12px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
}

.set-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-dim);
  outline: none;
}

.set-input-label {
  font-size: 10px;
  color: var(--text3);
}

.add-set-btn {
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  padding: 2px 0;
}

.add-set-btn:hover { text-decoration: underline; }

.morning-exercise-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.morning-exercise-row:last-child { border-bottom: none; }

.morning-check {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.week-schedule {
  display: flex;
  gap: 6px;
}

.week-day {
  flex: 1;
  text-align: center;
  padding: 8px 4px 6px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
  min-width: 0;
}
.week-day:hover { background: var(--hover); }

.week-day.active { border: 2px solid var(--accent); background: rgba(91, 184, 169, 0.15); padding: 7px 3px 5px; }
.week-day.active .week-day-date { color: var(--accent); font-weight: 700; }
.week-day.active .week-day-name { color: var(--accent); font-weight: 700; }

.week-day.done { border-color: var(--green); background: var(--green-dim); }
.week-day.done .week-day-date { color: var(--green); font-weight: 700; }
.week-day.done .week-day-name { color: var(--green); }

.week-day.missed { border-color: rgba(224, 108, 117, 0.4); background: var(--red-dim); }
.week-day.missed .week-day-date { color: var(--red); }
.week-day.missed .week-day-name { color: var(--text3); }

.week-day.selected { box-shadow: 0 0 0 2px var(--text); }
.week-day.active.selected { box-shadow: 0 0 0 2px var(--text); }

.day-detail-panel {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.day-detail-panel .day-detail-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.day-detail-panel .day-detail-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.day-detail-exercise {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.day-detail-exercise:last-child { border-bottom: none; }
.day-detail-exercise-name { color: var(--text); }
.day-detail-exercise-info { color: var(--text2); font-size: 12px; }
.exercise-action-btn {
  background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px;
  color: var(--text3); transition: color 0.15s, background 0.15s;
}
.exercise-action-btn:hover { color: var(--text); background: var(--hover); }
.exercise-action-btn.danger:hover { color: var(--red); }
.exercise-actions { display: flex; gap: 2px; margin-left: 8px; flex-shrink: 0; }
.exercise-edit-form {
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.exercise-edit-form .edit-row {
  display: flex; gap: 6px; margin-top: 6px; align-items: end;
}
.exercise-edit-form .edit-row .field { margin-bottom: 0; }
.exercise-edit-form .edit-row .field label { font-size: 10px; margin-bottom: 2px; }
.exercise-edit-form .edit-row .field input { font-size: 12px; padding: 4px 6px; }
.exercise-edit-form .edit-btns { display: flex; gap: 6px; margin-top: 8px; }
.add-exercise-btn {
  display: block; width: 100%; margin-top: 8px; padding: 6px;
  background: none; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text3); font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.add-exercise-btn:hover { border-color: var(--accent); color: var(--accent); }
.tomorrow-preview {
  margin-top: 12px; padding: 12px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 3px solid var(--cyan);
}
.tomorrow-header {
  font-size: 13px; font-weight: 600; color: var(--cyan); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.tomorrow-exercise {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; font-size: 12px; color: var(--text2);
}
.tomorrow-exercise-info { color: var(--text3); font-size: 11px; flex-shrink: 0; margin-left: 12px; }

.week-day-date {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 2px;
}

.week-day-name {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 3px;
}

.week-day-type {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 2px;
}

.week-day-status {
  font-size: 13px;
  margin-top: 2px;
}
.week-day-today {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}

.week-date-range {
  color: var(--text3);
  font-size: 13px;
  font-weight: 400;
}

.training-stats {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.training-stat {
  flex: 1;
  padding: 14px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.training-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.training-stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.generate-card {
  text-align: center;
  padding: 40px 20px;
}

.generate-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.generate-card p {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.generate-stream {
  text-align: left;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.feeling-select {
  display: flex;
  gap: 6px;
}

.feeling-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feeling-btn:hover { border-color: var(--accent); }
.feeling-btn.active { background: var(--accent-dim); border-color: var(--accent); }

/* ── Nutrition ── */
.nutrition-container { max-width: 800px; margin: 0 auto; }

.nutrition-top {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.nutrition-targets {
  flex: 1;
}

.nutrition-water-card {
  flex: 0 0 160px;
  text-align: center;
}

.macro-bar-wrap {
  margin-bottom: 12px;
}

.macro-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.macro-bar-label { color: var(--text2); font-weight: 600; }
.macro-bar-value { color: var(--text); }

.macro-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.meal-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.meal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.meal-card-type {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meal-card-macros {
  font-size: 11px;
  color: var(--text2);
}

.meal-card-desc {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.meal-card-items {
  font-size: 11px;
  color: var(--text3);
}

.meal-card-comment {
  font-size: 11px;
  color: var(--cyan);
  margin-top: 6px;
  font-style: italic;
}

/* Meal Schedule */
.meal-schedule { display: flex; flex-direction: column; gap: 10px; }

.meal-slot {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all var(--transition);
}

.meal-slot.done {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(152,195,121,0.06) 0%, var(--surface2) 40%);
}

.meal-slot.custom {
  border-left-color: var(--orange);
  background: linear-gradient(90deg, rgba(209,154,102,0.06) 0%, var(--surface2) 40%);
}

.meal-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.meal-slot-name {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meal-slot-name .done-check {
  color: var(--green);
  display: inline-flex;
}

.meal-slot-time {
  font-size: 10px;
  color: var(--text3);
}

.meal-slot-macros {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 2px;
}

.meal-slot-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.meal-slot-desc.struck {
  text-decoration: line-through;
  color: var(--text3);
  font-size: 12px;
  margin-bottom: 4px;
}

.meal-slot-actual {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.meal-slot-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.meal-slot-actions .btn { font-size: 12px; padding: 5px 14px; }

.btn-plan {
  background: var(--green);
  color: #0f1318;
  border: 1px solid var(--green);
  font-weight: 600;
}
.btn-plan:hover { background: #7fb368; }

.btn-custom {
  background: var(--surface);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-custom:hover { background: var(--hover); color: var(--text); }

.meal-slot-input {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.meal-slot-input textarea {
  flex: 1;
  min-height: 40px;
  max-height: 80px;
  resize: none;
  font-size: 13px;
}

.meal-slot-input .btn { white-space: nowrap; align-self: stretch; }

.meal-slot-logging {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Daily Progress */
.daily-progress {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.daily-progress-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.daily-progress-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.daily-progress.empty .daily-progress-icon { background: var(--surface); color: var(--text3); }
.daily-progress.normal .daily-progress-icon { background: var(--accent-dim); color: var(--accent); }
.daily-progress.norm .daily-progress-icon { background: var(--green-dim); color: var(--green); }
.daily-progress.over .daily-progress-icon { background: var(--red-dim); color: var(--red); }

.daily-progress-status {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.daily-progress-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.daily-progress-pct {
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.daily-progress.empty .daily-progress-pct { color: var(--text3); }
.daily-progress.normal .daily-progress-pct { color: var(--accent); }
.daily-progress.norm .daily-progress-pct { color: var(--green); }
.daily-progress.over .daily-progress-pct { color: var(--red); }

.daily-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.daily-progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.daily-progress.empty .daily-progress-bar-fill { background: var(--text3); }
.daily-progress.normal .daily-progress-bar-fill { background: var(--accent); }
.daily-progress.norm .daily-progress-bar-fill { background: var(--green); }
.daily-progress.over .daily-progress-bar-fill { background: var(--red); }

/* Meal slot preview (non-today days) */
.meal-slot.preview {
  opacity: 0.7;
  border-left-color: var(--border);
}
.meal-slot.preview .meal-slot-actions { display: none; }
.meal-slot.preview .meal-slot-name { color: var(--text2); }

/* Nutrition week schedule overrides */
.nutrition-week-card { margin-bottom: 12px; }
.nutrition-week-card .week-day.active .week-day-progress {
  font-size: 9px;
  color: var(--accent);
  margin-top: 2px;
}

.week-day-progress {
  font-size: 9px;
  color: var(--text3);
  margin-top: 2px;
}

@media (max-width: 600px) {
  .meal-slot-actions { flex-wrap: wrap; }
  .meal-slot-input { flex-direction: column; }
  .daily-progress { flex-direction: column; gap: 8px; padding: 12px; }
  .daily-progress-info { gap: 8px; }
  .daily-progress-pct { font-size: 20px; text-align: left; }
  .daily-progress-sub { font-size: 10px; }
  .nutrition-week-card .week-schedule { gap: 3px; }
  .nutrition-week-card .week-day { padding: 6px 2px 4px; }
  .nutrition-week-card .week-day-date { font-size: 14px; }
}

.water-count {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}

.water-target {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  margin-bottom: 12px;
}

.water-btns {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.water-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--blue);
  font-family: var(--font);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.water-btn:hover { border-color: var(--blue); background: var(--blue-dim); }

.meal-input-area {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.meal-input-area textarea {
  flex: 1;
  min-height: 44px;
  max-height: 100px;
  resize: none;
}

.meal-input-area .btn {
  white-space: nowrap;
  align-self: stretch;
}

.meal-type-select {
  width: 140px;
  flex-shrink: 0;
}

.supplement-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.supplement-row:last-child { border-bottom: none; }

.supplement-name { font-weight: 600; flex: 1; }

.supplement-dose { color: var(--text2); }

.supplement-evidence {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.evidence-strong { background: var(--green-dim); color: var(--green); }
.evidence-moderate { background: var(--yellow-dim); color: var(--yellow); }
.evidence-weak { background: var(--red-dim); color: var(--red); }

.nutrition-logging-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  padding: 6px 0;
}

/* Health & Recovery */
.health-container { max-width: 960px; margin: 0 auto; }
.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .health-grid { grid-template-columns: 1fr; } }

.health-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.health-panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 16px;
}
.health-panel-full { grid-column: 1 / -1; }

.chart-container { width: 100%; overflow: hidden; }
.chart-container svg { width: 100%; display: block; }

.recovery-ring-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.recovery-details { flex: 1; }
.recovery-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.recovery-detail-row:last-child { border-bottom: none; }
.recovery-detail-label { color: var(--text2); }
.recovery-detail-value { font-weight: 600; }

.bw-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) { .bw-form-grid { grid-template-columns: 1fr; } }
.bw-field label {
  display: block;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.bw-field input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}
.bw-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bw-category:first-child { margin-top: 0; }

.bw-result-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.bw-result-date { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.bw-result-markers { display: flex; flex-wrap: wrap; gap: 8px; }
.bw-marker-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.symptom-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.symptom-entry:last-child { border-bottom: none; }
.symptom-intensity {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.symptom-form {
  display: grid;
  grid-template-columns: 1fr 80px 100px;
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 600px) { .symptom-form { grid-template-columns: 1fr; } }
.symptom-form input, .symptom-form select {
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}

.health-stat-row {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin-top: 12px;
}
.health-stat {
  text-align: center;
}
.health-stat-value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text); }
.health-stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; }


.bw-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface2);
}
.bw-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.bw-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.01);
}
.bw-dropzone-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.7; }
.bw-dropzone-text { font-size: 13px; color: var(--text2); }
.bw-dropzone-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.bw-dropzone-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.bw-dropzone-preview img {
  max-height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.bw-dropzone-preview .file-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.bw-upload-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}
.bw-upload-row input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}
.bw-upload-progress {
  padding: 20px;
  text-align: center;
  color: var(--text2);
  font-size: 13px;
}
.bw-upload-progress .spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bw-spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes bw-spin { to { transform: rotate(360deg); } }
.bw-parsed-result {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--green-dim);
}
.bw-parsed-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 12px;
}
.bw-manual-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  user-select: none;
}
.bw-manual-toggle:hover { color: var(--text2); }
.bw-manual-toggle::before, .bw-manual-toggle::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.bw-source-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.bw-source-badge.upload { background: var(--cyan-dim); color: var(--cyan); }
.bw-source-badge.manual { background: var(--yellow-dim); color: var(--yellow); }
.bw-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bw-result-notes {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
}
.bw-marker-unit {
  font-size: 10px;
  color: var(--text3);
  margin-left: 2px;
}

/* Insights */
.insights-container { max-width: 960px; margin: 0 auto; }

.alert-card-full {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.alert-card-full.alert-critical { border-left: 3px solid var(--red); }
.alert-card-full.alert-warning { border-left: 3px solid var(--yellow); }
.alert-card-full.alert-info { border-left: 3px solid var(--blue); }
.alert-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.alert-badge-critical { background: var(--red-dim); color: var(--red); }
.alert-badge-warning { background: var(--yellow-dim); color: var(--yellow); }
.alert-badge-info { background: var(--blue-dim); color: var(--blue); }

.insight-stream {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.correlation-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.correlation-strength {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.correlation-pair { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.correlation-text { font-size: 12px; color: var(--text2); }

.digest-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.digest-tab {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.digest-tab:hover { background: var(--hover); }
.digest-tab.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin: 24px 0 12px;
}
.section-title:first-child { margin-top: 0; }

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .analytics-grid { grid-template-columns: 1fr; } }
.analytics-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.analytics-panel-full { grid-column: 1 / -1; }
.analytics-panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 12px;
}

/* Periodic Cards */
.periodic-card-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.periodic-card-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, var(--surface2) 100%);
  border: 1px solid var(--border-light);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.periodic-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}
.pc-field { margin-bottom: 16px; }
.pc-field label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}
.pc-field input[type="text"], .pc-field textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}
.pc-field textarea { min-height: 60px; resize: vertical; }
.pc-scale {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.pc-scale-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  transition: var(--transition);
}
.pc-scale-btn:hover { background: var(--hover); }
.pc-scale-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.pc-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.pc-choice-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  transition: var(--transition);
}
.pc-choice-btn:hover { background: var(--hover); }
.pc-choice-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Loading states */
.loading-skeleton, .skeleton-card, .skeleton-line, .skeleton-circle {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--hover) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.loading-skeleton { border-radius: var(--radius); }
.skeleton-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-circle {
  border-radius: 50%;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Profile tab ── */
.sidebar-divider { height: 1px; background: var(--border); margin: 6px 12px; }
.sidebar.collapsed .sidebar-divider { margin: 6px 8px; }
.profile-header {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; margin-bottom: 20px; text-align: center;
}
.profile-header-name { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.profile-header-meta { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.profile-header-goal { font-size: 13px; color: var(--accent); font-weight: 500; }
.profile-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.profile-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.profile-section-title h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.profile-section-title button {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 12px; padding: 4px 10px; border-radius: var(--radius-sm);
}
.profile-section-title button:hover { background: var(--accent-dim); }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.profile-field-label { font-size: 12px; color: var(--text3); margin-bottom: 2px; }
.profile-field-value { font-size: 14px; color: var(--text); }
.profile-field-value input, .profile-field-value textarea, .profile-field-value select {
  width: 100%; padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit;
}
.profile-field-value input:focus, .profile-field-value textarea:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-dim); outline: none;
}
.profile-field-value textarea { resize: vertical; min-height: 60px; }
.profile-edit-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.profile-edit-actions button {
  padding: 6px 16px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-size: 13px; font-family: inherit;
}
.profile-edit-actions .btn-save { background: var(--accent); color: #fff; }
.profile-edit-actions .btn-save:hover { background: var(--accent2); }
.profile-edit-actions .btn-cancel { background: var(--hover); color: var(--text2); }
.profile-edit-actions .btn-cancel:hover { background: var(--border); }
.profile-notes { margin-bottom: 16px; }
.profile-note-item {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px; position: relative;
}
.profile-note-date { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.profile-note-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.profile-note-del {
  position: absolute; top: 8px; right: 8px; background: none; border: none;
  color: var(--text3); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px;
  border-radius: var(--radius-sm); opacity: 0; transition: opacity var(--transition);
}
.profile-note-item:hover .profile-note-del { opacity: 1; }
.profile-note-del:hover { color: var(--red); background: var(--red-dim); }
.profile-note-form { display: flex; gap: 8px; align-items: flex-start; }
.profile-note-form textarea {
  flex: 1; padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 44px;
}
.profile-note-form textarea:focus {
  border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-dim); outline: none;
}
.profile-note-form button {
  padding: 8px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.profile-note-form button:hover { background: var(--accent2); }
@media (max-width: 600px) {
  .profile-fields { grid-template-columns: 1fr; }
  .profile-header { padding: 20px; }
}

/* ── Mobile Nav ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(15, 19, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 0 env(safe-area-inset-bottom);
  z-index: 200;
  justify-content: space-around;
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--text3);
  font-family: var(--font);
  font-size: 10px;
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  transition: color var(--transition);
  flex: 1;
}
.mobile-nav-btn:hover { color: var(--text2); }
.mobile-nav-btn.active { color: var(--accent); }
.mobile-nav-btn .nav-icon { width: 22px; height: 22px; }

.mobile-more-sheet {
  display: none;
  position: fixed;
  bottom: 64px;
  left: 8px; right: 8px;
  background: var(--elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 201;
}
.mobile-more-sheet.open { display: block; }
.mobile-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius);
  width: 100%;
  transition: background var(--transition);
}
.mobile-more-item:hover { background: var(--hover); }
.mobile-more-item.active { color: var(--accent); }

/* Glass fallback */
@supports not (backdrop-filter: blur(1px)) {
  .sidebar { background: var(--surface); }
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .sidebar-group-label { opacity: 0; height: 24px; padding: 16px 0 6px; }
  .sidebar .sidebar-btn .btn-label { display: none; }
  .sidebar .sidebar-btn { justify-content: center; padding: 10px 0; }
  .sidebar .sidebar-logo .logo-text { display: none; }
  .sidebar .sidebar-header { justify-content: center; padding: 20px 0 12px; }
  .sidebar .sidebar-notif-btn { display: none; }
  .sidebar .sidebar-time { justify-content: center; padding: 0 0 12px; }
  .sidebar .sidebar-time .time-date { display: none; }
  .sidebar .sidebar-toggle .toggle-label { display: none; }
  .app-content { margin-left: 60px; }
  .main { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-readiness { gap: 14px; padding: 16px 18px; }
  .hero-readiness-ring { width: 60px; height: 60px; }
  .hero-readiness-ring svg { width: 60px; height: 60px; }
  .hero-readiness-score { font-size: 19px; }
  .week-progress-grid { grid-template-columns: 1fr 1fr; }
  .skeleton-metrics { grid-template-columns: 1fr 1fr; }
  .week-schedule { gap: 4px; }
  .week-day { min-width: 36px; padding: 6px 4px; font-size: 11px; }
  .training-exercises { gap: 12px; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .app-content { margin-left: 0 !important; }
  .mobile-nav { display: flex; }
  .main { padding: 12px; padding-bottom: 80px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .dashboard-header { padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .dashboard-header-left .header-greeting { font-size: 14px; }
  .dashboard-header-left .header-day { font-size: 12px; }
  .hero-readiness { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .hero-readiness-ring { width: 56px; height: 56px; }
  .hero-readiness-ring svg { width: 56px; height: 56px; }
  .hero-readiness-score { font-size: 18px; }
  .hero-readiness-cta { width: 100%; }
  .hero-readiness-cta .btn { width: 100%; }
  .action-now-card { gap: 10px; padding: 12px 14px; }
  .readiness-ring { width: 38px; height: 38px; }
  .readiness-ring svg { width: 38px; height: 38px; }
  .readiness-ring-score { font-size: 13px; }
  .readiness-hint { display: none; }
  .readiness-popover { width: 280px; right: -8px; }
  .timeline { padding-left: 24px; }
  .timeline-item { padding: 6px 8px; gap: 6px; flex-wrap: wrap; }
  .timeline-title { font-size: 12px; white-space: normal; }
  .timeline-badge { font-size: 10px; padding: 1px 6px; }
  .timeline-content { min-width: 0; flex: 1; }
  .timeline-icon { display: none; }
  .week-progress-grid { grid-template-columns: 1fr; }
  .skeleton-metrics { grid-template-columns: 1fr; }
  .attention-item { padding: 8px 12px; }
  .insight-item { font-size: 12px; padding: 10px 12px; }
  .checkin-form { padding: 16px; }
  .digest-tabs { flex-wrap: wrap; }
  .digest-tab { font-size: 12px; padding: 6px 10px; }
  .set-row { flex-wrap: wrap; }
  .nutrition-macros { flex-direction: column; }
  .periodic-card-modal > div { margin: 10px; padding: 20px; max-height: 90vh; border-radius: var(--radius-lg); }
  .notif-panel { width: 100vw; right: -100vw; }
  .notif-panel.open { right: 0; }

  /* ── Experts mobile ── */
  .experts-layout {
    flex-direction: column;
    height: calc(100vh - 48px - 64px); /* minus header and bottom nav */
    gap: 0;
  }
  .experts-sidebar {
    width: 100%;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0;
  }
  .experts-cards {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .experts-cards::-webkit-scrollbar { display: none; }
  .expert-card {
    flex-shrink: 0;
    padding: 6px 10px;
    min-width: 0;
  }
  .expert-card-role { display: none; }
  .expert-card-name { font-size: 12px; }
  .expert-card-icon svg { width: 16px; height: 16px; }

  .experts-sidebar > .btn { display: none; }
  .chat-history-panel { display: none; }

  .chat-area {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .chat-header { padding: 8px 12px; }
  .chat-header-info h3 { font-size: 13px; }
  .chat-messages { padding: 10px; gap: 8px; }
  .chat-msg { max-width: 92%; padding: 8px 12px; font-size: 12px; }
  .chat-input-area { padding: 8px 10px; gap: 6px; }
  .chat-input-area textarea { min-height: 36px; font-size: 13px; }
  .chat-input-area .btn { padding: 6px 10px; font-size: 12px; }
  .chat-status-bar { padding: 2px 10px 0; font-size: 10px; height: 16px; }

  /* Mobile chat history overlay */
  .mobile-chat-history-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.6);
  }
  .mobile-chat-history-overlay.open { display: block; }
  .mobile-chat-history-overlay.open .mobile-chat-history-sheet {
    display: flex;
  }
  .mobile-chat-history-sheet {
    display: none;
    position: fixed;
    bottom: 64px;
    left: 0; right: 0;
    max-height: 60vh;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 12px;
    overflow-y: auto;
    z-index: 251;
    flex-direction: column;
    gap: 4px;
  }
  .mobile-chat-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .mobile-chat-history-header span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }
  .chat-header-actions { display: flex; gap: 6px; align-items: center; }
  .mobile-only { display: inline-flex !important; }
}

/* ── Guide ── */
.guide-container { max-width: 800px; margin: 0 auto; }
.guide-intro {
  margin-bottom: 32px;
  padding: 28px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.guide-intro-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.guide-intro-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.guide-intro-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.guide-intro-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}
.guide-intro-desc {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 20px;
}
.guide-intro-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.guide-pillar {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  text-align: center;
}
.guide-pillar-icon {
  color: var(--teal, #5bb8a9);
  margin-bottom: 8px;
}
.guide-pillar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.guide-pillar-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}
.guide-intro-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.guide-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  padding: 4px 0;
}
.guide-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal, #5bb8a9);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .guide-intro-pillars { grid-template-columns: 1fr; }
  .guide-intro-features { grid-template-columns: 1fr; }
}
.guide-section {
  border-bottom: 1px solid var(--border);
}
.guide-section:last-child { border-bottom: none; }
.guide-header {
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
  border-radius: var(--radius);
}
.guide-header:hover { background: var(--hover); }
.guide-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.guide-header-icon { font-size: 20px; }
.guide-header-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.guide-chevron {
  font-size: 12px;
  color: var(--text3);
  transition: transform 0.2s ease;
}
.guide-section.open .guide-chevron { transform: rotate(180deg); }
.guide-body {
  padding: 0 20px 20px 52px;
  display: none;
  color: var(--text2);
  line-height: 1.8;
  font-size: 14px;
}
.guide-section.open .guide-body { display: block; }
.guide-body h4 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
}
.guide-body h4:first-child { margin-top: 0; }
.guide-body ul, .guide-body ol {
  padding-left: 20px;
  margin: 8px 0;
}
.guide-body li { margin: 4px 0; }
.guide-body code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.guide-body strong { color: var(--accent); }
.guide-body .guide-tip {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 12px 0;
  font-size: 13px;
}
.guide-body .guide-kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

/* ── Action Result Cards ── */
.action-result-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-top: 8px;
  font-size: 13px;
}
.action-result-card.success {
  background: var(--green-dim);
  border-left: 3px solid var(--green);
}
.action-result-card.error {
  background: var(--red-dim);
  border-left: 3px solid var(--red);
}
.action-icon { font-size: 14px; flex-shrink: 0; line-height: 1; display: inline-flex; align-items: center; }
.action-title { font-weight: 600; font-size: 13px; }
.action-detail { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ── Apple Watch Badge ── */
.apple-watch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-dim);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.apple-watch-settings {
  max-width: 700px;
  margin: 0 auto;
}
.apple-watch-settings .card { margin-bottom: 16px; }
.aw-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.aw-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.aw-status-dot.connected { background: var(--green); }
.aw-status-dot.disconnected { background: var(--text3); }
.aw-instruction-step {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.aw-instruction-step:last-child { border-bottom: none; }
.aw-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.aw-code {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
  margin-top: 8px;
}

/* ── Goal Modal ── */
.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.goal-modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, var(--surface2) 100%);
  border: 1px solid var(--border-light);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 480px;
  width: 90%;
}
.goal-modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border-left: 3px solid var(--text3);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  max-width: 380px;
  animation: toastIn 0.25s ease;
  cursor: pointer;
}
.toast.toast-error   { border-left-color: var(--red); }
.toast.toast-success { border-left-color: var(--green); }
.toast.toast-warning { border-left-color: var(--yellow); }
.toast.toast-info    { border-left-color: var(--accent); }
.toast.removing { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }
/* ── Neural Pulse + Process Tray ── */
@keyframes adaptPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 184, 169, 0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(91, 184, 169, 0); }
}
@keyframes neuralSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes neuralDotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.2); }
}
.neural-pulse-wrap { position: relative; }
.neural-pulse {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 8px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  height: 28px;
  overflow: hidden;
  transition: background var(--transition);
}
.neural-pulse:hover { background: var(--hover); }
.neural-pulse.active { display: flex; }
.neural-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(91, 184, 169, 0.1), transparent);
  animation: neuralSweep 2.5s ease-in-out infinite;
  pointer-events: none;
}
.neural-pulse.done::before {
  background: linear-gradient(90deg, transparent, rgba(152, 195, 121, 0.12), transparent);
}
.neural-pulse-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.neural-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: neuralDotPulse 1.8s ease-in-out infinite;
}
.neural-dot:nth-child(2) { animation-delay: 0.3s; }
.neural-dot:nth-child(3) { animation-delay: 0.6s; }
.neural-dot:nth-child(4) { animation-delay: 0.9s; }
.neural-dot:nth-child(5) { animation-delay: 1.2s; }
.neural-dot[data-domain="reactive"]    { background: var(--accent); }
.neural-dot[data-domain="training"]    { background: var(--blue); }
.neural-dot[data-domain="nutrition"]   { background: var(--orange); }
.neural-dot[data-domain="blood_work"]  { background: var(--red); }
.neural-dot[data-domain="daily_brief"] { background: var(--yellow); }
.neural-dot.done { background: var(--green) !important; animation: none; }
.neural-pulse-ico {
  display: flex;
  align-items: center;
  color: var(--accent);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  animation: neuralDotPulse 1.8s ease-in-out infinite;
}
.neural-pulse.done .neural-pulse-ico { color: var(--green); animation: none; }
.neural-pulse-text {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
  flex: 1;
}
.neural-pulse.done .neural-pulse-text { color: var(--green); }
.neural-pulse-chevron {
  display: flex;
  align-items: center;
  color: var(--text3);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.process-tray.open ~ .neural-pulse .neural-pulse-chevron,
.neural-pulse-chevron.open { transform: rotate(180deg); }
.sidebar.collapsed .neural-pulse { margin: 0 4px 4px; padding: 6px; justify-content: center; }
.sidebar.collapsed .neural-pulse-text { display: none; }
.sidebar.collapsed .neural-pulse-chevron { display: none; }

/* Process Tray */
.process-tray {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 8px; right: 8px;
  background: var(--elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 300;
  max-height: 260px;
  overflow-y: auto;
}
.process-tray.open { display: block; }
.process-tray-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.process-tray-item + .process-tray-item { margin-top: 2px; border-top: 1px solid var(--border); padding-top: 10px; }
.process-tray-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.process-tray-icon.running { animation: adaptPulse 1.8s ease-in-out infinite; }
.process-tray-icon.done { background: var(--green-dim); color: var(--green); }
.process-tray-info { flex: 1; min-width: 0; }
.process-tray-title { font-size: 12px; font-weight: 500; color: var(--text); }
.process-tray-desc { font-size: 11px; color: var(--text3); line-height: 1.3; }
.process-tray-time { font-size: 10px; color: var(--text3); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* Mobile AI Strip */
.mobile-ai-strip {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 199;
  height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(15, 19, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}
.mobile-ai-strip.active { display: flex; }
.mobile-ai-strip::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(91, 184, 169, 0.5), transparent);
  animation: neuralSweep 2.5s ease-in-out infinite;
}
.mobile-ai-strip.done::after {
  background: linear-gradient(90deg, transparent, rgba(152, 195, 121, 0.5), transparent);
}
.mobile-ai-strip .neural-pulse-dots { position: relative; z-index: 1; }
.mobile-ai-strip .neural-pulse-text { position: relative; z-index: 1; }
body.ai-active .main { padding-top: 44px; }
.mobile-process-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--overlay);
  z-index: 9998;
}
.mobile-process-overlay.open { display: block; }
.mobile-process-sheet {
  display: none;
  position: fixed;
  top: 32px; left: 0; right: 0;
  background: var(--elevated);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 9999;
  max-height: 50vh;
  overflow-y: auto;
  animation: mobileSheetSlide 0.2s ease;
}
.mobile-process-sheet.open { display: block; }
@keyframes mobileSheetSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .neural-pulse { display: none !important; }
  .process-tray { display: none !important; }
}
@media (min-width: 601px) {
  .mobile-ai-strip { display: none !important; }
  .mobile-process-sheet { display: none !important; }
  .mobile-process-overlay { display: none !important; }
  body.ai-active .main { padding-top: 0; }
}

/* ── Confirm dialog ── */
.confirm-overlay {
  position: fixed; inset: 0; background: var(--overlay); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.confirm-dialog {
  background: var(--surface2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 24px; max-width: 360px; width: 90%;
}
.confirm-dialog p { margin: 0 0 20px; font-size: 14px; color: var(--text); }
.confirm-dialog .confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-dialog .btn-cancel { background: var(--hover); color: var(--text2); border: none; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.confirm-dialog .btn-confirm { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,108,117,0.2); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500; }
.confirm-dialog .btn-cancel:hover { background: var(--elevated); }
.confirm-dialog .btn-confirm:hover { background: rgba(224,108,117,0.2); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Login Screen ── */
.login-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 30% 30%, rgba(91, 184, 169, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(107, 163, 199, 0.04) 0%, transparent 60%);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.3s ease;
}
.hidden { display: none !important; }
.login-overlay.hidden { display: flex !important; opacity: 0; pointer-events: none; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px 36px;
  width: 340px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { margin-bottom: 8px; animation: loginLogoSpin 12s linear infinite; }
@keyframes loginLogoSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.login-title { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: 0.05em; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text3); margin-bottom: 28px; }
.demo-login-hint {
  margin: -12px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 184, 169, 0.25);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}
.login-field { margin-bottom: 14px; text-align: left; }
.login-field label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 5px; font-weight: 500; }
.login-field input {
  width: 100%; padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-field input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-dim); outline: none; }
.login-btn {
  width: 100%; padding: 11px; margin-top: 8px;
  background: var(--accent); color: #0f1318; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: background var(--transition), transform 0.1s;
}
.login-btn:hover { background: var(--accent2); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error {
  color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px;
}

/* ── Admin ── */
.admin-section { margin-bottom: 24px; }
.admin-section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color var(--transition);
}
.admin-user-card.pending { border-left: 3px solid var(--yellow); }
.admin-user-card.rejected { border-left: 3px solid var(--red); opacity: 0.7; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.admin-user-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.admin-user-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-sm { font-size: 12px; padding: 4px 12px; }
.btn-success { background: var(--green); color: var(--bg); }
.btn-success:hover { background: #7ab366; }
.btn-danger { background: var(--red); color: var(--bg); }
.btn-danger:hover { background: #c95f67; }
.badge-muted { background: var(--surface2); color: var(--text3); font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.badge-accent { background: var(--accent-dim); color: var(--accent); font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.badge-red { background: var(--red-dim); color: var(--red); font-size: 11px; padding: 1px 6px; border-radius: 4px; }

.login-toggle { margin-top: 16px; font-size: 12px; color: var(--text3); }
.login-toggle a { color: var(--accent); text-decoration: none; }
.login-toggle a:hover { text-decoration: underline; }
.demo-mode-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 184, 169, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(91, 184, 169, 0.08);
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
}
.demo-mode-banner strong { color: var(--accent); font-weight: 600; }
.demo-mode-banner-icon {
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.pending-icon { margin-bottom: 12px; }
.pending-title { font-size: 18px; font-weight: 600; color: var(--yellow); margin-bottom: 8px; }
.pending-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── Sidebar user ── */
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin: 0 8px 4px;
  border-radius: var(--radius-sm);
  color: var(--text2); font-size: 12px;
  white-space: nowrap; overflow: hidden;
}
.sidebar-user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout {
  background: none; border: none; color: var(--text3); cursor: pointer;
  padding: 4px; border-radius: 4px; display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--red); background: var(--red-dim); }
.sidebar.collapsed .sidebar-user-name { display: none; }
.app-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  transition: opacity 0.3s ease;
}
.app-loader.fade-out { opacity: 0; pointer-events: none; }
.app-loader svg { animation: loaderPulse 1.5s ease-in-out infinite; }
@keyframes loaderPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
