/* ═══════════════════════════════════════════════
   TutuAI 2.0 - Full Platform Design System
   Dark Futuristic Electronics Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-card: rgba(15, 15, 30, 0.7);
  --card-bg: rgba(15, 15, 30, 0.7);
  --bg-glass: rgba(15, 15, 30, 0.5);
  --bg-input: rgba(255, 255, 255, 0.04);
  --neon-cyan: #00f0ff;
  --neon-green: #00ff88;
  --neon-purple: #a855f7;
  --neon-blue: #3b82f6;
  --neon-orange: #f97316;
  --neon-pink: #ec4899;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --border-color: rgba(0, 240, 255, 0.12);
  --border-glow: rgba(0, 240, 255, 0.3);
  --shadow-neon: 0 0 20px rgba(0, 240, 255, 0.15);
  --shadow-neon-strong: 0 0 40px rgba(0, 240, 255, 0.25);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
}

/* ═══════ LIGHT THEME ═══════ */
body.light-theme {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.92);
  --card-bg: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-input: rgba(0, 0, 0, 0.06);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
  --border-color: rgba(0, 150, 180, 0.18);
  --border-glow: rgba(0, 150, 180, 0.35);
  --shadow-neon: 0 0 20px rgba(0, 150, 180, 0.12);
  --shadow-neon-strong: 0 0 40px rgba(0, 150, 180, 0.2);
}
body.light-theme .sidebar { background: rgba(230, 238, 248, 0.97); }
body.light-theme .main-content { background: var(--bg-primary); }
body.light-theme .page { background: transparent; }
body.light-theme .nav-item:hover { background: rgba(0, 150, 180, 0.08); }
body.light-theme .nav-item.active { background: rgba(0, 150, 180, 0.12); }
body.light-theme .card { background: var(--bg-card); border-color: var(--border-color); }
body.light-theme .chat-wrapper { background: var(--bg-card); }
body.light-theme .chat-input-area { background: rgba(230, 238, 248, 0.95); border-color: var(--border-color); }
body.light-theme #chatInput { background: var(--bg-input); color: var(--text-primary); }
body.light-theme .user-message .message-content { background: rgba(0, 150, 180, 0.12); }
body.light-theme .bot-message .message-content { background: rgba(255, 255, 255, 0.95); border-color: var(--border-color); }
body.light-theme .scanlines { opacity: 0.01; }
body.light-theme .circuit-bg { opacity: 0.06; }
body.light-theme .page-canvas { opacity: 0.15; }
body.light-theme .bottom-nav { background: rgba(230, 238, 248, 0.97); border-color: var(--border-color); }
body.light-theme .tool-content, body.light-theme .tool-result { background: var(--bg-card); }
body.light-theme input, body.light-theme select, body.light-theme textarea { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-color); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ═══════ SCROLLBAR ═══════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, 0.4); }

/* ═══════ CIRCUIT BACKGROUND ═══════ */
.circuit-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.circuit-svg { width: 100%; height: 100%; opacity: 0.18; }
.trace { fill: none; stroke: var(--neon-cyan); stroke-width: 1.5; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: traceDraw 8s ease-in-out infinite; }
.trace-1 { animation-delay: 0s; } .trace-2 { animation-delay: 1.2s; }
.trace-3 { animation-delay: 2.4s; } .trace-4 { animation-delay: 3.6s; }
@keyframes traceDraw { 0% { stroke-dashoffset: 1200; opacity: 0.3; } 50% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -1200; opacity: 0.3; } }
.node { fill: var(--neon-cyan); animation: nodePulse 3s ease-in-out infinite; }
@keyframes nodePulse { 0%, 100% { opacity: 0.3; r: 3; } 50% { opacity: 1; r: 5; } }
.component { fill: none; stroke: var(--neon-green); stroke-width: 1; animation: nodePulse 4s ease-in-out infinite; }
.particles { position: absolute; inset: 0; }
.particle { position: absolute; width: 2px; height: 2px; background: var(--neon-cyan); border-radius: 50%; animation: particleFloat linear infinite; opacity: 0; }
@keyframes particleFloat { 0% { transform: translateY(100vh) scale(0); opacity: 0; } 10% { opacity: 0.6; } 90% { opacity: 0.6; } 100% { transform: translateY(-10vh) scale(1); opacity: 0; } }

/* ═══════ SIDEBAR ═══════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .btn-login span { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .btn-login { justify-content: center; padding: 10px; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  min-height: 60px;
}
.sidebar-logo {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}
.sidebar-logo-img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
  transition: filter var(--transition);
}
.sidebar-logo:hover .sidebar-logo-img {
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.7));
}
.brand-icon { font-size: 1.5rem; flex-shrink: 0; }
.brand-text {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  white-space: nowrap;
}
.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; margin-left: auto;
  display: flex; align-items: center;
  transition: var(--transition);
}
.sidebar-toggle:hover { color: var(--neon-cyan); }

.sidebar-nav {
  flex: 1; padding: 8px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--text-secondary); text-decoration: none;
  transition: var(--transition); white-space: nowrap;
  font-size: 0.88rem; font-weight: 500;
}
.nav-item:hover { color: var(--text-primary); background: rgba(0, 240, 255, 0.06); }
.nav-item.active {
  color: var(--neon-cyan); background: rgba(0, 240, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--neon-cyan);
}
.nav-item svg { flex-shrink: 0; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-color); }
.btn-login {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(0, 240, 255, 0.06); border: 1px solid rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan); cursor: pointer; font-family: inherit;
  font-size: 0.85rem; font-weight: 500; transition: var(--transition);
}
.btn-login:hover { background: rgba(0, 240, 255, 0.12); }

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
  transition: margin-left var(--transition);
  padding-bottom: 20px;
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ═══════ PAGES ═══════ */
.page {
  display: none;
  padding: 24px 28px;
  max-width: 1200px;
  margin: 0 auto;
  animation: pageIn 0.3s ease-out;
}
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-header { margin-bottom: 28px; }
.page-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 6px;
}
.title-accent {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle { color: var(--text-secondary); font-size: 0.92rem; }
.greeting { display: block; font-size: 0.9rem; font-weight: 400; color: var(--text-secondary); font-family: 'Inter', sans-serif; }
.highlight { color: var(--neon-cyan); text-shadow: 0 0 20px rgba(0, 240, 255, 0.4); }

/* ═══════ HOME: QUICK GRID ═══════ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: var(--transition);
}
.action-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-neon);
  transform: translateY(-3px);
}
.action-icon {
  width: 48px; height: 48px;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--neon-cyan);
  margin-bottom: 12px;
}
.icon-green { background: rgba(0, 255, 136, 0.1); color: var(--neon-green); }
.icon-purple { background: rgba(168, 85, 247, 0.1); color: var(--neon-purple); }
.icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--neon-blue); }
.icon-orange { background: rgba(249, 115, 22, 0.1); color: var(--neon-orange); }
.icon-pink { background: rgba(236, 72, 153, 0.1); color: var(--neon-pink); }

.action-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.action-card p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }

/* Stats Row */
.stats-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px;
}
.stat-pill {
  flex: 1; min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-val {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-lbl { font-size: 0.75rem; color: var(--text-secondary); }

/* Features Strip */
.features-strip { margin-bottom: 20px; }
.strip-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem; margin-bottom: 16px;
}
.feature-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.f-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.8rem; color: var(--text-secondary);
}
.f-pill span { font-size: 1rem; }

/* ═══════ CHAT PAGE ═══════ */
.chat-wrapper {
  display: flex; flex-direction: column;
  height: calc(100vh - 48px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 10, 20, 0.5);
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-header-right { display: flex; gap: 6px; }
.chat-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.chat-header h3 { font-family: 'Orbitron', monospace; font-size: 0.9rem; }
.chat-status { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--neon-green); }
.status-dot { width: 6px; height: 6px; background: var(--neon-green); border-radius: 50%; animation: statusPulse 2s infinite; }
@keyframes statusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.icon-btn {
  background: none; border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); padding: 7px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center;
  transition: var(--transition);
}
.icon-btn:hover { border-color: var(--border-glow); color: var(--neon-cyan); background: rgba(0,240,255,0.06); }

/* Chat Messages */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.message { display: flex; gap: 10px; max-width: 85%; animation: msgIn 0.3s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bot-message { align-self: flex-start; }
.user-message { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar {
  width: 30px; height: 30px; min-width: 30px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.user-message .message-avatar { background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)); }
.message-content {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 14px; padding: 12px 16px;
  font-size: 0.88rem; line-height: 1.7; color: var(--text-primary);
}
.user-message .message-content { background: rgba(0,240,255,0.06); border-color: rgba(0,240,255,0.15); }
.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul, .message-content ol { margin: 6px 0; padding-left: 18px; }
.message-content li { margin-bottom: 3px; color: var(--text-secondary); }
.message-content strong { color: var(--neon-cyan); }
.message-content code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,240,255,0.08); padding: 1px 5px;
  border-radius: 4px; font-size: 0.82rem; color: var(--neon-green);
}
.message-content pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px; padding: 12px; overflow-x: auto; margin: 8px 0;
  position: relative;
}
.message-content pre code { background: none; padding: 0; font-size: 0.8rem; color: var(--text-primary); }
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  color: var(--neon-cyan); font-family: 'Orbitron', monospace; margin: 14px 0 6px;
}
.message-content h1 { font-size: 1.2rem; } .message-content h2 { font-size: 1.1rem; } .message-content h3 { font-size: 1rem; }
.message-content blockquote { border-left: 3px solid var(--neon-cyan); padding-left: 12px; margin: 8px 0; color: var(--text-secondary); font-style: italic; }
.message-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.82rem; }
.message-content th, .message-content td { padding: 6px 10px; border: 1px solid var(--border-color); text-align: left; }
.message-content th { background: rgba(0,240,255,0.08); color: var(--neon-cyan); font-weight: 600; }
.message-content a { color: var(--neon-cyan); }

/* Code copy button */
.code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.72rem; color: var(--text-muted); }
.copy-btn {
  background: rgba(0,240,255,0.08); border: 1px solid var(--border-color);
  color: var(--text-secondary); padding: 3px 10px; border-radius: 4px;
  font-size: 0.7rem; cursor: pointer; font-family: inherit;
  transition: var(--transition);
}
.copy-btn:hover { color: var(--neon-cyan); border-color: var(--border-glow); }

/* Typing indicator */
.typing-indicator { display: flex; gap: 10px; align-self: flex-start; }
.typing-dots {
  display: flex; gap: 4px; align-items: center;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 14px; padding: 12px 18px;
}
.typing-dots span { width: 7px; height: 7px; background: var(--neon-cyan); border-radius: 50%; animation: bounce 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Quick Actions */
.quick-actions {
  display: flex; gap: 6px; padding: 10px 16px;
  overflow-x: auto; border-top: 1px solid var(--border-color);
}
.quick-actions::-webkit-scrollbar { height: 0; }
.quick-btn {
  flex-shrink: 0; padding: 7px 14px;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.15);
  border-radius: 18px; color: var(--neon-cyan);
  font-size: 0.76rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); font-family: inherit; white-space: nowrap;
}
.quick-btn:hover { background: rgba(0,240,255,0.12); border-color: rgba(0,240,255,0.3); }

