/* ==========================================================================
   APEX PROTOCOL: DESIGN SYSTEM & STYLESHEET
   Aesthetics: Sleek Obsidian Dark Mode, Glassmorphism, Neon Accents, 60fps Micro-interactions
   ========================================================================== */

:root {
  --bg-darkest: #06080c;
  --bg-base: #0a0d14;
  --bg-surface: #111622;
  --bg-surface-elevated: #161d2d;
  --bg-glass: rgba(17, 24, 38, 0.72);
  --bg-glass-card: rgba(20, 28, 44, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(0, 240, 144, 0.35);
  --border-cyan: rgba(0, 200, 255, 0.35);

  --accent-emerald: #00f090;
  --accent-emerald-glow: rgba(0, 240, 144, 0.25);
  --accent-cyan: #00c8ff;
  --accent-cyan-glow: rgba(0, 200, 255, 0.25);
  --accent-red: #ff4757;
  --accent-red-glow: rgba(255, 71, 87, 0.25);
  --accent-amber: #ffa502;
  --accent-purple: #8b5cf6;
  --accent-gold: #ffd000;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #050811;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
  --shadow-neon-emerald: 0 0 25px rgba(0, 240, 144, 0.3);
  --shadow-neon-cyan: 0 0 25px rgba(0, 200, 255, 0.3);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background: var(--bg-darkest);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 144, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(0, 200, 255, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-emerald);
}

/* ==========================================================================
   TYPOGRAPHY & CORE HELPERS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-emerald);
}

.highlight-neon { color: var(--accent-emerald); }
.highlight-cyan { color: var(--accent-cyan); }
.highlight-red { color: var(--accent-red); }
.highlight-amber { color: var(--accent-amber); }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #00f090 0%, #00c8ff 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(0, 240, 144, 0.35);
  font-weight: 700;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 240, 144, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald-glow);
}

.btn-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.btn-chip.active {
  background: rgba(0, 240, 144, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.2);
}

/* ==========================================================================
   GLASS CARDS & CONTAINERS
   ========================================================================== */
.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.card-title {
  font-size: 1.25rem;
  margin-top: 0.15rem;
}

.card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent-emerald);
  text-transform: uppercase;
  font-weight: 700;
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */
.badge-accent, .badge-cyan, .badge-emerald, .badge-streak, .badge-neon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.04em;
}

.badge-accent {
  background: rgba(0, 240, 144, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 240, 144, 0.3);
}

.badge-cyan {
  background: rgba(0, 200, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 200, 255, 0.3);
}

.badge-emerald {
  background: rgba(0, 240, 144, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 240, 144, 0.3);
}

.badge-streak {
  background: rgba(255, 165, 2, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 165, 2, 0.3);
}

.badge-neon {
  background: rgba(0, 240, 144, 0.15);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
  box-shadow: 0 0 10px rgba(0, 240, 144, 0.25);
}

/* ==========================================================================
   GLOBAL HEADER & HUD
   ========================================================================== */
.global-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 12px rgba(0, 240, 144, 0.4));
}
.logo-icon {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(0, 200, 255, 0.15);
  color: var(--accent-cyan);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 200, 255, 0.3);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Telemetry HUD */
