:root {
  /* Brand colors */
  --color-sense-50: #eef5ff;
  --color-sense-100: #d9e8ff;
  --color-sense-200: #bcd8ff;
  --color-sense-300: #8ec1ff;
  --color-sense-400: #599fff;
  --color-sense-500: #337cfc;
  --color-sense-600: #1d5cf1;
  --color-sense-700: #1547de;
  --color-sense-800: #173ab4;
  --color-sense-900: #19358e;
  --color-sense-950: #142256;

  /* Dark mode backgrounds */
  --color-dark-900: #0a0e1a;
  --color-dark-800: #0f1629;
  --color-dark-700: #151d38;
  --color-dark-600: #1b2547;
  --color-dark-500: #232f58;
  --color-dark-400: #2d3b6a;

  /* Glassmorphism */
  --color-glass-white: rgba(255, 255, 255, 0.04);
  --color-glass-border: rgba(255, 255, 255, 0.07);
  --color-glass-hover: rgba(255, 255, 255, 0.09);

  /* Mapping to Eon tokens */
  --bg-primary: var(--color-dark-900);
  --bg-secondary: var(--color-dark-800);
  --bg-tertiary: var(--color-dark-700);
  --accent: #599fff; /* sense-400 */
  --accent-dim: rgba(51, 124, 252, 0.1);
  --accent-glow: rgba(51, 124, 252, 0.3);
  --text-primary: #e2e8f0; /* slate-200 */
  --text-secondary: #94a3b8; /* slate-400 */
  --text-muted: #64748b; /* slate-500 */
  --border: var(--color-glass-border);
  --success: #10b981; /* emerald-500 */
  --warning: #f59e0b; /* amber-500 */
  --danger: #ef4444; /* red-500 */

  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
  --font-display: 'Orbitron', var(--font-sans);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  position: relative;
}

/* 🌌 Hardware-Accelerated Gaseous Aurora Background */
.aurora-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(120px);
  will-change: transform;
}

.aurora-1 {
  top: -20%;
  left: -20%;
  width: 70vw;
  height: 70vw;
  opacity: 0.25;
  background: radial-gradient(circle, rgba(51, 124, 252, 0.25) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 100%);
  animation: aurora-1 25s ease-in-out infinite alternate;
}

.aurora-2 {
  top: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  opacity: 0.20;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(99, 102, 241, 0.12) 50%, transparent 100%);
  animation: aurora-2 30s ease-in-out infinite alternate;
}

.aurora-3 {
  bottom: -20%;
  right: 10%;
  width: 70vw;
  height: 70vw;
  opacity: 0.15;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(20, 184, 166, 0.08) 50%, transparent 100%);
  animation: aurora-3 28s ease-in-out infinite alternate;
}

.aurora-4 {
  top: 30%;
  left: -30%;
  width: 60vw;
  height: 60vw;
  opacity: 0.15;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.15) 0%, rgba(217, 70, 239, 0.05) 50%, transparent 100%);
  animation: aurora-4 35s ease-in-out infinite alternate;
}

.aurora-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.15);
  backdrop-filter: brightness(0.95);
  -webkit-backdrop-filter: brightness(0.95);
  z-index: 1;
}

/* Aurora Animations */
@keyframes aurora-1 {
  0%, 100% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(12%, 18%) scale(1.15); }
  66% { transform: translate(-12%, -12%) scale(0.85); }
}

@keyframes aurora-2 {
  0%, 100% { transform: translate(0px, 0px) scale(1.1); }
  33% { transform: translate(-18%, -12%) scale(0.85); }
  66% { transform: translate(14%, 18%) scale(1.08); }
}

@keyframes aurora-3 {
  0%, 100% { transform: translate(0px, 0px) scale(0.85); }
  33% { transform: translate(10%, -15%) scale(1.08); }
  66% { transform: translate(-15%, 12%) scale(1.15); }
}