/* Chat Input */
.chat-input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(10,10,20,0.5);
}
.chat-input-wrapper {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 14px; padding: 5px 5px 5px 5px;
  transition: var(--transition);
}
.chat-input-wrapper:focus-within { border-color: var(--border-glow); box-shadow: var(--shadow-neon); }

.voice-btn {
  width: 36px; height: 36px; min-width: 36px;
  background: none; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: var(--transition);
}
.voice-btn:hover { color: var(--neon-cyan); background: rgba(0,240,255,0.08); }
.voice-btn.recording { color: #ff4444; animation: recordPulse 1s infinite; }
@keyframes recordPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

#chatInput {
  flex: 1; background: none; border: none;
  color: var(--text-primary); font-size: 0.9rem;
  font-family: inherit; resize: none; outline: none;
  padding: 7px 4px; max-height: 120px; line-height: 1.5;
}
#chatInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px; height: 36px; min-width: 36px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border: none; border-radius: 10px; color: #0a0a0f;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.send-btn:hover { box-shadow: 0 0 20px rgba(0,240,255,0.4); transform: scale(1.05); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.chat-footer { text-align: center; font-size: 0.68rem; color: var(--text-muted); margin-top: 8px; }

/* ═══════ VISUAL DIAGNOSIS ═══════ */
.visual-container { max-width: 700px; }
.device-selector { margin-bottom: 18px; }
.device-selector label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; display: block; }
.device-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 7px 16px; border-radius: 18px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: 0.8rem;
  cursor: pointer; font-family: inherit; transition: var(--transition);
}
.chip-btn:hover { border-color: var(--border-glow); color: var(--text-primary); }
.chip-btn.active { background: rgba(0,240,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); }

.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px; text-align: center;
  margin-bottom: 16px;
  transition: var(--transition);
  cursor: pointer;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--neon-cyan); background: rgba(0,240,255,0.03); }
.upload-icon { color: var(--text-muted); margin-bottom: 12px; }
.upload-text { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 4px; }
.upload-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }
.upload-btns { display: flex; gap: 10px; justify-content: center; }
.upload-preview { position: relative; width: 100%; }
.upload-preview img { width: 100%; max-height: 400px; object-fit: contain; border-radius: 8px; }
.btn-remove {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(255,0,0,0.7); border: none;
  border-radius: 50%; color: #fff; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.analysis-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden; margin-top: 16px;
}
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10,10,20,0.5);
}
.result-header h3 { font-family: 'Orbitron', monospace; font-size: 0.9rem; color: var(--neon-cyan); }
.result-body { padding: 18px; font-size: 0.88rem; line-height: 1.7; }
.result-body h1, .result-body h2, .result-body h3 { color: var(--neon-cyan); font-family: 'Orbitron', monospace; margin: 14px 0 6px; font-size: 1rem; }
.result-body strong { color: var(--neon-cyan); }
.result-body ul, .result-body ol { padding-left: 18px; margin: 6px 0; }
.result-body li { margin-bottom: 3px; color: var(--text-secondary); }
.result-body code { font-family: 'JetBrains Mono', monospace; background: rgba(0,240,255,0.08); padding: 1px 5px; border-radius: 4px; font-size: 0.82rem; color: var(--neon-green); }

/* ═══════ FAULT WIZARD ═══════ */
.wizard-container { max-width: 800px; }
.wizard-step { display: none; animation: pageIn 0.3s ease-out; }
.wizard-step.active { display: block; }
.wizard-step-title { font-family: 'Orbitron', monospace; font-size: 1rem; margin-bottom: 18px; color: var(--neon-cyan); }
.wizard-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.wizard-progress { font-size: 0.8rem; color: var(--text-muted); }

.wizard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.wizard-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 20px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer; font-family: inherit;
  color: var(--text-primary); font-size: 0.85rem;
  transition: var(--transition);
}
.wizard-card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-neon); transform: translateY(-2px); }
.wizard-card.active { border-color: var(--neon-cyan); background: rgba(0,240,255,0.08); }
.wiz-icon { font-size: 2rem; }

.wizard-diagnosis { min-height: 200px; }
.diagnosis-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; gap: 16px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.diagnosis-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-size: 0.88rem; line-height: 1.7;
}
.diagnosis-result h1, .diagnosis-result h2, .diagnosis-result h3 { color: var(--neon-cyan); font-family: 'Orbitron', monospace; margin: 14px 0 6px; font-size: 1rem; }
.diagnosis-result strong { color: var(--neon-cyan); }
.diagnosis-result ul, .diagnosis-result ol { padding-left: 18px; margin: 6px 0; }
.diagnosis-result li { margin-bottom: 3px; color: var(--text-secondary); }

.wizard-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ═══════ TOOLS & CALCULATORS ═══════ */
.tools-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 20px;
}
.tools-tabs::-webkit-scrollbar { height: 0; }
.tool-tab {
  flex-shrink: 0; padding: 8px 16px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 18px; color: var(--text-secondary);
  font-size: 0.78rem; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: var(--transition); white-space: nowrap;
}
.tool-tab:hover { border-color: var(--border-glow); color: var(--text-primary); }
.tool-tab.active { background: rgba(0,240,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); }

.tool-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 300px;
}
.tool-title { font-family: 'Orbitron', monospace; font-size: 1rem; color: var(--neon-cyan); margin-bottom: 18px; }
.tool-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; align-items: flex-end; }
.tool-field { flex: 1; min-width: 140px; }
.tool-field label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; }
.tool-field input, .tool-field select {
  width: 100%; padding: 9px 12px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 8px; color: var(--text-primary);
  font-family: inherit; font-size: 0.88rem;
  outline: none; transition: var(--transition);
}
.tool-field input:focus, .tool-field select:focus { border-color: var(--border-glow); box-shadow: var(--shadow-neon); }
.tool-field select { cursor: pointer; }
.tool-field select option { background: var(--bg-secondary); }

.tool-result {
  background: rgba(0,240,255,0.04);
  border: 1px solid rgba(0,240,255,0.15);
  border-radius: var(--radius);
  padding: 16px; margin-top: 18px;
}
.tool-result-label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; }
.tool-result-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem; font-weight: 700;
  color: var(--neon-cyan);
}
.tool-result-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Resistor visual */
.resistor-visual {
  display: flex; align-items: center; justify-content: center;
  margin: 16px 0; padding: 16px;
}
.resistor-body {
  width: 180px; height: 50px;
  background: linear-gradient(180deg, #d4a574, #c49464);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.resistor-body::before, .resistor-body::after {
  content: ''; position: absolute;
  width: 40px; height: 4px; background: #888;
  top: 50%; transform: translateY(-50%);
}
.resistor-body::before { right: 100%; }
.resistor-body::after { left: 100%; }
.band {
  width: 12px; height: 40px;
  border-radius: 1px;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
}

/* ═══════ COMPONENT SEARCH ═══════ */
.component-search-box { margin-bottom: 20px; }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 6px 6px 6px 14px;
  transition: var(--transition);
}
.search-input-wrap:focus-within { border-color: var(--border-glow); box-shadow: var(--shadow-neon); }
.search-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; background: none; border: none;
  color: var(--text-primary); font-size: 0.9rem;
  font-family: inherit; outline: none; padding: 8px 4px;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }

.component-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 200px;
  padding: 24px;
}
.component-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; min-height: 200px;
  color: var(--text-muted);
}
.component-placeholder p { font-size: 0.88rem; }

/* ═══════ HISTORY ═══════ */
.history-container { min-height: 300px; }
.history-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; min-height: 300px;
  color: var(--text-muted); text-align: center;
}
.history-placeholder p { font-size: 0.88rem; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
}
.history-item:hover { border-color: var(--border-glow); background: rgba(0,240,255,0.03); }
.history-item-info h4 { font-size: 0.9rem; margin-bottom: 2px; }
.history-item-info p { font-size: 0.75rem; color: var(--text-muted); }
.history-item-actions { display: flex; gap: 6px; }

/* ═══════ SETTINGS ═══════ */
.settings-container { max-width: 600px; }
.settings-group {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}
.settings-group h3 { font-size: 0.95rem; margin-bottom: 6px; }
.settings-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; }
.settings-select {
  width: 100%; padding: 9px 12px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 8px; color: var(--text-primary);
  font-family: inherit; font-size: 0.88rem;
  outline: none; cursor: pointer;
}
.settings-select option { background: var(--bg-secondary); }

.theme-toggle { display: flex; gap: 8px; }
.theme-btn {
  padding: 8px 20px; border-radius: 8px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  color: var(--text-secondary); cursor: pointer;
  font-family: inherit; font-size: 0.85rem;
  transition: var(--transition);
}
.theme-btn.active { background: rgba(0,240,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); }

.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 26px; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: rgba(0,240,255,0.3); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); background: var(--neon-cyan); }

/* ═══════ AUTH MODAL ═══════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: rgba(10, 10, 20, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 400px;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.1), inset 0 0 60px rgba(0, 240, 255, 0.03);
  overflow: hidden;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: authScanLine 3s ease-in-out infinite;
}
@keyframes authScanLine {
  0%, 100% { opacity: 0.3; transform: scaleX(0.5); }
  50% { opacity: 1; transform: scaleX(1); }
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.modal h2 { font-family: 'Orbitron', monospace; font-size: 1.2rem; margin-bottom: 6px; color: var(--neon-cyan); }
.modal-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(255,255,255,0.2);
  color: #333; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.btn-google:hover {
  box-shadow: 0 0 25px rgba(255,255,255,0.15), 0 0 50px rgba(0, 240, 255, 0.1);
  transform: translateY(-1px);
}
.btn-google:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 0; color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.auth-input-wrap {
  position: relative; margin-bottom: 10px;
}
.auth-input {
  width: 100%; padding: 11px 14px; margin-bottom: 0;
  background: rgba(0, 240, 255, 0.03); border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 8px; color: var(--text-primary);
  font-family: inherit; font-size: 0.88rem;
  outline: none; transition: var(--transition);
}
.auth-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.05);
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; display: flex; align-items: center; transition: var(--transition);
}
.auth-toggle-pw:hover { color: var(--neon-cyan); }
.auth-error {
  background: rgba(255, 50, 50, 0.1); border: 1px solid rgba(255, 50, 50, 0.3);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
  color: #ff6b6b; font-size: 0.82rem; display: none;
}
.auth-error.visible { display: block; }
.auth-forgot {
  font-size: 0.78rem; color: var(--neon-cyan); text-decoration: none;
  text-align: right; display: block; margin: -4px 0 12px; opacity: 0.8;
  transition: var(--transition); cursor: pointer; background: none; border: none;
  font-family: inherit; padding: 0;
}
.auth-forgot:hover { opacity: 1; text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }
.auth-switch { font-size: 0.82rem; color: var(--text-secondary); text-align: center; margin-top: 12px; }
.auth-switch a { color: var(--neon-cyan); text-decoration: none; }
.auth-switch a:hover { text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }
.auth-loading {
  display: none; align-items: center; justify-content: center; gap: 8px;
  padding: 8px; color: var(--neon-cyan); font-size: 0.82rem;
}
.auth-loading.visible { display: flex; }
.auth-loading .spinner-sm {
  width: 16px; height: 16px; border: 2px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--neon-cyan); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════ BUTTONS ═══════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: var(--transition); border: none; font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  color: #0a0a0f;
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,240,255,0.4); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(0,240,255,0.3); }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ═══════ MOBILE BOTTOM NAV ═══════ */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 6px 0 env(safe-area-inset-bottom, 4px);
}
.bottom-nav { display: none; }
.bottom-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 4px;
  color: var(--text-muted); text-decoration: none;
  font-size: 0.62rem; transition: var(--transition);
  flex: 1;
}
.bottom-item.active { color: var(--neon-cyan); }
.bottom-item svg { width: 20px; height: 20px; }