.telemetry-hud {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hud-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  min-width: 110px;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.hud-val .unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.hud-streak .flame-icon {
  display: inline-block;
  animation: flameFlicker 1.5s infinite alternate;
}

@keyframes flameFlicker {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.18); filter: brightness(1.3) drop-shadow(0 0 6px #ff9f43); }
}

.hud-level {
  min-width: 140px;
}

.tier-badge {
  color: var(--accent-gold);
  font-weight: 700;
}

.xp-bar-container {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  margin: 3px 0;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.hud-sub-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
}

.hud-controls {
  display: flex;
  gap: 0.4rem;
}

/* ==========================================================================
   NAVIGATION PILLS
   ========================================================================== */
.main-nav {
  background: rgba(10, 13, 20, 0.65);
  border-top: 1px solid var(--border-subtle);
  padding: 0.4rem 1.5rem;
}

.nav-scroll-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-scroll-container::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.nav-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-pill.active {
  background: rgba(0, 240, 144, 0.12);
  border-color: rgba(0, 240, 144, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(0, 240, 144, 0.18);
}

/* ==========================================================================
   APP VIEWPORT
   ========================================================================== */
.app-viewport {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.view-panel {
  display: none;
  animation: fadeInView 0.3s ease forwards;
}

.view-panel.active {
  display: block;
}

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

/* ==========================================================================
   VIEW 1: MISSION CONTROL (DASHBOARD)
   ========================================================================== */
.mission-hero {
  background: linear-gradient(135deg, rgba(16, 24, 40, 0.85) 0%, rgba(10, 15, 28, 0.85) 100%);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-emerald);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

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

.hero-title {
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-desc {
  max-width: 700px;
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.hero-countdown-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  text-align: right;
  min-width: 260px;
}

.hero-countdown-box .box-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.hero-countdown-box .box-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
}

/* Dashboard Grid Cards */
.dash-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Calorie Ring Gauge */
.calories-gauge-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.circular-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.circular-progress {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: url(#brand-grad);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.ring-center-stat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.center-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.center-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.macro-mini-breakdown {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.macro-bar-row .row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.progress-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.fill-cyan { background: var(--accent-cyan); box-shadow: 0 0 8px rgba(0, 200, 255, 0.4); }
.fill-emerald { background: var(--accent-emerald); box-shadow: 0 0 8px rgba(0, 240, 144, 0.4); }
.fill-amber { background: var(--accent-amber); box-shadow: 0 0 8px rgba(255, 165, 2, 0.4); }
.fill-gradient { background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan)); }

/* 3-Win Metric Stack */
.win-card-sub {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.win-items-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.win-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.win-checkbox-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.win-checkbox-card input[type="checkbox"] {
  display: none;
}

.custom-chk {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition-fast);
}

.win-checkbox-card input[type="checkbox"]:checked + .custom-chk {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(0, 240, 144, 0.5);
}

.win-checkbox-card input[type="checkbox"]:checked + .custom-chk::after {
  content: '✓';
  color: var(--text-inverse);
  font-weight: 800;
  font-size: 0.75rem;
}

.win-checkbox-card.checked {
  background: rgba(0, 240, 144, 0.08);
  border-color: rgba(0, 240, 144, 0.3);
}

.win-info strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.win-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Hydration Tank */
.water-tank-layout {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.water-tank-graphic {
  position: relative;
  width: 90px;
  height: 140px;
  flex-shrink: 0;
}

.tank-outline {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(0, 200, 255, 0.4);
  border-radius: 12px;
  background: rgba(0, 200, 255, 0.04);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 200, 255, 0.1);
}

.tank-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.6) 0%, rgba(0, 150, 255, 0.8) 100%);
  border-top: 2px solid #00f0ff;
  transition: height 0.6s ease;
  box-shadow: 0 -2px 10px rgba(0, 200, 255, 0.4);
}

.tank-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tank-number {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.tank-unit {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-mono);
  display: block;
}

.water-actions {
  flex: 1;
}

.tank-desc {
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.water-quick-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Alert Boxes */
.alert-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.alert-cyber {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.alert-icon {
  font-size: 1.8rem;
  color: var(--accent-purple);
}

.alert-content {
  flex: 1;
  min-width: 260px;
}

.alert-content h4 {
  font-size: 0.95rem;
  color: #c4b5fd;
  margin-bottom: 0.25rem;
}

.alert-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Circadian Timeline */
.circadian-timeline-horizontal {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
}

.timeline-slot {
  flex: 0 0 220px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  position: relative;
  transition: all var(--transition-fast);
}

.timeline-slot:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan);
}

.timeline-slot.current {
  border-color: var(--accent-emerald);
  background: rgba(0, 240, 144, 0.06);
}

.slot-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.slot-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.slot-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 2: WORKOUT STUDIO (7-DAY SPLIT)
   ========================================================================== */