@keyframes aurora-4 {
  0%, 100% { transform: translate(0px, 0px) scale(1); }
  50% { transform: translate(-12%, 10%) scale(1.2); }
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: rgba(15, 22, 41, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 20;
  transition: all 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 2.5rem;
  cursor: pointer;
  user-select: none;
}

.logo i {
  font-size: 1.5rem;
  text-shadow: 0 0 15px rgba(51, 124, 252, 0.5);
}

.logo-by {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
}

.logo-by span {
  font-weight: 800;
  color: #fff;
}

.logo-by span span {
  color: var(--color-sense-400);
  background: linear-gradient(to right, var(--color-sense-400), #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-dot {
  color: var(--color-sense-500) !important;
  font-weight: 900 !important;
}

.nav-item, .nav-item-link {
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-item:hover, .nav-item-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--color-sense-300);
  border-color: rgba(51, 124, 252, 0.25);
  box-shadow: 0 4px 12px rgba(51, 124, 252, 0.05);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.conn-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse-conn 2.5s ease-in-out infinite;
}

.conn-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-conn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 10;
  /* Background grid pattern */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Chat View */
#chatView {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-disclaimer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(245, 158, 11, 0.06);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  padding: 0.75rem 2.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  animation: fadeIn 0.35s ease;
  z-index: 10;
}