/* ═══════ TOAST ═══════ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-left: 3px solid var(--neon-cyan);
  border-radius: 10px; padding: 10px 20px;
  color: var(--text-primary); font-size: 0.85rem;
  z-index: 9999; animation: toastIn 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap; max-width: 90vw;
}
.toast-success { border-left-color: var(--neon-green); box-shadow: 0 4px 20px rgba(0,255,136,0.15); }
.toast-warning { border-left-color: #f59e0b; box-shadow: 0 4px 20px rgba(245,158,11,0.15); }
.toast-error { border-left-color: #ef4444; box-shadow: 0 4px 20px rgba(239,68,68,0.15); }
.toast-info { border-left-color: var(--neon-cyan); box-shadow: 0 4px 20px rgba(0,240,255,0.15); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ═══════ USER PROFILE IN SIDEBAR ═══════ */
.user-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(0,240,255,0.04);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: #0a0a0f;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--neon-cyan); }
.user-email { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-profile {
  border: 1px solid rgba(0, 240, 255, 0.1); border-radius: 10px;
  padding: 10px; background: rgba(0, 240, 255, 0.03);
  transition: var(--transition);
}
.user-profile:hover { border-color: rgba(0, 240, 255, 0.2); }
.btn-signout {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; transition: var(--transition);
  display: flex; align-items: center; border-radius: 4px;
}
.btn-signout:hover { color: #ff5050; background: rgba(255, 50, 50, 0.1); }

/* ═══════════════════════════════════════════════════════
   HACKER AESTHETIC - All App Pages Enhancement
   ═══════════════════════════════════════════════════════ */

/* --- GLOBAL: Scanlines on main content --- */
.main-content::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* --- GLOBAL: Glowing page titles --- */
.page-title {
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* --- GLOBAL: Glitch on title accent --- */
@keyframes titleGlitch {
  0%, 92%, 100% { transform: none; filter: drop-shadow(0 0 0 transparent); }
  93% { transform: translateX(-2px); filter: drop-shadow(2px 0 0 rgba(0, 240, 255, 0.3)); }
  95% { transform: translateX(2px); filter: drop-shadow(-2px 0 0 rgba(0, 255, 136, 0.3)); }
  97% { transform: translateX(-1px); }
}
.title-accent {
  animation: titleGlitch 6s ease-in-out infinite;
  display: inline-block;
}

/* --- GLOBAL: Enhanced card hover glow (multi-layer) --- */
.action-card:hover {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15), 0 0 30px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.04);
}

/* --- GLOBAL: Staggered page entry --- */
.page { animation: none; }
@keyframes appFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.page.active > * {
  animation: appFadeUp 0.4s ease-out both;
}
.page.active > *:nth-child(1) { animation-delay: 0.05s; }
.page.active > *:nth-child(2) { animation-delay: 0.1s; }
.page.active > *:nth-child(3) { animation-delay: 0.15s; }
.page.active > *:nth-child(4) { animation-delay: 0.2s; }
.page.active > *:nth-child(5) { animation-delay: 0.25s; }
.page.active > *:nth-child(6) { animation-delay: 0.3s; }

/* --- GLOBAL: Neon divider on page header --- */
.page-header::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.06), transparent);
}

/* --- HOME: Action card idle border pulse --- */
@keyframes cardBorderPulse {
  0%, 100% { border-color: var(--border-color); }
  50% { border-color: rgba(0, 240, 255, 0.2); }
}
.action-card {
  animation: cardBorderPulse 4s ease-in-out infinite;
}

/* --- HOME: Stat value pulsing glow --- */
@keyframes statGlow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3)); }
}
.stat-val {
  animation: statGlow 3s ease-in-out infinite;
}

/* --- HOME: Feature pill shimmer on hover --- */
.f-pill {
  position: relative;
  overflow: hidden;
}
.f-pill::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.08), transparent);
  transition: left 0.5s ease;
}
.f-pill:hover::before {
  left: 100%;
}

/* --- CHAT: Header neon gradient line --- */
.chat-header {
  position: relative;
}
.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-green), transparent);
  opacity: 0.3;
}

/* --- CHAT: Message slide entrance --- */
.bot-message {
  animation: botMsgIn 0.35s ease-out;
}
@keyframes botMsgIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
.user-message {
  animation: userMsgIn 0.35s ease-out;
}
@keyframes userMsgIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- CHAT: Input focus pulse --- */
@keyframes inputFocusPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.1); }
  50% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.25); }
}
.chat-input-wrapper:focus-within {
  animation: inputFocusPulse 2s ease-in-out infinite;
  border-color: var(--border-glow);
}

/* --- VISUAL: Upload zone glowing border on hover --- */
.upload-zone {
  position: relative;
}
.upload-zone::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px dashed transparent;
  border-radius: var(--radius-lg);
  transition: border-color 0.3s ease;
  pointer-events: none;
}
.upload-zone:hover::before {
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* --- VISUAL: Analyzing scanning beam --- */
.upload-zone.analyzing {
  position: relative;
  overflow: hidden;
}
.upload-zone.analyzing::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6), 0 0 30px rgba(0, 240, 255, 0.3);
  animation: scanBeam 2s ease-in-out infinite;
  z-index: 10;
}
@keyframes scanBeam {
  0% { top: 0; }
  50% { top: calc(100% - 3px); }
  100% { top: 0; }
}

/* --- VISUAL: Result header shimmer --- */
.result-header {
  position: relative;
  overflow: hidden;
}
.result-header::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.06), transparent);
  animation: resultShimmer 3s ease-in-out infinite;
}
@keyframes resultShimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* --- WIZARD: Enhanced active card glow --- */
.wizard-card.active {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), 0 0 30px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.05);
}

/* --- WIZARD: Terminal-style progress --- */
.wizard-progress {
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}
.wizard-progress::before {
  content: '> ';
  color: var(--neon-green);
}

/* --- WIZARD: Spinner dual-color + glow --- */
.spinner {
  border-right-color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

/* --- WIZARD: Loading text terminal style --- */
.diagnosis-loading p {
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

/* --- TOOLS: Active tab neon underline --- */
.tool-tab.active {
  position: relative;
}
.tool-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 20%; right: 20%;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* --- TOOLS: Result appear animation --- */
@keyframes toolResultAppear {
  from { opacity: 0; border-color: rgba(0, 240, 255, 0.4); box-shadow: 0 0 20px rgba(0, 240, 255, 0.15); }
  to { opacity: 1; border-color: rgba(0, 240, 255, 0.15); box-shadow: none; }
}
.tool-result {
  animation: toolResultAppear 0.5s ease-out;
}

/* --- TOOLS: Result value glow --- */
.tool-result-value {
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* --- TOOLS: Resistor band glow + body outer glow --- */
.band {
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3), 0 0 4px rgba(255, 255, 255, 0.15);
}
.resistor-body {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 12px rgba(0, 240, 255, 0.08);
}

/* --- COMPONENT SEARCH: Scanning beam while searching --- */
.search-input-wrap.searching {
  position: relative;
  overflow: hidden;
}
.search-input-wrap.searching::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  animation: searchScanBeam 1.5s ease-in-out infinite;
  z-index: 10;
}
@keyframes searchScanBeam {
  0% { left: 0; }
  50% { left: calc(100% - 3px); }
  100% { left: 0; }
}

/* --- COMPONENT SEARCH: Results fade-up --- */
@keyframes compResultFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.component-result {
  animation: compResultFadeUp 0.4s ease-out;
}

/* --- HISTORY: Neon left-border on hover --- */
.history-item:hover {
  border-left: 3px solid var(--neon-cyan);
  box-shadow: -4px 0 12px rgba(0, 240, 255, 0.1);
}

/* --- HISTORY: Timeline connecting line + dots --- */
.history-list {
  position: relative;
}
.history-list::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 18px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.15), transparent);
  pointer-events: none;
}
.history-item {
  position: relative;
}
.history-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.history-item:hover::before {
  opacity: 1;
}

/* --- SETTINGS: Toggle switch active glow --- */
.toggle-switch input:checked + .toggle-slider {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.toggle-switch input:checked + .toggle-slider::before {
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* --- SETTINGS: Group border glow on hover --- */
.settings-group {
  transition: var(--transition);
}
.settings-group:hover {
  border-color: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.04);
}

/* ═══════════════════════════════════════════════════════
   PER-PAGE UNIQUE HACKER THEMES
   Each page = unique accent, background pattern, animations
   ═══════════════════════════════════════════════════════ */

/* --- Canvas overlay shared --- */
.page-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
/* Per-page canvas opacity tuning */
#homeCanvas { opacity: 0.10; }
#chatCanvas { opacity: 0.15; }
#radarCanvas { opacity: 0.10; }
#wizardCanvas { opacity: 0.12; }
#waveformCanvas { opacity: 0.18; }
#componentsCanvas { opacity: 0.22; }
#historyCanvas { opacity: 0.12; }
#settingsCanvas { opacity: 0.10; }

/* Pages that need position: relative for ::before/::after/canvas */
#page-home, #page-visual, #page-wizard, #page-tools,
#page-components, #page-history, #page-settings {
  position: relative;
  overflow: hidden;
}
#page-chat { position: relative; }

/* ──────────────────────────────────────
   HOME — BEAST MODE Mission Control HUD
   ────────────────────────────────────── */

/* Canvas boost */
#homeCanvas { opacity: 0.14; }

/* Background: breathing glow + particle field */
#page-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(0, 240, 255, 0.05), transparent),
    radial-gradient(ellipse 500px 300px at 80% 70%, rgba(0, 255, 136, 0.04), transparent),
    radial-gradient(ellipse 400px 300px at 50% 50%, rgba(168, 85, 247, 0.02), transparent);
  animation: homeBreath 8s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}