.split-day-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.split-day-nav::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 1;
  min-width: 130px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.day-tab:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.day-tab.active {
  background: rgba(0, 240, 144, 0.1);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(0, 240, 144, 0.2);
}

.day-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.day-tab.active .day-num {
  color: var(--accent-emerald);
}

.day-split {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.workout-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.split-info {
  flex: 1;
  min-width: 280px;
}

.split-tags {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tag-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Floating Rest Timer Widget */
.rest-timer-widget {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
}

.rest-timer-ring {
  position: relative;
  width: 70px;
  height: 70px;
}

.rest-timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.timer-progress {
  fill: none;
  stroke: var(--accent-emerald);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-digits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#timer-seconds-display {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.timer-sub {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.rest-quick-controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Exercise Cards */
.exercises-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.exercise-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-fast);
}

.exercise-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.ex-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ex-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(0, 240, 144, 0.15);
  color: var(--accent-emerald);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 240, 144, 0.3);
}

.ex-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.ex-target {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.ex-meta-specs {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  align-items: center;
}

/* Set Logging Table */
.set-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.set-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.set-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.set-row {
  transition: background var(--transition-fast);
}

.set-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.set-row.completed {
  background: rgba(0, 240, 144, 0.06);
}

.set-input-num {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  width: 75px;
  text-align: center;
}

.set-input-num:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(0, 240, 144, 0.3);
}

.btn-set-chk {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.btn-set-chk:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.btn-set-chk.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: var(--text-inverse);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.5);
  font-weight: 900;
}

/* Cardio & Finisher Card */
.cardio-finisher-card {
  border-left: 4px solid var(--accent-cyan);
}

.cardio-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   VIEW 3: FUEL & NUTRITION HUB
   ========================================================================== */
.nutrition-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.deficit-calc-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.calc-pillar {
  text-align: center;
}

.pillar-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.pillar-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.pillar-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.calc-math-sign {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 700;
}