.chat-disclaimer i {
  color: var(--warning);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.chat-disclaimer a {
  color: var(--warning);
  text-decoration: underline;
  margin-left: 0.25rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.chat-disclaimer a:hover {
  opacity: 0.8;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scroll-behavior: smooth;
}

.message {
  max-width: 75%;
  padding: 1.2rem;
  border-radius: 14px;
  line-height: 1.6;
  position: relative;
  font-size: 0.95rem;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.message.ai {
  align-self: flex-start;
  background: rgba(51, 124, 252, 0.05);
  border: 1px solid rgba(51, 124, 252, 0.14);
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 15px rgba(51, 124, 252, 0.04);
}

.message-header {
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.9;
}

.message.user .message-header {
  color: var(--text-secondary);
}

.input-area {
  padding: 1.5rem 2.5rem;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
  background: rgba(15, 22, 41, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  display: flex;
  gap: 0.7rem;
  transition: all 0.25s ease;
}

.input-wrapper:focus-within {
  border-color: var(--color-sense-500);
  box-shadow: 0 0 15px rgba(51, 124, 252, 0.15);
  background: rgba(15, 22, 41, 0.7);
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: none;
  outline: none;
  max-height: 150px;
  min-height: 24px;
  line-height: 1.5;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.send-btn {
  background: linear-gradient(135deg, var(--color-sense-600) 0%, var(--color-sense-700) 100%);
  color: #fff;
  border: 1px solid rgba(51, 124, 252, 0.3);
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(51, 124, 252, 0.15);
}

.send-btn:hover {
  box-shadow: 0 0 20px rgba(51, 124, 252, 0.35);
  transform: translateY(-1px);
  border-color: rgba(51, 124, 252, 0.5);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 2.5rem;
  animation: fadeIn 0.25s ease;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(51, 124, 252, 0.05);
  border: 1px solid rgba(51, 124, 252, 0.14);
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  padding: 0.65rem 0.9rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-sense-400);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

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

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

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

/* Scroll to Bottom Button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 110px;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 22, 41, 0.9);
  border: 1px solid var(--border);
  color: var(--color-sense-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  z-index: 15;
  animation: fadeIn 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.scroll-to-bottom-btn:hover {
  background: var(--accent-dim);
  border-color: var(--color-sense-400);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(51, 124, 252, 0.2);
}

/* Character Counter */
.char-counter {
  text-align: right;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 0.25rem 2.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.char-counter.visible {
  opacity: 1;
}

.char-counter.warn {
  color: var(--warning);
}

.char-counter.danger {
  color: var(--danger);
}

/* Message Timestamps */
.message-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: block;
  opacity: 0.6;
  font-family: var(--font-mono);
}

/* Dream View */
#dreamView {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #060810;
  z-index: 10;
  display: none;
}

.dream-overlay {
  position: absolute;
  top: 2.5rem;
  left: 2.5rem;
  padding: 1.5rem;
  background: rgba(10, 14, 26, 0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  pointer-events: none;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.dream-overlay h3 {
  font-family: var(--font-display);
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

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

.dream-controls {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  pointer-events: auto;
}

.dream-btn {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  border-radius: 8px;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.dream-btn:hover,
.dream-btn.active {
  background: var(--color-sense-600);
  border-color: var(--color-sense-500);
  color: #fff;
  box-shadow: 0 0 15px rgba(51, 124, 252, 0.3);
}

/* Status & Config, Ecosystem, Genesis, and Help Views */
#statusView, #ecosystemView, #genesisView, #helpView {
  padding: 3rem;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.35s ease;
}

.panel {
  background: rgba(15, 22, 41, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-glass-border);
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 2rem;
  max-width: 800px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.panel:hover {
  background: rgba(15, 22, 41, 0.55);
  border-color: rgba(51, 124, 252, 0.25);
  box-shadow: 0 8px 32px rgba(51, 124, 252, 0.08);
  transform: translateY(-2px);
}

.panel-header {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header i {
  color: var(--color-sense-400);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.25s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(51, 124, 252, 0.2);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.stat-value {
  font-size: 1.35rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.stat-value.highlight {
  color: var(--success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.stat-value.text-accent {
  color: var(--accent);
}

/* Forms & Select Dropdowns */
select {
  width: 100%;
  padding: 0.65rem;
  background: rgba(10, 14, 26, 0.8) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

select:focus {
  border-color: var(--color-sense-500) !important;
  box-shadow: 0 0 10px rgba(51, 124, 252, 0.15);
}

/* Premium Custom Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
  height: 6px;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  height: 6px;
  transition: background 0.2s;
}

input[type="range"]:hover::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.15);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px; /* Centers the thumb on the track */
  background: var(--color-sense-500);
  border-radius: 50%;
  height: 16px;
  width: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 0 8px rgba(51, 124, 252, 0.4);
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--color-sense-400);
  transform: scale(1.15);
}

small {
  color: var(--text-muted);
  font-size: 0.72rem;
  display: block;
  margin-top: 0.4rem;
}

/* Feedback Buttons Container */
.message-feedback {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.message-feedback:hover {
  opacity: 1;
}

.feedback-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.feedback-btn:hover {
  background: rgba(51, 124, 252, 0.1);
  border-color: var(--color-sense-500);
  color: #fff;
  transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utilities */
.hidden {
  display: none !important;
}
.text-accent {
  color: var(--accent);
}
.text-success {
  color: var(--success);
}
.text-muted {
  color: var(--text-muted);
}

/* App Footer */
.app-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: var(--color-sense-400);
}

/* Scrollbar styles matching the brand */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-dark-900);
}

::-webkit-scrollbar-thumb {
  background: var(--color-dark-600);
  border-radius: 6px;
  border: 2px solid var(--color-dark-900);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-sense-600);
}

/* ==========================================================================
   SciSenselab Ecosystem & Genesis Styles
   ========================================================================== */

/* Platform Directory Grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.platform-card {
  background: var(--color-glass-white);
  border: 1px solid var(--color-glass-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.platform-card:hover {
  background: var(--color-glass-hover);
  border-color: var(--color-sense-400);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(51, 124, 252, 0.15);
}

.platform-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-sense-400), var(--color-sense-600));
  opacity: 0;
  transition: opacity 0.3s;
}

.platform-card:hover::before {
  opacity: 1;
}

.platform-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(89, 159, 255, 0.1);
  color: var(--color-sense-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.platform-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.platform-subdomain {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-sense-400);
}

.platform-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* User & Tenant Switcher */
.user-sync-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .user-sync-panel {
    grid-template-columns: 1fr;
  }
}

.tenant-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tenant-option {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tenant-option:hover {
  background: var(--color-glass-white);
  border-color: var(--color-sense-300);
}

.tenant-option.active {
  background: rgba(89, 159, 255, 0.08);
  border-color: var(--color-sense-400);
}

.tenant-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.tenant-badge.admin {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tenant-badge.pro {
  background: rgba(51, 124, 252, 0.15);
  color: #60a5fa;
}

.tenant-badge.sandbox {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Timeline Component */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 1.5rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-dark-800);
  border: 2px solid var(--color-dark-600);
  transition: all 0.3s;
}

.timeline-item.completed::before {
  background: var(--color-sense-500);
  border-color: var(--color-sense-300);
  box-shadow: 0 0 8px var(--accent);
}

.timeline-item:hover::before {
  transform: scale(1.3);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.timeline-item.completed .timeline-badge {
  background: rgba(89, 159, 255, 0.15);
  color: var(--color-sense-300);
}

.timeline-content {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Component Breakdown Cards */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.component-card {
  background: var(--color-glass-white);
  border: 1px solid var(--color-glass-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.component-icon-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.component-icon-title i {
  color: var(--color-sense-400);
  font-size: 1.1rem;
}

.component-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.component-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-sense-400);
}

.component-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.component-tech {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Info Grid */
.info-section {
  margin-bottom: 1.5rem;
}

.info-question {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-question i {
  color: var(--color-sense-400);
}

.info-answer {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 1.25rem;
}

/* User & Profile SSO Styles */
.user-card-sidebar {
  margin-top: auto;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

.user-card-sidebar:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(51, 124, 252, 0.2);
}

.user-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(51, 124, 252, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.9rem;
}

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

.user-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-plan {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-icon-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.quick-login-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.01) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  color: var(--text-primary) !important;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.quick-login-btn:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--color-sense-400) !important;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(51, 124, 252, 0.05);
}

.quick-login-email {
  color: var(--text-primary);
  font-weight: 500;
}

#ssoLoginForm input {
  transition: all 0.25s ease;
}

#ssoLoginForm input:focus {
  border-color: var(--color-sense-400) !important;
  box-shadow: 0 0 10px rgba(51, 124, 252, 0.15);
  background: rgba(10, 14, 26, 0.8) !important;
}

#profileView {
  padding: 3rem;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.35s ease;
  -webkit-overflow-scrolling: touch;
}

.profile-user-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.profile-actions {
  display: flex;
  gap: 1rem;
}

.sidebar-close-btn {
  display: none;
}

/* ==========================================================================
   Mobile Responsive Layout & Headers
   ========================================================================== */

.mobile-header {
  display: none;
  height: 60px;
  background: rgba(15, 22, 41, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 21;
}

.mobile-menu-btn, .mobile-profile-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.mobile-menu-btn:hover, .mobile-profile-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-profile-btn {
  position: relative;
}

.mobile-profile-btn .active-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  background-color: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 8px var(--success);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 22;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Tablet & Mobile Media Queries */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  /* Transform sidebar into a slide-out drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 30;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(10, 14, 26, 0.95);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }

  .logo {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-bottom: 2rem;
  }

  .logo-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .sidebar-close-btn {
    display: flex;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .sidebar-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
  }

  .main-content {
    width: 100%;
    flex: 1;
    min-height: 0;
  }

  /* Compress views padding */
  #statusView, #ecosystemView, #genesisView, #helpView, #profileView {
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
  }

  /* Chat modifications for mobile */
  .chat-disclaimer {
    padding: 0.75rem 1.2rem;
  }

  .chat-container {
    padding: 1.2rem;
    gap: 1.2rem;
    -webkit-overflow-scrolling: touch;
  }

  .message {
    max-width: 90%;
    padding: 1rem;
    font-size: 0.9rem;
  }

  .input-area {
    padding: 1rem 1.2rem;
    gap: 0.75rem;
  }

  .input-wrapper {
    padding: 0.6rem 0.8rem;
  }

  .send-btn {
    padding: 0.6rem 1.1rem;
  }

  /* SSO & config forms stacked */
  .user-sync-panel {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .config-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }

  #ssoLoginScreen {
    margin: 1.5rem auto !important;
    padding: 1.25rem;
  }

  #ssoProfileScreen .panel {
    padding: 1.25rem;
  }

  /* Grid layouts collapse to single column */
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .platform-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .component-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .typing-indicator {
    padding: 0.4rem 1.2rem;
  }

  .scroll-to-bottom-btn {
    bottom: 130px;
    right: 1rem;
  }

  .char-counter {
    padding: 0.2rem 1.2rem;
  }

  /* Responsive range inputs */
  input[type="range"] {
    height: 10px;
  }
  input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    margin-top: -5px;
  }
}

@media (max-width: 480px) {
  .profile-user-card {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .profile-user-card div {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .profile-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
}