@keyframes homeBreath { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
#page-home::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(0, 240, 255, 0.3), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(0, 240, 255, 0.25), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(0, 255, 136, 0.2), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(0, 240, 255, 0.3), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(0, 255, 136, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 25% 75%, rgba(168, 85, 247, 0.2), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(0, 240, 255, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 60% 35%, rgba(0, 255, 136, 0.25), transparent);
  background-size: 200% 200%;
  animation: homeDotDrift 20s linear infinite;
  pointer-events: none; z-index: 0;
}
@keyframes homeDotDrift { 0% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }

/* --- Title Beast Mode --- */
#page-home .page-title {
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.2), 0 0 60px rgba(0, 240, 255, 0.08);
}
#page-home .greeting {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.75rem;
}
#page-home .greeting::before {
  content: '> ';
  color: var(--neon-cyan);
}
#page-home .page-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--neon-cyan);
  opacity: 0.6;
  letter-spacing: 1px;
}

/* --- System Status Bar --- */
.home-status-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(0, 240, 255, 0.02);
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
}
.hsb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-right: 1px solid rgba(0, 240, 255, 0.08);
  font-size: 0.65rem;
}
.hsb-item:last-child { border-right: none; }
.hsb-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
  animation: hsbDotBlink 2s ease-in-out infinite;
}
.hsb-dot.hsb-cyan {
  background: #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}
@keyframes hsbDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hsb-label { color: var(--text-muted); letter-spacing: 1px; }
.hsb-value { color: var(--neon-green); text-shadow: 0 0 4px rgba(0, 255, 136, 0.2); }

/* --- Data Marquee --- */
.home-marquee {
  overflow: hidden;
  border-top: 1px solid rgba(0, 240, 255, 0.06);
  border-bottom: 1px solid rgba(0, 240, 255, 0.06);
  padding: 6px 0;
  margin-bottom: 18px;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 40px;
  animation: marqueeScroll 40s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: rgba(0, 240, 255, 0.25);
  letter-spacing: 1px;
  flex-shrink: 0;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Action Cards Beast Mode --- */
#page-home .action-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.08);
  background: linear-gradient(135deg, rgba(15, 15, 30, 0.8), rgba(10, 10, 20, 0.9));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#page-home .action-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.08), rgba(0, 255, 136, 0.04), transparent);
  pointer-events: none;
}
#page-home .action-card:hover::before {
  animation: holoSweep 0.8s ease-out forwards;
}
@keyframes holoSweep { from { left: -100%; } to { left: 100%; } }

/* Card number overlay */
#page-home .action-card::after {
  content: attr(data-num);
  position: absolute;
  top: 10px; right: 12px;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(0, 240, 255, 0.12);
  letter-spacing: 2px;
  pointer-events: none;
}

/* Card hover: dramatic multi-layer glow */
#page-home .action-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 0 15px rgba(0, 240, 255, 0.15),
    0 0 30px rgba(0, 240, 255, 0.08),
    0 8px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(0, 240, 255, 0.03);
}
#page-home .action-card:hover::after {
  color: rgba(0, 240, 255, 0.25);
}

/* Card status label */
.card-status {
  display: inline-block;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(0, 255, 136, 0.3);
  padding: 2px 8px;
  border: 1px solid rgba(0, 255, 136, 0.1);
  border-radius: 4px;
}
#page-home .action-card:hover .card-status {
  color: rgba(0, 255, 136, 0.6);
  border-color: rgba(0, 255, 136, 0.25);
  text-shadow: 0 0 4px rgba(0, 255, 136, 0.2);
}

/* Icon hover: glow ring + slight rotation */
@keyframes iconRingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(0, 240, 255, 0); }
}
#page-home .action-card:hover .action-icon {
  animation: iconRingPulse 1.5s ease-in-out infinite;
  transform: scale(1.1);
  transition: transform 0.3s ease;
}
/* Colored icon glow matching card accent */
#page-home .action-card:hover .icon-green { box-shadow: 0 0 20px rgba(0, 255, 136, 0.15); }
#page-home .action-card:hover .icon-purple { box-shadow: 0 0 20px rgba(168, 85, 247, 0.15); }
#page-home .action-card:hover .icon-blue { box-shadow: 0 0 20px rgba(59, 130, 246, 0.15); }
#page-home .action-card:hover .icon-orange { box-shadow: 0 0 20px rgba(249, 115, 22, 0.15); }
#page-home .action-card:hover .icon-pink { box-shadow: 0 0 20px rgba(236, 72, 153, 0.15); }
#page-home .action-card:hover .icon-red { box-shadow: 0 0 20px rgba(255, 51, 102, 0.15); }
#page-home .action-card:hover .icon-gold { box-shadow: 0 0 20px rgba(255, 170, 0, 0.15); }

/* Card stagger animations on page entry */
#page-home .action-card:nth-child(1) { animation-delay: 0.05s; }
#page-home .action-card:nth-child(2) { animation-delay: 0.1s; }
#page-home .action-card:nth-child(3) { animation-delay: 0.15s; }
#page-home .action-card:nth-child(4) { animation-delay: 0.2s; }
#page-home .action-card:nth-child(5) { animation-delay: 0.25s; }
#page-home .action-card:nth-child(6) { animation-delay: 0.3s; }
#page-home .action-card:nth-child(7) { animation-delay: 0.35s; }
#page-home .action-card:nth-child(8) { animation-delay: 0.4s; }
#page-home .action-card:nth-child(9) { animation-delay: 0.45s; }
#page-home .action-card:nth-child(10) { animation-delay: 0.5s; }
#page-home .action-card:nth-child(11) { animation-delay: 0.55s; }

/* Card border pulse */
@keyframes cardBorderBeast {
  0%, 100% { border-color: rgba(0, 240, 255, 0.08); }
  50% { border-color: rgba(0, 240, 255, 0.15); }
}
#page-home .action-card { animation: cardBorderBeast 4s ease-in-out infinite; }

/* --- Stats Beast Mode --- */
#page-home .stat-pill {
  position: relative;
  border: 1px solid rgba(0, 240, 255, 0.1);
  background: linear-gradient(135deg, rgba(15, 15, 30, 0.8), rgba(10, 10, 20, 0.9));
  overflow: hidden;
  padding-bottom: 20px;
}
#page-home .stat-pill::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-green));
  opacity: 0.4;
}
#page-home .stat-val {
  font-size: 1.6rem;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
}
#page-home .stat-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
/* Stat progress bar */
.stat-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(0, 240, 255, 0.05);
}
.stat-bar-fill {
  height: 100%;
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  border-radius: 0 2px 2px 0;
  animation: statBarFill 2s ease-out forwards;
  transform-origin: left;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}
@keyframes statBarFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Stat pill HUD flicker */
@keyframes hudFlicker {
  0%, 93%, 97%, 100% { opacity: 1; }
  94%, 96% { opacity: 0.7; }
}
#page-home .stat-pill {
  animation: hudFlicker 5s ease-in-out infinite;
}
#page-home .stat-pill:hover {
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.02);
}

/* --- Feature Pills Beast Mode --- */
#page-home .f-pill {
  border: 1px solid rgba(0, 240, 255, 0.08);
  background: rgba(10, 10, 20, 0.8);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
#page-home .f-pill::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.08), transparent);
  transition: left 0.5s ease;
}
#page-home .f-pill:hover::before { left: 100%; }
#page-home .f-pill:hover {
  border-color: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.08);
}
#page-home .strip-title {
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* --- Mobile: clean up status bar --- */
@media (max-width: 768px) {
  .hsb-hide-mobile { display: none; }
  .home-status-bar { gap: 2px; padding: 6px 8px; }
  .hsb-item { padding: 2px 6px; font-size: 0.58rem; }
  .marquee-track span { font-size: 0.55rem; }
  .card-status { display: none; }
  #page-home .action-card::after { display: none; }
}

/* ──────────────────────────────────────
   CHAT — Terminal Console (Green Phosphor)
   ────────────────────────────────────── */
#page-chat .chat-wrapper {
  background: rgba(0, 20, 10, 0.5);
  position: relative;
  overflow: hidden;
}
#page-chat .chat-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 255, 136, 0.015) 3px,
    rgba(0, 255, 136, 0.015) 6px
  );
  background-size: 100% 6px;
  animation: crtScanScroll 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes crtScanScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

#page-chat .message-content {
  background: rgba(0, 30, 15, 0.6);
}
#page-chat .bot-message .message-content {
  text-shadow: 0 0 4px rgba(0, 255, 136, 0.1);
}
#page-chat .bot-message .message-content strong {
  color: #00ff88;
}

/* Chat: CRT header flicker */
@keyframes crtFlicker {
  0%, 94%, 96%, 100% { opacity: 1; }
  95% { opacity: 0.85; }
}
#page-chat .chat-header {
  animation: crtFlicker 4s ease-in-out infinite;
}

#page-chat #chatInput {
  caret-color: #00ff88;
  text-shadow: 0 0 2px rgba(0, 255, 136, 0.08);
}
#page-chat .typing-dots span {
  background: #00ff88;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}
#page-chat .send-btn {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
}
#page-chat .chat-status {
  font-family: 'JetBrains Mono', monospace;
}

/* ──────────────────────────────────────
   VISUAL — Scanner / Targeting System (Orange)
   ────────────────────────────────────── */
#page-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(249, 115, 22, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(249, 115, 22, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridDrift 10s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes gridDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

/* Visual: upload zone crosshairs */
#page-visual .upload-zone {
  position: relative;
  overflow: visible;
}
#page-visual .upload-zone::before {
  content: '';
  position: absolute;
  top: 50%; left: 15%;
  right: 15%; height: 1px;
  background: rgba(249, 115, 22, 0.15);
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.1);
  pointer-events: none;
  z-index: 1;
}
#page-visual .upload-zone::after {
  content: '';
  position: absolute;
  left: 50%; top: 15%;
  bottom: 15%; width: 1px;
  background: rgba(249, 115, 22, 0.15);
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.1);
  pointer-events: none;
  z-index: 1;
}

/* Visual: active chip radar ping */
@keyframes radarPing {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}
#page-visual .chip-btn.active {
  background: rgba(249, 115, 22, 0.1);
  border-color: #f97316;
  color: #f97316;
  animation: radarPing 2s ease-out infinite;
}

/* Visual: analysis result scan beam */
#page-visual .analysis-result {
  position: relative;
  overflow: hidden;
}
#page-visual .analysis-result::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.4), transparent);
  animation: orangeScanBeam 3s ease-in-out infinite;
  z-index: 1;
}
@keyframes orangeScanBeam {
  0% { top: 0; }
  50% { top: calc(100% - 2px); }
  100% { top: 0; }
}

/* Visual: orange accent overrides */
#page-visual .result-header h3 { color: #f97316; }
#page-visual .btn-primary { background: linear-gradient(135deg, #f97316, #ea580c); }
#page-visual .btn-primary:hover { box-shadow: 0 0 30px rgba(249, 115, 22, 0.4); }
#page-visual .page-title { text-shadow: 0 0 20px rgba(249, 115, 22, 0.15); }
#page-visual .title-accent { background: linear-gradient(135deg, #f97316, #fb923c); -webkit-background-clip: text; background-clip: text; }