.macros-summary-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.macro-badge-box {
  flex: 1;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-protein { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.dot-carbs { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.dot-fats { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

.macro-badge-box strong {
  display: block;
  font-size: 0.95rem;
}
.macro-badge-box span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Portion Guide Grid */
.portion-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.portion-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.portion-card:hover {
  border-color: var(--accent-emerald);
}

.portion-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.portion-card h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

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

/* Meal Plan Viewer */
.meal-plan-day-buttons {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.meal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.meal-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meal-type-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.meal-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.meal-ingredients {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.meal-macros-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
}

/* Supplements */
.supplement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.supp-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  position: relative;
}

.supp-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-emerald);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.supp-card h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.supp-dose {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

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

/* ==========================================================================
   VIEW 4: CIRCADIAN HABIT MATRIX
   ========================================================================== */
.habit-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.score-ring-wrap {
  text-align: right;
}

#habit-score-pct {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-emerald);
  display: block;
}

.score-ring-wrap .sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.habit-checklist-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.habit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.habit-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.habit-row.completed {
  background: rgba(0, 240, 144, 0.06);
  border-color: rgba(0, 240, 144, 0.3);
}

.habit-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.habit-icon {
  font-size: 1.4rem;
}

.habit-details strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.habit-details span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.habit-xp-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
}

/* Badges Grid */
.level-progress-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.level-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.xp-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.badge-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.badge-item.unlocked {
  border-color: rgba(255, 208, 0, 0.4);
  background: rgba(255, 208, 0, 0.05);
}

.badge-item.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.badge-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.badge-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 5: TELEMETRY & TRENDS (ANALYTICS)
   ========================================================================== */
.chart-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-ideal { background: var(--accent-emerald); }
.dot-actual { background: var(--accent-cyan); }
.dot-rolling { background: var(--accent-purple); }

.chart-desc {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.canvas-chart-wrap {
  width: 100%;
  height: 340px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.canvas-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.log-weight-strip {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.input-with-label label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
}

.input-sm {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  width: 120px;
}

.telemetry-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.milestone-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.milestone-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-marker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.milestone-step.active .step-marker {
  background: rgba(0, 240, 144, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.3);
}

.step-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.step-info p {
  font-size: 0.8rem;
}

/* Before / After Simulation */
.simulation-slider-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.sim-view-card {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sim-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

.sim-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.sim-stat {
  font-size: 0.82rem;
}
.sim-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-emerald);
}

.sim-body-graphic {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.silhouette-box {
  width: 90px;
  height: 100px;
  background: rgba(0, 240, 144, 0.08);
  border: 2px dashed rgba(0, 240, 144, 0.4);
  border-radius: 40px / 50px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.silhouette-core {
  width: 70%;
  height: 70%;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: 35px / 45px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.custom-slider {
  width: 100%;
  accent-color: var(--accent-emerald);
  height: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ==========================================================================
   VIEW 6: AEGIS AI COACH TERMINAL
   ========================================================================== */
.aegis-container {
  display: flex;
  flex-direction: column;
  min-height: 650px;
  border: 1px solid rgba(0, 240, 144, 0.3);
  box-shadow: 0 0 30px rgba(0, 240, 144, 0.08);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ai-status-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 15px var(--accent-emerald);
  animation: pulseDot 1.5s infinite;
}

.ai-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ai-version {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(0, 240, 144, 0.15);
  color: var(--accent-emerald);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.ai-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.coaching-chips-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.chips-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chip-prompt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-prompt:hover {
  background: rgba(0, 240, 144, 0.12);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.terminal-chat-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-right: 0.5rem;
  max-height: 440px;
}

.chat-msg {
  display: flex;
  gap: 1rem;
  max-width: 85%;
}

.chat-msg.coach {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-msg.coach .msg-avatar {
  background: rgba(0, 240, 144, 0.15);
  border-color: rgba(0, 240, 144, 0.4);
}

.msg-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.chat-msg.coach .msg-bubble {
  background: rgba(18, 26, 42, 0.75);
  border-color: rgba(0, 240, 144, 0.2);
}

.chat-msg.user .msg-bubble {
  background: rgba(0, 200, 255, 0.12);
  border-color: rgba(0, 200, 255, 0.3);
}

.msg-sender {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 0.35rem;
}

.chat-msg.user .msg-sender {
  color: var(--accent-cyan);
}

.msg-text p {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.msg-text p:last-child { margin-bottom: 0; }

.msg-text ul, .msg-text ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.msg-text li { margin-bottom: 0.3rem; }

.msg-time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: right;
}

.terminal-input-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.terminal-input-bar input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.terminal-input-bar input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.3);
}

/* ==========================================================================
   VIEW 7: MASTER BLUEPRINT VIEWER
   ========================================================================== */
.blueprint-quick-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.doc-nav-link:hover {
  background: rgba(0, 240, 144, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.blueprint-doc-content {
  line-height: 1.8;
  color: var(--text-secondary);
}

.blueprint-doc-content h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.blueprint-doc-content h3 {
  font-size: 1.2rem;
  color: var(--accent-cyan);
  margin: 1.5rem 0 0.75rem;
}

.blueprint-doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.85rem;
}

.blueprint-doc-content th {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.blueprint-doc-content td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle);
}

.blueprint-doc-content pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  color: #e2e8f0;
}

/* ==========================================================================
   MODAL & TOASTS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-box {
  max-width: 550px;
  width: 100%;
}

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

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.btn-close:hover { color: #fff; }

.swap-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.swap-card-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swap-card-btn:hover {
  background: rgba(0, 240, 144, 0.1);
  border-color: var(--accent-emerald);
}

.swap-card-btn strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.swap-card-btn span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-emerald);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-neon-emerald);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideToast 0.3s ease forwards;
}

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

/* Global Footer */
.global-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 8, 12, 0.9);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .telemetry-hud { width: 100%; justify-content: space-between; }
  .mission-hero { flex-direction: column; text-align: left; }
  .hero-countdown-box { width: 100%; text-align: left; }
  .chat-msg { max-width: 95%; }
}