/* ──────────────────────────────────────
   WIZARD — Diagnostic Boot Sequence (Purple)
   ────────────────────────────────────── */
#page-wizard {
  background: radial-gradient(ellipse 600px 400px at 50% 0%, rgba(168, 85, 247, 0.04), transparent);
}
#page-wizard::before {
  content: 'SYSTEM DIAGNOSTIC MODE';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: rgba(168, 85, 247, 0.3);
  animation: diagLabelPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes diagLabelPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Wizard: card left-border accent */
#page-wizard .wizard-card {
  border-left: 3px solid transparent;
  transition: var(--transition);
}
#page-wizard .wizard-card:hover {
  border-left-color: #a855f7;
  box-shadow: -4px 0 15px rgba(168, 85, 247, 0.15), 0 0 15px rgba(168, 85, 247, 0.08);
}

/* Wizard: active card flash */
@keyframes wizardFlash {
  0% { background: rgba(168, 85, 247, 0.15); }
  100% { background: rgba(168, 85, 247, 0.05); }
}
#page-wizard .wizard-card.active {
  border-color: #a855f7;
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.05);
  animation: wizardFlash 0.6s ease-out;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

/* Wizard: progress pulsing dot */
#page-wizard .wizard-progress::before {
  content: '> ';
  color: #a855f7;
}
#page-wizard .wizard-progress {
  color: #a855f7;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* Wizard: diagnosis result terminal style */
#page-wizard .diagnosis-result {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(10, 5, 20, 0.7);
  border-left: 3px solid #a855f7;
}
#page-wizard .diagnosis-result h1, #page-wizard .diagnosis-result h2, #page-wizard .diagnosis-result h3 {
  color: #a855f7;
}
#page-wizard .diagnosis-result strong { color: #a855f7; }

/* Wizard: accent overrides */
#page-wizard .wizard-step-title { color: #a855f7; }
#page-wizard .page-title { text-shadow: 0 0 20px rgba(168, 85, 247, 0.15); }
#page-wizard .title-accent { background: linear-gradient(135deg, #a855f7, #c084fc); -webkit-background-clip: text; background-clip: text; }
#page-wizard .spinner { border-top-color: #a855f7; border-right-color: #c084fc; box-shadow: 0 0 12px rgba(168, 85, 247, 0.2); }
#page-wizard .diagnosis-loading p { color: #a855f7; text-shadow: 0 0 8px rgba(168, 85, 247, 0.3); }

/* ──────────────────────────────────────
   TOOLS — Oscilloscope Lab (Blue)
   ────────────────────────────────────── */
#page-tools {
  background:
    radial-gradient(ellipse 600px 500px at 50% 40%, rgba(59, 130, 246, 0.04), transparent),
    radial-gradient(ellipse 300px 300px at 80% 80%, rgba(0, 200, 255, 0.02), transparent);
}
#page-tools::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
#page-tools::after {
  content: 'OSCILLOSCOPE LAB';
  position: absolute;
  top: 8px; right: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(59, 130, 246, 0.15);
  letter-spacing: 3px;
  pointer-events: none;
  z-index: 1;
  animation: signalBlink 3s ease-in-out infinite;
}

/* Tools: tab strip enhancement */
#page-tools .tools-tabs {
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 10px;
  padding: 6px;
  background: rgba(5, 10, 30, 0.4);
  position: relative;
  z-index: 1;
}
#page-tools .tool-tab {
  position: relative;
  transition: all 0.3s ease;
}
#page-tools .tool-tab:hover {
  background: rgba(59, 130, 246, 0.06);
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Tools: active tab signal dot */
#page-tools .tool-tab.active::before {
  content: '';
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
  animation: signalBlink 1.5s ease-in-out infinite;
}
@keyframes signalBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
#page-tools .tool-tab.active {
  padding-left: 20px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}
#page-tools .tool-tab.active::after {
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Tools: content area enhancement */
#page-tools .tool-content {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(59, 130, 246, 0.06);
  border-radius: 12px;
  background: rgba(5, 10, 25, 0.3);
  padding: 20px;
  margin-top: 8px;
}

/* Tools: result measurement label */
#page-tools .tool-result {
  background: rgba(5, 10, 30, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 10px;
  box-shadow: inset 0 0 25px rgba(59, 130, 246, 0.04), 0 0 15px rgba(59, 130, 246, 0.03);
  position: relative;
}
#page-tools .tool-result::before {
  content: 'MEAS:';
  position: absolute;
  top: 6px; right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(59, 130, 246, 0.3);
  letter-spacing: 1px;
}
#page-tools .tool-result::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  border-radius: 0 0 10px 10px;
}

/* Tools: resistor body blue glow */
#page-tools .resistor-body {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Tools: input field enhancement */
#page-tools .tool-field input,
#page-tools .tool-field select {
  border-left: 2px solid rgba(59, 130, 246, 0.1);
  transition: all 0.3s ease;
}
#page-tools .tool-field input:focus,
#page-tools .tool-field select:focus {
  border-color: rgba(59, 130, 246, 0.4);
  border-left: 2px solid rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.12), inset 0 0 10px rgba(59, 130, 246, 0.03);
}

/* Tools: accent overrides */
#page-tools .tool-result-value {
  color: #3b82f6;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
}
#page-tools .tool-title { color: #3b82f6; text-shadow: 0 0 10px rgba(59, 130, 246, 0.15); }
#page-tools .tool-tab.active { background: rgba(59, 130, 246, 0.1); border-color: #3b82f6; color: #3b82f6; }
#page-tools .page-title { text-shadow: 0 0 25px rgba(59, 130, 246, 0.2); }
#page-tools .title-accent { background: linear-gradient(135deg, #3b82f6, #60a5fa); -webkit-background-clip: text; background-clip: text; }
#page-tools .page-subtitle { color: rgba(59, 130, 246, 0.4); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; letter-spacing: 1px; }

/* ──────────────────────────────────────
   COMPONENTS — Floating Electronics Lab (Cyan)
   ────────────────────────────────────── */
#page-components {
  background:
    radial-gradient(ellipse 600px 500px at 30% 40%, rgba(0, 240, 255, 0.04), transparent),
    radial-gradient(ellipse 400px 300px at 70% 70%, rgba(0, 200, 255, 0.02), transparent);
}
#page-components::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
#page-components::after {
  content: 'COMPONENT DATABASE // LIVE SCHEMATIC';
  position: absolute;
  top: 8px; right: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(0, 240, 255, 0.15);
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 1;
  animation: signalBlink 4s ease-in-out infinite;
}

/* Components: search box enhancement */
#page-components .component-search-box {
  position: relative;
  z-index: 2;
}
#page-components .search-input-wrap {
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 12px;
  background: rgba(5, 15, 25, 0.5);
  transition: all 0.3s ease;
}
#page-components .search-input-wrap:focus-within {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.02);
}
#page-components .search-input-wrap svg {
  color: rgba(0, 240, 255, 0.4);
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.3));
}
#page-components #componentInput {
  font-family: 'JetBrains Mono', monospace;
}
#page-components #componentInput::placeholder {
  color: rgba(0, 240, 255, 0.2);
}

/* Components: corner brackets on result (enhanced) */
#page-components .component-result {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(0, 240, 255, 0.06);
  border-radius: 12px;
  background: rgba(5, 15, 25, 0.3);
  transition: all 0.3s ease;
}
#page-components .component-result::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 28px; height: 28px;
  border-top: 2px solid rgba(0, 240, 255, 0.35);
  border-left: 2px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px 0 0 0;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.2));
}
#page-components .component-result::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 28px; height: 28px;
  border-bottom: 2px solid rgba(0, 240, 255, 0.35);
  border-right: 2px solid rgba(0, 240, 255, 0.35);
  border-radius: 0 0 12px 0;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.2));
}

/* Components: placeholder enhancement */
#page-components .component-placeholder {
  font-family: 'JetBrains Mono', monospace;
  color: rgba(0, 240, 255, 0.25);
}
#page-components .component-placeholder svg {
  color: rgba(0, 240, 255, 0.2);
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.15));
  animation: floatUpDown 3s ease-in-out infinite;
}
@keyframes floatUpDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Components: page title styling */
#page-components .page-title { text-shadow: 0 0 25px rgba(0, 240, 255, 0.2); }
#page-components .title-accent { background: linear-gradient(135deg, #00f0ff, #00c8ff); -webkit-background-clip: text; background-clip: text; }
#page-components .page-subtitle { color: rgba(0, 240, 255, 0.35); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; letter-spacing: 1px; }

/* Components: blur-reveal animation */
@keyframes blurReveal {
  from { opacity: 0; transform: scale(0.95); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
#page-components .component-result {
  animation: blurReveal 0.4s ease-out;
}

/* Components: scanning effect on search */
#page-components .search-input-wrap.searching {
  animation: searchScan 1.5s ease-in-out infinite;
}
@keyframes searchScan {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.05); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 20px rgba(0, 240, 255, 0.05); }
}

/* Tools: Status Strip */
.tools-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: rgba(5, 10, 30, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(59, 130, 246, 0.4);
  letter-spacing: 1px;
  overflow-x: auto;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.tss-item { display: flex; align-items: center; gap: 5px; }
.tss-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
  animation: signalBlink 2s ease-in-out infinite;
}
.tss-dot.tss-cyan { background: #00f0ff; box-shadow: 0 0 6px rgba(0, 240, 255, 0.5); }
.tss-dot.tss-green { background: #00ff88; box-shadow: 0 0 6px rgba(0, 255, 136, 0.5); }
.tss-sep { color: rgba(59, 130, 246, 0.15); }

/* Components: Status Strip */
.comp-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: rgba(5, 15, 25, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(0, 240, 255, 0.4);
  letter-spacing: 1px;
  overflow-x: auto;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.css-item { display: flex; align-items: center; gap: 5px; }
.css-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
  animation: signalBlink 2.5s ease-in-out infinite;
}
.css-dot.css-cyan { background: #00f0ff; box-shadow: 0 0 6px rgba(0, 240, 255, 0.5); }
.css-sep { color: rgba(0, 240, 255, 0.15); }

/* Components: Quick Chips */
.comp-quick-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.comp-chip {
  padding: 5px 14px;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.04);
  color: rgba(0, 240, 255, 0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}
.comp-chip:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.12);
  transform: translateY(-1px);
}
.comp-hint {
  font-size: 0.7rem;
  color: rgba(0, 240, 255, 0.2);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* Mobile: hide status strips on small screens */
@media (max-width: 768px) {
  .tools-status-strip, .comp-status-strip { font-size: 0.55rem; gap: 6px; padding: 6px 8px; }
  .comp-quick-chips { gap: 5px; }
  .comp-chip { padding: 4px 10px; font-size: 0.6rem; }
}

/* ──────────────────────────────────────
   HISTORY — Data Stream Timeline (Pink)
   ────────────────────────────────────── */
#page-history {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.02) 0%, transparent 40%);
}
#page-history::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 25px 25px, rgba(236, 72, 153, 0.15), transparent),
    radial-gradient(2px 2px at 75px 75px, rgba(236, 72, 153, 0.1), transparent);
  background-size: 50px 50px;
  animation: pinkDotDrift 15s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes pinkDotDrift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50px); }
}

/* History: enhanced timeline line (pink glow) */
#page-history .history-list::before {
  background: linear-gradient(180deg, transparent, rgba(236, 72, 153, 0.25), transparent);
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.15);
}

/* History: timeline dots always visible, pulsing pink */
@keyframes pinkDotPulse {
  0%, 100% { opacity: 0.5; box-shadow: 0 0 4px rgba(236, 72, 153, 0.3); }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(236, 72, 153, 0.6); }
}
#page-history .history-item::before {
  background: #ec4899;
  box-shadow: 0 0 6px rgba(236, 72, 153, 0.4);
  opacity: 1;
  animation: pinkDotPulse 2s ease-in-out infinite;
}

/* History: item hover pink accents */
#page-history .history-item:hover {
  border-left: 3px solid #ec4899;
  box-shadow: -4px 0 12px rgba(236, 72, 153, 0.15);
}

/* History: timestamp styling */
#page-history .history-item-info p {
  color: #ec4899;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 4px rgba(236, 72, 153, 0.15);
}

/* History: accent overrides */
#page-history .page-title { text-shadow: 0 0 20px rgba(236, 72, 153, 0.15); }
#page-history .title-accent { background: linear-gradient(135deg, #ec4899, #f472b6); -webkit-background-clip: text; background-clip: text; }

/* ──────────────────────────────────────
   SETTINGS — System Config Panel (Green)
   ────────────────────────────────────── */
#page-settings {
  background: radial-gradient(ellipse 500px 400px at 80% 80%, rgba(0, 255, 136, 0.03), transparent);
}
#page-settings::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
#page-settings::after {
  content: 'SYS: NOMINAL';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: rgba(0, 255, 136, 0.25);
  animation: sysNominalPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes sysNominalPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.5; }
}

/* Settings: group left-border accent */
#page-settings .settings-group {
  border-left: 3px solid transparent;
}
#page-settings .settings-group:hover {
  border-left-color: #00ff88;
  border-color: rgba(0, 255, 136, 0.15);
  box-shadow: -4px 0 15px rgba(0, 255, 136, 0.08), 0 0 12px rgba(0, 255, 136, 0.03);
}

/* Settings: group headers terminal prefix */
#page-settings .settings-group h3 {
  font-family: 'JetBrains Mono', monospace;
}
#page-settings .settings-group h3::before {
  content: '> ';
  color: #00ff88;
}

/* Settings: enhanced green toggle glow */
#page-settings .toggle-switch input:checked + .toggle-slider {
  background: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.25);
}
#page-settings .toggle-switch input:checked + .toggle-slider::before {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* Settings: select green accents */
#page-settings .settings-select:focus {
  border-color: rgba(0, 255, 136, 0.4);
  box-shadow: -3px 0 10px rgba(0, 255, 136, 0.08);
}
#page-settings .settings-select {
  border-left: 2px solid transparent;
  transition: var(--transition);
}
#page-settings .settings-select:focus {
  border-left-color: #00ff88;
}

/* Settings: theme button active green dot */
#page-settings .theme-btn.active {
  background: rgba(0, 255, 136, 0.1);
  border-color: #00ff88;
  color: #00ff88;
  position: relative;
}
#page-settings .theme-btn.active::before {
  content: '';
  position: absolute;
  top: 50%; left: 6px;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 4px rgba(0, 255, 136, 0.6);
}

/* Settings: accent overrides */
#page-settings .page-title { text-shadow: 0 0 20px rgba(0, 255, 136, 0.15); }
#page-settings .title-accent { background: linear-gradient(135deg, #00ff88, #4ade80); -webkit-background-clip: text; background-clip: text; }

/* ═══════════════════════════════════════════════════════
   BONUS EFFECTS - Extra Hacker Enhancements
   ═══════════════════════════════════════════════════════ */

/* Per-page accent color custom property */
#page-home { --page-accent: #00f0ff; }
#page-chat { --page-accent: #00ff88; }
#page-visual { --page-accent: #f97316; }
#page-wizard { --page-accent: #a855f7; }
#page-tools { --page-accent: #3b82f6; }
#page-components { --page-accent: #00f0ff; }
#page-history { --page-accent: #ec4899; }
#page-settings { --page-accent: #00ff88; }

/* --- Page Glitch Transition Overlay --- */
.page-glitch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  opacity: 0;
}
.page-glitch-overlay.active {
  animation: glitchFx 0.3s ease-out forwards;
}
@keyframes glitchFx {
  0% { opacity: 1; background: rgba(0, 240, 255, 0.04); }
  20% { background: rgba(0, 240, 255, 0.02); transform: translateX(-3px) skewX(-0.5deg); }
  40% { background: rgba(255, 0, 100, 0.02); transform: translateX(3px) skewX(0.3deg); }
  60% { background: rgba(0, 240, 255, 0.01); transform: translateX(-1px); }
  80% { transform: translate(0); }
  100% { opacity: 0; background: transparent; transform: translate(0); }
}

/* --- HUD Corner Brackets (4 corners via gradient backgrounds) --- */
.hud-frame {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background:
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) top left / 2px 20px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) top left / 20px 2px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) top right / 2px 20px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) top right / 20px 2px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) bottom left / 2px 20px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) bottom left / 20px 2px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) bottom right / 2px 20px no-repeat,
    linear-gradient(var(--page-accent, #00f0ff), var(--page-accent, #00f0ff)) bottom right / 20px 2px no-repeat;
}

/* --- Cursor Neon Glow --- */
.cursor-glow {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  left: 0; top: 0;
  will-change: transform;
  transition: opacity 0.3s ease;
}
.cursor-glow.hidden { opacity: 0; }

/* --- Cyberpunk Click Ripple --- */
.click-ripple {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.5);
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%) scale(1);
  animation: rippleExpand 0.5s ease-out forwards;
}
@keyframes rippleExpand {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}

/* --- Sidebar Active Pulse Dot --- */
.nav-item { position: relative; }
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  animation: navDotPulse 2s ease-in-out infinite;
}
@keyframes navDotPulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px rgba(0, 240, 255, 0.4); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(0, 240, 255, 0.8); }
}
/* Hide dot in collapsed sidebar */
.sidebar.collapsed .nav-item.active::after { display: none; }

/* --- Floating Binary Data Overlay --- */
.binary-float {
  position: fixed;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(0, 240, 255, 0.07);
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  animation: binaryDrift 12s linear forwards;
  will-change: transform;
}
@keyframes binaryDrift {
  0% { transform: translateY(0); opacity: 0; }
  5% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

/* ──────────────────────────────────────
   MOBILE: Disable heavy effects
   ────────────────────────────────────── */
@media (max-width: 768px) {
  .page-canvas { display: none; }
  #page-home::before,
  #page-home::after,
  #page-visual::before,
  #page-tools::before,
  #page-components::before,
  #page-history::before,
  #page-settings::before,
  #page-settings::after,
  #page-wizard::before { display: none; }
  #page-chat .chat-wrapper::before { display: none; }
  .cursor-glow,
  .hud-frame,
  .binary-float,
  .page-glitch-overlay { display: none; }
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
  .main-content::before { display: none; }
  .action-card { animation: none; }
  .title-accent { animation: none; }
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding-bottom: 70px; }
  .bottom-nav { display: flex; }
  .page { padding: 16px 14px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats-row { flex-wrap: wrap; }
  .stat-pill { min-width: 45%; }
  .chat-wrapper { height: calc(100vh - 80px); border-radius: 0; border: none; }
  .tool-row { flex-direction: column; }
  .tool-field { min-width: 100%; }
  .wizard-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-zone { padding: 20px; min-height: 160px; }
  .message { max-width: 90%; }
  .modal { padding: 24px 20px; max-width: 360px; }
  .settings-container { max-width: 100%; }
  .floating-symbols { display: none; }
}

@media (max-width: 480px) {
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .action-card { padding: 16px 12px; }
  .action-icon { width: 40px; height: 40px; }
  .stat-pill { min-width: 45%; padding: 12px; }
  .stat-val { font-size: 1.1rem; }
  .wizard-grid { grid-template-columns: 1fr 1fr; }
  .feature-pills { gap: 6px; }
  .f-pill { padding: 6px 10px; font-size: 0.72rem; }
}

/* ═══════ SKELETON LOADING ═══════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(0,240,255,0.05) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════ GOOGLE TRANSLATE WIDGET OVERRIDE ═══════ */
.goog-te-gadget { font-family: inherit !important; }
.goog-te-gadget-simple { background: var(--bg-input) !important; border: 1px solid var(--border-color) !important; border-radius: 8px !important; padding: 6px 10px !important; }
.goog-te-gadget-simple .goog-te-menu-value span { color: var(--text-primary) !important; }

/* Hide sidebar overlay on mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 199;
}
@media (max-width: 768px) {
  .sidebar.mobile-open ~ .sidebar-overlay { display: block; }
}

/* ═══════════════════════════════════════════════════════
   LANDING PAGE - Hacker Electronics Style
   ═══════════════════════════════════════════════════════ */

.landing {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.landing.exit {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
.landing.hidden { display: none; }

/* Matrix Rain */
.matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.12;
}

/* CRT Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Landing Circuit Traces */
.landing-circuits {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.lc-svg { width: 100%; height: 100%; }
.lc-trace {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: lcDraw 6s ease-in-out infinite;
}
.lc-t1 { animation-delay: 0s; }
.lc-t2 { animation-delay: 0.8s; }
.lc-t3 { animation-delay: 1.6s; }
.lc-t4 { animation-delay: 2.4s; }
.lc-t5 { animation-delay: 3.2s; }
@keyframes lcDraw {
  0% { stroke-dashoffset: 1500; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -1500; opacity: 0.4; }
}
.lc-node {
  animation: lcPulse 2.5s ease-in-out infinite;
}
@keyframes lcPulse {
  0%, 100% { opacity: 0.3; r: 3; }
  50% { opacity: 1; r: 6; }
}
.lc-comp {
  animation: lcPulse 3.5s ease-in-out infinite;
}

/* Main Content */
.landing-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px;
  max-width: 700px;
  width: 100%;
}

/* Terminal bar */
.landing-terminal-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  padding: 6px 14px;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.term-dots {
  display: flex;
  gap: 5px;
}
.term-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.term-dots span:nth-child(1) { background: #ff5f57; }
.term-dots span:nth-child(2) { background: #febc2e; }
.term-dots span:nth-child(3) { background: #28c840; }
.term-title { color: var(--neon-green); }

/* Logo */
.landing-logo-wrap {
  position: relative;
  margin-bottom: 16px;
  display: inline-block;
}
.landing-logo {
  font-family: 'Orbitron', monospace;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #00f0ff 0%, #00ff88 40%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation: logoGlow 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.3));
}

/* Glitch effect */
.landing-logo::before,
.landing-logo::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #00f0ff 0%, #00ff88 40%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-logo::before {
  animation: glitch1 3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.landing-logo::after {
  animation: glitch2 3s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: none; }
  92% { transform: translate(-3px, -1px) skewX(-1deg); }
  94% { transform: translate(3px, 1px) skewX(1deg); }
  96% { transform: translate(-2px, 0); }
}
@keyframes glitch2 {
  0%, 90%, 100% { transform: none; }
  91% { transform: translate(3px, 1px) skewX(1deg); }
  93% { transform: translate(-3px, -1px); }
  95% { transform: translate(2px, 0) skewX(-1deg); }
}

@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.3)); }
  50% { filter: drop-shadow(0 0 60px rgba(0, 240, 255, 0.6)) drop-shadow(0 0 120px rgba(0, 255, 136, 0.2)); }
}

.landing-version {
  position: absolute;
  top: 0;
  right: -40px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  animation: versionBlink 2s infinite;
}
@keyframes versionBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Typing tagline */
.landing-tagline-wrap {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--neon-green);
  margin-bottom: 12px;
  min-height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.landing-bracket {
  color: var(--text-muted);
  font-weight: 600;
}
.landing-tagline {
  color: var(--neon-green);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}
.landing-cursor {
  color: var(--neon-green);
  animation: cursorBlink 0.7s step-end infinite;
  font-weight: 600;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Description */
.landing-desc {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-secondary);
  margin-bottom: 36px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 300;
}

/* Feature Grid */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.lf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  cursor: default;
}
.lf-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.1);
}
.lf-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-radius: 6px;
}
.lf-green { color: var(--neon-green); background: rgba(0, 255, 136, 0.08); }
.lf-purple { color: var(--neon-purple); background: rgba(168, 85, 247, 0.08); }
.lf-orange { color: var(--neon-orange); background: rgba(249, 115, 22, 0.08); }

/* Powered By */
.landing-powered {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lp-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.lp-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lp-badge {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 2px;
}
.lp-groq {
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.3);
}
.lp-claude {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.lp-plus {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* CTA Button */
.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 40px;
  background: transparent;
  border: 2px solid var(--neon-cyan);
  border-radius: 4px;
  color: var(--neon-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 28px;
  clear: both;
}
.landing-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.15), transparent);
  transition: left 0.6s ease;
}
.landing-cta:hover::before {
  left: 100%;
}
.landing-cta:hover {
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3), inset 0 0 40px rgba(0, 240, 255, 0.05);
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.cta-arrow {
  display: flex;
  animation: ctaArrow 1.5s ease-in-out infinite;
}
@keyframes ctaArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* Boot Sequence */
.landing-boot {
  text-align: left;
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}
.boot-line {
  opacity: 0;
  animation: bootFade 0.5s ease forwards;
  animation-delay: calc(var(--delay) * 0.4s + 1s);
  margin-bottom: 3px;
}
@keyframes bootFade {
  to { opacity: 1; }
}
.boot-ok {
  color: var(--neon-green);
  font-weight: 600;
}

/* Hex Pattern Bottom */
.landing-hex {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0, 240, 255, 0.03), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Landing Entry Animation */
.landing-content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: landingFadeUp 0.6s ease forwards;
}
.landing-content > *:nth-child(1) { animation-delay: 0.2s; }
.landing-content > *:nth-child(2) { animation-delay: 0.4s; }
.landing-content > *:nth-child(3) { animation-delay: 0.6s; }
.landing-content > *:nth-child(4) { animation-delay: 0.8s; }
.landing-content > *:nth-child(5) { animation-delay: 1.0s; }
.landing-content > *:nth-child(6) { animation-delay: 1.2s; }
.landing-content > *:nth-child(7) { animation-delay: 1.4s; }
.landing-content > *:nth-child(8) { animation-delay: 1.6s; }

@keyframes landingFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Oscilloscope Canvas */
.scope-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
  z-index: 1;
  pointer-events: none;
}

/* Grid Overlay */
.landing-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  pointer-events: none;
}

/* HUD Corners */
.hud-corner {
  position: absolute;
  width: 60px;
  height: 60px;
  z-index: 5;
  pointer-events: none;
}
.hud-tl { top: 20px; left: 20px; border-top: 2px solid rgba(0, 240, 255, 0.4); border-left: 2px solid rgba(0, 240, 255, 0.4); }
.hud-tr { top: 20px; right: 20px; border-top: 2px solid rgba(0, 240, 255, 0.4); border-right: 2px solid rgba(0, 240, 255, 0.4); }
.hud-bl { bottom: 20px; left: 20px; border-bottom: 2px solid rgba(0, 240, 255, 0.4); border-left: 2px solid rgba(0, 240, 255, 0.4); }
.hud-br { bottom: 20px; right: 20px; border-bottom: 2px solid rgba(0, 240, 255, 0.4); border-right: 2px solid rgba(0, 240, 255, 0.4); }

/* HUD Side Readouts */
.hud-side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.hud-left { left: 20px; }
.hud-right { right: 20px; align-items: flex-end; text-align: right; }
.hud-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hud-right .hud-readout { align-items: flex-end; }
.hud-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(0, 240, 255, 0.4);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.hud-value {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.hud-value {
  transition: opacity 0.3s ease;
}
.hud-ok {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}
.hud-bar {
  width: 80px;
  height: 3px;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.hud-bar-fill {
  height: 100%;
  width: 60%;
  background: var(--neon-cyan);
  border-radius: 2px;
  animation: hudBarPulse 3s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  transition: width 1s ease;
}
.hud-bar-green {
  background: var(--neon-green);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
  width: 85%;
}
@keyframes hudBarPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Floating Electronics Symbols */
.floating-symbols {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.float-sym {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  opacity: 0;
  animation: floatSymbol linear infinite;
  pointer-events: none;
  text-shadow: 0 0 8px currentColor;
}
@keyframes floatSymbol {
  0% { opacity: 0; transform: translateY(100vh) rotate(0deg); }
  10% { opacity: 0.25; }
  90% { opacity: 0.25; }
  100% { opacity: 0; transform: translateY(-10vh) rotate(360deg); }
}

/* Voltage Status Bar */
.landing-voltage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 20px;
  padding: 5px 16px;
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
}
.lv-label {
  color: rgba(0, 240, 255, 0.5);
  font-weight: 600;
}
.lv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  animation: lvDotPulse 2s ease-in-out infinite;
}
.lv-dot-green {
  background: var(--neon-green);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}
.lv-dot-purple {
  background: var(--neon-purple);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}
@keyframes lvDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.lv-text {
  color: var(--text-secondary);
}
.lv-sep {
  color: rgba(255, 255, 255, 0.1);
}

/* Electric Ring around Logo */
.logo-electric-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 50%;
  animation: ringPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.logo-electric-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 50%;
  animation: ringPulse 4s ease-in-out infinite reverse;
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); }
}

/* Logo Zap Symbols */
.logo-zap {
  font-size: 0.4em;
  position: relative;
  display: inline-block;
  animation: zapFlicker 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.6));
}
.logo-zap-l { margin-right: 6px; }
.logo-zap-r { margin-left: 6px; }
@keyframes zapFlicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  30% { opacity: 0.3; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.1); }
  80% { opacity: 0.5; }
}

/* Landing Subtitle */
.landing-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.4);
  margin-bottom: 8px;
  font-weight: 400;
}

/* Enhanced Feature Text */
.lf-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lf-name {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-primary);
}
.lf-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* CTA Wrapper with Ring */
.cta-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 28px;
}
.cta-ring {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  animation: ctaRingPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ctaRingPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

/* Boot Prompt */
.boot-prompt {
  color: var(--neon-cyan);
  font-weight: 700;
  margin-right: 6px;
}
.boot-final {
  color: var(--neon-green) !important;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

/* Landing Responsive */
@media (max-width: 768px) {
  .landing-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .landing-cta {
    padding: 14px 28px;
    font-size: 0.85rem;
    letter-spacing: 2px;
  }
  .landing-version {
    right: -30px;
    font-size: 0.6rem;
  }
  .landing-powered {
    flex-direction: column;
    gap: 6px;
  }
  .hud-side { display: none; }
  .hud-corner { width: 40px; height: 40px; }
  .landing-subtitle { letter-spacing: 3px; }
}
@media (max-width: 480px) {
  .landing-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .lf-item {
    padding: 8px 10px;
    font-size: 0.68rem;
  }
  .lf-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }
  .lf-icon svg {
    width: 16px;
    height: 16px;
  }
  .landing-cta {
    padding: 12px 24px;
    font-size: 0.78rem;
  }
  .landing-boot {
    font-size: 0.6rem;
  }
  .hud-corner { display: none; }
  .landing-voltage { font-size: 0.55rem; gap: 5px; padding: 4px 10px; }
  .landing-subtitle { letter-spacing: 2px; font-size: 0.55rem; }
  .landing-cta { width: 100%; text-align: center; justify-content: center; }
  .cta-wrap { width: calc(100% - 40px); }
  .landing-boot { font-size: 0.58rem; max-width: 280px; }
  .logo-electric-ring { width: 110%; height: 110%; }
}

/* ═══════ ULTRA-SMALL PHONES (320px) ═══════ */
@media (max-width: 360px) {
  .page { padding: 12px 10px; }
  .page-title { font-size: 1.3rem; }
  .page-subtitle { font-size: 0.82rem; }

  /* Home */
  .quick-grid { grid-template-columns: 1fr; gap: 8px; }
  .action-card { padding: 14px 12px; display: flex; align-items: center; gap: 12px; }
  .action-card .action-icon { margin-bottom: 0; }
  .stats-row { flex-direction: column; }
  .stat-pill { min-width: 100%; padding: 10px; }
  .stat-val { font-size: 1rem; }
  .feature-pills { gap: 4px; }
  .f-pill { padding: 5px 8px; font-size: 0.68rem; }

  /* Chat */
  .chat-wrapper { height: calc(100vh - 74px); }
  .chat-header h3 { font-size: 0.8rem; }
  .message { max-width: 92%; }
  .message-content { padding: 10px 12px; font-size: 0.82rem; }
  .quick-actions { padding: 8px 10px; gap: 4px; }
  .quick-btn { padding: 6px 10px; font-size: 0.7rem; }
  .chat-input-container { padding: 8px 10px; }

  /* Wizard */
  .wizard-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wizard-card { padding: 14px 10px; font-size: 0.78rem; }
  .wiz-icon { font-size: 1.6rem; }

  /* Tools */
  .tools-tabs { gap: 4px; }
  .tool-tab { padding: 6px 12px; font-size: 0.72rem; }
  .tool-content { padding: 16px 12px; }
  .tool-result-value { font-size: 1.2rem; }
  .resistor-body { width: 140px; height: 40px; }
  .band { width: 10px; height: 32px; }

  /* Visual */
  .upload-zone { padding: 16px; min-height: 140px; }
  .device-chips { gap: 5px; }
  .chip-btn { padding: 5px 10px; font-size: 0.72rem; }

  /* Landing */
  .landing-features { grid-template-columns: 1fr; gap: 5px; max-width: 260px; }
  .lf-item { padding: 8px 12px; }
  .landing-logo { letter-spacing: 1px; }
  .landing-version { right: -20px; font-size: 0.5rem; padding: 1px 5px; }
  .landing-voltage { flex-wrap: wrap; justify-content: center; padding: 4px 8px; gap: 3px; }
  .landing-cta { padding: 10px 16px; font-size: 0.7rem; letter-spacing: 1px; }
  .landing-boot { font-size: 0.52rem; max-width: 240px; }
  .landing-desc { font-size: 0.78rem; letter-spacing: 1px; margin-bottom: 24px; }
  .landing-powered { gap: 4px; }
  .lp-badge { font-size: 0.6rem; padding: 3px 8px; }

  /* Modal */
  .modal { padding: 20px 16px; }
  .modal h2 { font-size: 1rem; }
  .auth-input { padding: 9px 10px; font-size: 0.82rem; }

  /* Settings */
  .settings-group { padding: 14px; }
  .settings-group h3 { font-size: 0.88rem; }
}

/* ═══════════════════════════════════════════════════════
   v3.0 BEAST MODE - 5 New Mega-Pages Themes
   ═══════════════════════════════════════════════════════ */

/* --- New CSS Vars --- */
:root {
  --neon-red: #ff3366;
  --neon-gold: #ffaa00;
}

/* --- New page accent colors --- */
#page-lab { --page-accent: #ff3366; }
#page-repair { --page-accent: #ffaa00; }
#page-market { --page-accent: #00ff88; }
#page-pro { --page-accent: #ff6b35; }
#page-trade { --page-accent: #a855f7; }

/* --- New icon colors for home cards --- */
.icon-red { background: rgba(255, 51, 102, 0.1); color: var(--neon-red); }
.icon-gold { background: rgba(255, 170, 0, 0.1); color: var(--neon-gold); }

/* --- Status strip shared (reused from tools-status-strip) --- */
.lab-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: rgba(25, 5, 10, 0.5);
  border: 1px solid rgba(255, 51, 102, 0.08);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255, 51, 102, 0.4);
  letter-spacing: 1px;
  overflow-x: auto;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* --- New pages need position relative for canvas/overlays --- */
#page-lab, #page-repair, #page-market, #page-pro, #page-trade {
  position: relative;
  overflow: hidden;
}

/* Canvas opacity for new pages */
#labCanvas { opacity: 0.12; }
#repairCanvas { opacity: 0.10; }
#marketCanvas { opacity: 0.14; }
#proCanvas { opacity: 0.10; }
#tradeCanvas { opacity: 0.12; }

/* ── BEAST LAB — Red/Crimson Theme ── */
#page-lab {
  background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(255, 51, 102, 0.04), transparent);
}
#page-lab::before {
  content: 'BEAST LAB // STRESS TEST MODE';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(255, 51, 102, 0.25);
  animation: signalBlink 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
#page-lab .page-title { text-shadow: 0 0 20px rgba(255, 51, 102, 0.15); }
#page-lab .title-accent { background: linear-gradient(135deg, #ff3366, #ff6699); -webkit-background-clip: text; background-clip: text; }
#page-lab .tool-tab.active { background: rgba(255, 51, 102, 0.1); border-color: #ff3366; color: #ff3366; }
#page-lab .tool-tab.active::after { background: #ff3366; box-shadow: 0 0 8px rgba(255, 51, 102, 0.5); }
#page-lab .tool-content { border-color: rgba(255, 51, 102, 0.06); }
#page-lab .tool-title { color: #ff3366; }
#page-lab .tool-result-value { color: #ff3366; text-shadow: 0 0 12px rgba(255, 51, 102, 0.3); }

/* ── REPAIR HUB — Gold Theme ── */
#page-repair {
  background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(255, 170, 0, 0.04), transparent);
}
#page-repair::before {
  content: 'REPAIR HUB // DIAGNOSTIC MODE';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(255, 170, 0, 0.25);
  animation: signalBlink 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
#page-repair .page-title { text-shadow: 0 0 20px rgba(255, 170, 0, 0.15); }
#page-repair .title-accent { background: linear-gradient(135deg, #ffaa00, #ffcc44); -webkit-background-clip: text; background-clip: text; }
#page-repair .tool-tab.active { background: rgba(255, 170, 0, 0.1); border-color: #ffaa00; color: #ffaa00; }
#page-repair .tool-tab.active::after { background: #ffaa00; box-shadow: 0 0 8px rgba(255, 170, 0, 0.5); }
#page-repair .tool-content { border-color: rgba(255, 170, 0, 0.06); }
#page-repair .tool-title { color: #ffaa00; }
#page-repair .tool-result-value { color: #ffaa00; text-shadow: 0 0 12px rgba(255, 170, 0, 0.3); }

/* ── MARKET HUB — Green Theme ── */
#page-market {
  background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(0, 255, 136, 0.04), transparent);
}
#page-market::before {
  content: 'MARKET HUB // LIVE PRICING';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(0, 255, 136, 0.25);
  animation: signalBlink 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
#page-market .page-title { text-shadow: 0 0 20px rgba(0, 255, 136, 0.15); }
#page-market .title-accent { background: linear-gradient(135deg, #00ff88, #4ade80); -webkit-background-clip: text; background-clip: text; }
#page-market .tool-tab.active { background: rgba(0, 255, 136, 0.1); border-color: #00ff88; color: #00ff88; }
#page-market .tool-tab.active::after { background: #00ff88; box-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
#page-market .tool-content { border-color: rgba(0, 255, 136, 0.06); }
#page-market .tool-title { color: #00ff88; }
#page-market .tool-result-value { color: #00ff88; text-shadow: 0 0 12px rgba(0, 255, 136, 0.3); }

/* ── PRO TOOLS — Orange Theme ── */
#page-pro {
  background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(255, 107, 53, 0.04), transparent);
}
#page-pro::before {
  content: 'PRO TOOLS // ENGINEERING MODE';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(255, 107, 53, 0.25);
  animation: signalBlink 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
#page-pro .page-title { text-shadow: 0 0 20px rgba(255, 107, 53, 0.15); }
#page-pro .title-accent { background: linear-gradient(135deg, #ff6b35, #ff9966); -webkit-background-clip: text; background-clip: text; }
#page-pro .tool-tab.active { background: rgba(255, 107, 53, 0.1); border-color: #ff6b35; color: #ff6b35; }
#page-pro .tool-tab.active::after { background: #ff6b35; box-shadow: 0 0 8px rgba(255, 107, 53, 0.5); }
#page-pro .tool-content { border-color: rgba(255, 107, 53, 0.06); }
#page-pro .tool-title { color: #ff6b35; }
#page-pro .tool-result-value { color: #ff6b35; text-shadow: 0 0 12px rgba(255, 107, 53, 0.3); }

/* ── TRADE & LOCATE — Purple Theme ── */
#page-trade {
  background: radial-gradient(ellipse 600px 400px at 50% 30%, rgba(168, 85, 247, 0.04), transparent);
}
#page-trade::before {
  content: 'TRADE // LOCATE // COMPLY';
  position: absolute;
  top: 12px; right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: rgba(168, 85, 247, 0.25);
  animation: signalBlink 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
#page-trade .page-title { text-shadow: 0 0 20px rgba(168, 85, 247, 0.15); }
#page-trade .title-accent { background: linear-gradient(135deg, #a855f7, #c084fc); -webkit-background-clip: text; background-clip: text; }
#page-trade .tool-tab.active { background: rgba(168, 85, 247, 0.1); border-color: #a855f7; color: #a855f7; }
#page-trade .tool-tab.active::after { background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.5); }
#page-trade .tool-content { border-color: rgba(168, 85, 247, 0.06); }
#page-trade .tool-title { color: #a855f7; }
#page-trade .tool-result-value { color: #a855f7; text-shadow: 0 0 12px rgba(168, 85, 247, 0.3); }

/* --- Mini Upload Zone (for vision features within tabs) --- */
.mini-upload-zone {
  border: 2px dashed rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 14px;
}
.mini-upload-zone:hover { border-color: var(--page-accent, var(--neon-cyan)); background: rgba(255,255,255,0.02); }
.mini-upload-zone .upload-icon { color: var(--text-muted); margin-bottom: 8px; }
.mini-upload-zone p { font-size: 0.82rem; color: var(--text-secondary); }
.mini-upload-zone img { max-width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-top: 8px; }

/* --- Mobile: hide new page effects --- */
@media (max-width: 768px) {
  #page-lab::before, #page-repair::before, #page-market::before,
  #page-pro::before, #page-trade::before { display: none; }
  .lab-status-strip { font-size: 0.55rem; gap: 6px; padding: 6px 8px; }
}

/* ═══════ SAFE AREA INSETS (Notched Phones) ═══════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
  .chat-input-container {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  @media (max-width: 768px) {
    .main-content {
      padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
  }
  .modal-overlay {
    padding: env(safe-area-inset-top, 20px) 20px env(safe-area-inset-bottom, 20px);
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ═══════ TOUCH TARGETS (min 44x44px) ═══════ */
@media (pointer: coarse) {
  .nav-item { min-height: 44px; }
  .bottom-item { min-height: 44px; min-width: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .voice-btn { min-width: 44px; min-height: 44px; }
  .send-btn { min-width: 44px; min-height: 44px; }
  .chip-btn { min-height: 44px; }
  .wizard-card { min-height: 44px; }
  .tool-tab { min-height: 44px; }
  .quick-btn { min-height: 38px; }
  .btn-remove { min-width: 44px; min-height: 44px; }
  .modal-close { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .toggle-switch { min-width: 48px; min-height: 44px; display: inline-flex; align-items: center; }
}

/* ═══════ LANDSCAPE PHONES ═══════ */
@media (orientation: landscape) and (max-height: 500px) {
  .chat-wrapper { height: calc(100vh - 20px); }
  .page { padding: 10px 16px; }
  .page-header { margin-bottom: 12px; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats-row { margin-bottom: 12px; }
  .landing-content { padding: 10px; }
  .landing-logo { font-size: clamp(2rem, 8vw, 3.5rem); }
  .landing-features { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .landing-desc { margin-bottom: 16px; }
  .landing-boot { display: none; }
  .landing-cta { padding: 10px 24px; font-size: 0.8rem; margin-bottom: 12px; }
  .cta-wrap { margin-bottom: 12px; }
  .landing-powered { margin-bottom: 12px; }
  .bottom-nav { padding: 4px 0; }
  .bottom-item { padding: 4px 2px; gap: 1px; }
  .bottom-item span { font-size: 0.55rem; }
}
