/* ==============================================================================
   MONCD OS v2.0 - DASHBOARD CSS (Cyberpunk Theme)
   ============================================================================== */

:root {
  --bg-deep: #04060e;
  --bg-panel: #0a0d1e;
  --bg-card: #121733;
  --border-color: #1c224a;
  --border-neon-cyan: rgba(0, 170, 255, 0.4);
  
  --neon-cyan: #00aaff;
  --neon-magenta: #8f00ff;
  --neon-green: #39ff14;
  --neon-yellow: #fffb00;
  
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-hud: 'Rajdhani', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Source Code Pro', monospace;
  
  --glow-cyan: 0 0 8px rgba(0, 170, 255, 0.6);
  --glow-magenta: 0 0 8px rgba(143, 0, 255, 0.6);
  --glow-green: 0 0 8px rgba(57, 255, 20, 0.6);
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  font-size: 15px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Layout container */
.cyber-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background-image: 
    radial-gradient(at 50% 0%, rgba(30, 41, 59, 0.2) 0, transparent 70%),
    linear-gradient(rgba(18, 18, 18, 0.05) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 100%, 100% 4px, 6px 100%;
}

/* Header HUD Bar */
.hud-header {
  height: 60px;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
  animation: pulse 2s infinite;
}

.header-logo h1 {
  font-family: var(--font-hud);
  font-size: 1.45rem;
  letter-spacing: 2px;
  font-weight: 700;
}

.accent-text {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.status-label {
  font-family: var(--font-hud);
  color: var(--text-muted);
}

.status-value {
  font-family: var(--font-mono);
  color: var(--neon-magenta);
  text-shadow: var(--glow-magenta);
}

.status-value.active {
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}

/* Main Workspace Layout */
.workspace {
  display: flex;
  flex: 1;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Sidebar Control Panel */
.control-panel {
  width: 380px;
  background: var(--bg-panel);
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 5;
  transition: margin-left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-panel.collapsed-sidebar {
  margin-left: -380px;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  left: 380px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  background: rgba(15, 17, 26, 0.85);
  border: 1px solid var(--border-color);
  border-left: none;
  color: var(--neon-cyan);
  width: 24px;
  height: 60px;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  text-shadow: var(--glow-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4), 3px 0 10px rgba(0, 0, 0, 0.5);
  width: 28px;
}

.sidebar-toggle-btn.collapsed {
  left: 0;
  border-left: 1px solid var(--border-color);
}

/* Navigation Tabs */
.hud-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-hud);
  font-size: 0.75rem;
  padding: 12px 6px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-btn:hover {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  text-shadow: var(--glow-cyan);
}

/* Tab contents */
.tab-content {
  display: none;
  padding: 20px;
  flex-direction: column;
  gap: 20px;
}

.tab-content.active {
  display: flex;
}

/* Panel Sections */
.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0; /* Prevent collapsing in flex containers under small viewports */
}

.panel-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
}

.panel-section h3 {
  font-family: var(--font-hud);
  font-size: 1.05rem; /* Increased size to match Rajdhani's scale */
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
}

.panel-section h3::after {
  content: '\f107'; /* FontAwesome chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.panel-section.collapsed h3::after {
  transform: rotate(-90deg); /* Points left when collapsed */
}

.panel-section.collapsed {
  padding-bottom: 12px;
}

.panel-section.collapsed h3 {
  margin-bottom: 0;
}

.panel-section.collapsed > *:not(h3) {
  display: none !important;
}

/* Common inputs & controls */
.input-group {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.input-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.input-group-vertical label {
  font-size: 0.75rem;
  font-family: var(--font-hud);
  color: var(--text-secondary);
}

input[type="text"], select, textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 2px;
  outline: none;
  transition: all 0.3s;
  width: 100%;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

button {
  cursor: pointer;
  outline: none;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-hud);
  font-size: 0.75rem;
  padding: 10px 14px;
  letter-spacing: 1px;
  border-radius: 2px;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.action-btn:hover {
  background: var(--neon-cyan);
  color: var(--bg-deep);
  box-shadow: var(--glow-cyan);
}

.action-btn.primary {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
}

.action-btn.secondary {
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
}

.action-btn.secondary:hover {
  background: var(--neon-magenta);
  color: var(--bg-deep);
  box-shadow: var(--glow-magenta);
}

.action-btn.alert {
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
}

.action-btn.alert:hover {
  background: var(--neon-yellow);
  color: var(--bg-deep);
  box-shadow: 0 0 8px rgba(255, 251, 0, 0.6);
}

.action-btn.disabled, button:disabled {
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  background: transparent !important;
  box-shadow: none !important;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.action-buttons .action-btn {
  flex: 1;
}

/* Custom Checkbox */
.filter-group {
  margin-top: 12px;
}

.checkbox-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 24px;
  cursor: pointer;
  font-size: 0.8rem;
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 1px;
  left: 0;
  height: 14px;
  width: 14px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  transition: all 0.2s;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--neon-cyan);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.checkmark.note-chk { border-color: #af40ff; }
.checkmark.module-chk { border-color: var(--neon-cyan); }
.checkmark.class-chk { border-color: var(--neon-magenta); }
.checkmark.func-chk { border-color: var(--neon-green); }
.checkmark.lib-chk { border-color: var(--neon-yellow); }

.custom-checkbox input:checked ~ .checkmark.note-chk { background-color: #af40ff; }
.custom-checkbox input:checked ~ .checkmark.module-chk { background-color: var(--neon-cyan); }
.custom-checkbox input:checked ~ .checkmark.class-chk { background-color: var(--neon-magenta); }
.custom-checkbox input:checked ~ .checkmark.func-chk { background-color: var(--neon-green); }
.custom-checkbox input:checked ~ .checkmark.lib-chk { background-color: var(--neon-yellow); }

/* Node Inspector Panel */
.info-msg {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.details-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 5px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.node-badge {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--neon-cyan);
  color: var(--bg-deep);
  font-weight: bold;
}

.node-badge.Class { background: var(--neon-magenta); }
.node-badge.Function { background: var(--neon-green); }
.node-badge.Library { background: var(--neon-yellow); }
.node-badge.Note { background: #af40ff; color: #fff; }

#inspect-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-hud);
}

.detail-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--text-primary);
}

.detail-code-block {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border: 1px solid var(--border-color);
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--neon-cyan);
}

/* Terminal Log */
.description-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.action-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terminal-container {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: #050608;
}

.terminal-header {
  background: #0a0c12;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.terminal-buttons {
  display: flex;
  gap: 4px;
}

.t-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.t-dot.red { background: #ff5555; }
.t-dot.yellow { background: #ffb86c; }
.t-dot.green { background: #50fa7b; }

.terminal-body {
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #50fa7b;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.3;
}

/* AI Skills Tab controls */
.brand-select {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-family: var(--font-hud);
  color: var(--text-secondary);
}

.brand-select select {
  width: 60%;
}

/* Interactive Voice Communicator Terminal styling */
#voice-communicator-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-activation-container {
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.selectors-wrapper-voice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 5px;
}

.selectors-wrapper-voice .model-select-container {
  margin: 0;
  padding: 6px 12px;
}

.model-select-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 5px 0;
}

.model-select-container select {
  width: 60%;
  font-family: var(--font-hud);
  background: var(--bg-deep);
  color: var(--neon-cyan);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 4px;
}

.voice-dashboard-container {
  border: 1px solid var(--border-color);
  background: rgba(10, 11, 16, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 6px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  position: relative;
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.voice-dashboard-container.deactivated {
  opacity: 0.3;
  pointer-events: none;
  filter: blur(1px) grayscale(50%);
}

/* Cybernetic Visualizer Orb */
.visualizer-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 16, 0.8);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.visualizer-orb .inner-core {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--neon-cyan) 0%, rgba(0, 240, 255, 0.1) 70%);
  transition: all 0.5s ease;
}

.visualizer-orb .ring {
  position: absolute;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 50%;
  transition: all 0.5s ease;
}

.visualizer-orb .ring-1 {
  width: 48px;
  height: 48px;
}

.visualizer-orb .ring-2 {
  width: 56px;
  height: 56px;
}

/* State: Standby (Pulsing slow cyan) */
.visualizer-orb.standby {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  animation: orb-breath-cyan 3s infinite ease-in-out;
}
.visualizer-orb.standby .inner-core {
  background: radial-gradient(circle, var(--neon-cyan) 0%, rgba(0, 240, 255, 0.2) 75%);
}
.visualizer-orb.standby .ring {
  border-color: rgba(0, 240, 255, 0.15);
}

/* State: Listening (Rapid pulsing magenta/red) */
.visualizer-orb.listening {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 30px rgba(255, 0, 127, 0.7);
  animation: orb-rapid-magenta 0.8s infinite ease-in-out;
}
.visualizer-orb.listening .inner-core {
  background: radial-gradient(circle, var(--neon-magenta) 0%, rgba(255, 0, 127, 0.3) 75%);
}
.visualizer-orb.listening .ring {
  border-color: rgba(255, 0, 127, 0.3);
  animation: orb-ring-expand 0.8s infinite linear;
}

/* State: Thinking (Spinning loader pattern) */
.visualizer-orb.thinking {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}
.visualizer-orb.thinking .inner-core {
  background: radial-gradient(circle, #fff 0%, rgba(0, 240, 255, 0.2) 75%);
  transform: scale(0.8);
}
.visualizer-orb.thinking .ring-1 {
  border: 2px dashed var(--neon-cyan);
  animation: orb-spin-clockwise 2s infinite linear;
}
.visualizer-orb.thinking .ring-2 {
  border: 2px dashed var(--neon-magenta);
  animation: orb-spin-counter 3s infinite linear;
}

/* State: Speaking (equalizer waveform visualizer) */
.visualizer-orb.speaking {
  border-color: var(--neon-green);
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.6);
  animation: orb-breath-green 1.5s infinite ease-in-out;
}
.visualizer-orb.speaking .inner-core {
  background: radial-gradient(circle, var(--neon-green) 0%, rgba(57, 255, 20, 0.2) 75%);
  transform: scale(1.1);
}
.visualizer-orb.speaking .ring {
  border-color: rgba(57, 255, 20, 0.2);
}

.voice-status-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.3s ease;
}

.voice-status-display.status-deactivated .status-indicator-dot { background: #64748b; }
.voice-status-display.status-standby .status-indicator-dot { background: var(--neon-cyan); box-shadow: 0 0 5px var(--neon-cyan); }
.voice-status-display.status-listening .status-indicator-dot { background: var(--neon-magenta); box-shadow: 0 0 5px var(--neon-magenta); }
.voice-status-display.status-thinking .status-indicator-dot { background: var(--neon-cyan); box-shadow: 0 0 5px var(--neon-cyan); }
.voice-status-display.status-speaking .status-indicator-dot { background: var(--neon-green); box-shadow: 0 0 5px var(--neon-green); }

/* Equalizer Bars */
.equalizer-container {
  display: flex;
  align-items: flex-end;
  height: 25px;
  gap: 3px;
  margin-top: 5px;
}

.equalizer-container .bar {
  width: 3px;
  height: 100%;
  background-color: var(--neon-green);
  border-radius: 2px;
  animation: eq-bounce 1s infinite alternate;
  box-shadow: 0 0 3px rgba(57, 255, 20, 0.4);
}

.equalizer-container .bar:nth-child(2) { animation-delay: 0.15s; }
.equalizer-container .bar:nth-child(3) { animation-delay: 0.3s; }
.equalizer-container .bar:nth-child(4) { animation-delay: 0.05s; }
.equalizer-container .bar:nth-child(5) { animation-delay: 0.4s; }
.equalizer-container .bar:nth-child(6) { animation-delay: 0.2s; }
.equalizer-container .bar:nth-child(7) { animation-delay: 0.35s; }
.equalizer-container .bar:nth-child(8) { animation-delay: 0.1s; }

/* PushtoTalk Control key */
.mic-control-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mic-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--neon-magenta);
  color: var(--neon-magenta);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.1);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-btn:hover:not(:disabled) {
  background: var(--neon-magenta);
  color: var(--bg-deep);
  box-shadow: var(--glow-magenta);
  transform: scale(1.05);
}

.mic-btn:active:not(:disabled) {
  transform: scale(0.95);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.8);
}

.mic-btn.active-record {
  background: var(--neon-magenta);
  color: var(--bg-deep);
  box-shadow: var(--glow-magenta);
  border-color: var(--neon-magenta);
  animation: blink 1s infinite alternate;
}

.mic-btn.disabled, .mic-btn:disabled {
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  background: transparent !important;
}

#recording-timer-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-magenta);
}

.timer-blink {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-magenta);
  animation: blink 1s infinite;
}

/* Dialog Console Stream */
.dialogue-console-container {
  width: 100%;
}

.dialogue-console-container h4 {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.dialogue-console {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  height: 120px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
}

/* MayerLab takes over the workspace for focused batch research. */
.mayerlab-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mayerlab-fullscreen-active .graph-canvas-container,
.mayerlab-fullscreen-active .sidebar-toggle-btn,
.mayerlab-fullscreen-active .sliding-drawer {
  display: none !important;
}

#sidebar.mayerlab-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  z-index: 10000;
  overflow: hidden;
}

#sidebar.mayerlab-fullscreen > :not(#mayerlab-workspace-module) {
  display: none !important;
}

#sidebar.mayerlab-fullscreen #mayerlab-workspace-module {
  display: flex;
  flex: 1;
  min-height: 0;
}

#sidebar.mayerlab-fullscreen #mayerlab-workspace-module > .panel-section {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 24px min(8vw, 140px);
}

#sidebar.mayerlab-fullscreen #mayerlab-workspace-console {
  height: auto !important;
  flex: 1;
  min-height: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

#sidebar.mayerlab-fullscreen .dialogue-console-container {
  display: flex;
  min-height: 0;
  flex: 1;
}

@media (max-width: 700px) {
  #sidebar.mayerlab-fullscreen #mayerlab-workspace-module > .panel-section {
    padding: 16px;
  }

  .mayerlab-workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.console-line {
  word-break: break-word;
}

.console-line.user-line {
  color: var(--neon-cyan);
}

.console-line.agent-line {
  color: var(--text-primary);
  border-left: 2px solid var(--neon-cyan);
  padding-left: 6px;
}

.console-line.system-line {
  color: var(--text-muted);
  font-style: italic;
}

/* Collapsible Manual TTS utility styling */
.manual-tts-container {
  width: 100%;
  border-top: 1px solid var(--border-color);
  margin-top: 5px;
  padding-top: 10px;
}

.manual-tts-header {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s;
}

.manual-tts-header:hover {
  color: var(--text-secondary);
}

.manual-tts-container.collapsed .manual-tts-body {
  display: none;
}

.manual-tts-container.collapsed .fold-icon {
  transform: rotate(-90deg);
}

.manual-tts-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-tts-body textarea {
  height: 60px;
}

.fold-icon {
  transition: transform 0.3s ease;
}

/* Keyframes Animations */
@keyframes orb-breath-cyan {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(0, 240, 255, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(0, 240, 255, 0.6); }
}

@keyframes orb-rapid-magenta {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 0, 127, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 35px rgba(255, 0, 127, 0.8); }
}

@keyframes orb-breath-green {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(57, 255, 20, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 30px rgba(57, 255, 20, 0.7); }
}

@keyframes orb-ring-expand {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes orb-spin-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orb-spin-counter {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes eq-bounce {
  0% { height: 15%; }
  100% { height: 100%; }
}

.image-output-container {
  margin-top: 15px;
  border: 1px dashed var(--border-color);
  padding: 10px;
  border-radius: 2px;
}

.image-wrapper {
  background: #000;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  border-radius: 2px;
  overflow: hidden;
}

.image-wrapper img {
  max-width: 100%;
  max-height: 250px;
  display: block;
}

.download-link {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
}

.download-link:hover {
  text-shadow: var(--glow-cyan);
  color: var(--text-primary);
}

/* Canvas Viewport Area */
.graph-canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-deep);
}

#cy {
  flex: 1;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at center, rgba(15, 23, 42, 0.5) 0%, rgba(7, 8, 13, 0.95) 100%),
    radial-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    radial-gradient(rgba(0, 240, 255, 0.2) 1.5px, transparent 1.5px),
    radial-gradient(rgba(255, 0, 127, 0.15) 1px, transparent 1px);
  background-size: 100% 100%, 80px 80px, 180px 180px, 240px 240px;
  background-position: 0 0, 10px 10px, 50px 70px, 120px 150px;
}

/* HUD Overlay on Canvas */
.canvas-overlay {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  pointer-events: none;
}

.canvas-controls {
  display: flex;
  gap: 6px;
  background: rgba(15, 17, 26, 0.75);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 20px;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.canvas-controls button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.canvas-controls button:hover {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
}

/* Footer status logs */
.canvas-footer {
  height: 28px;
  background: rgba(15, 17, 26, 0.9);
  border-top: 1px solid var(--border-color);
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.log-stream {
  display: flex;
  gap: 10px;
}

.stream-tag {
  color: var(--neon-cyan);
}

.stream-msg {
  color: var(--text-secondary);
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 240, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hidden {
  display: none !important;
}

/* ==============================================================================
   Sliding Drawers (Settings & Node Inspector)
   ============================================================================== */

.settings-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-left: 5px;
}

.settings-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transform: rotate(45deg);
}

/* New compact voice control row & sidebar status footer styles */
.voice-dashboard-controls-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 5px;
}

.visualizer-mini-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 50px;
  height: 50px;
}

.mic-mini-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.mic-mini-container .mic-btn {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
  border-radius: 50%;
  margin: 0;
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.1);
}

.sidebar-status-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 13, 30, 0.4);
  flex-shrink: 0;
}

.sidebar-status-footer .status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.45rem;
  padding-right: 0;
  border-right: none;
  border-bottom: 1px dashed rgba(28, 34, 74, 0.2);
  padding-bottom: 2px;
}

.sidebar-status-footer .status-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-status-footer .status-label {
  font-family: var(--font-hud);
  color: var(--text-secondary);
}

.sidebar-status-footer .status-value {
  font-family: var(--font-mono);
  color: var(--neon-magenta);
}

.sidebar-status-footer .status-value.active {
  color: var(--neon-green);
}

.sliding-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  height: 100%;
  background: rgba(15, 17, 26, 0.85);
  backdrop-filter: blur(15px);
  border-left: 2px solid var(--border-color);
  z-index: 8;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sliding-drawer.collapsed {
  transform: translateX(100%);
}

.drawer-header {
  height: 55px;
  background: rgba(10, 11, 16, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.drawer-header h3 {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
  margin-bottom: 0;
}

.close-drawer-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s;
}

.close-drawer-btn:hover {
  color: var(--neon-magenta);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Node Editor components */
.node-editor-textarea {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 4px;
  resize: vertical;
  min-height: 80px;
  width: 100%;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.node-editor-textarea.content-textarea {
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.node-editor-textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.save-control-container {
  display: flex;
  gap: 10px;
}

.save-control-container .action-btn {
  flex: 1;
  font-size: 0.75rem;
  padding: 10px 8px;
}

/* Node Chat bubble interface */
.node-chat-section h3 {
  cursor: default !important;
}
.node-chat-section h3::after {
  display: none !important;
}

.node-dialogue-console {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
}

/* Sidebar header customization */
.header-section {
  border-bottom: 1px solid var(--border-color);
  border-radius: 0 !important;
  background: rgba(0, 0, 0, 0.15) !important;
  box-shadow: none !important;
  position: relative;
  padding: 6px 16px 4px 16px !important;
}

.header-section .settings-toggle-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.75rem;
  z-index: 5;
}

.header-section::before {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta)) !important;
}

.header-section h3 {
  cursor: default !important;
}

.header-section h3::after {
  display: none !important;
}

/* Sidebar Header Custom Avatar & Title formatting */
.sidebar-title-container {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 0 !important;
}

.sidebar-avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  background: #050810;
  padding: 2px;
  object-fit: contain;
  object-position: center;
}

.sidebar-title-text {
  display: flex;
  flex-direction: column;
}

.sidebar-title-text .main-title {
  font-family: var(--font-hud);
  font-size: 1.4rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.sidebar-title-text .sub-title {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Dropdown select customization */
.dropdown-select-section select:hover,
.dropdown-select-section select:focus {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}

/* Helper class to hide inactive views */
.hidden {
  display: none !important;
}

/* Responsiveness for small devices (e.g. mobile access) */
@media(max-width: 768px) {
  .workspace {
    flex-direction: column-reverse;
  }
  
  .control-panel {
    width: 100%;
    height: 50%;
    border-right: none;
    border-top: 2px solid var(--border-color);
  }
  
  .graph-canvas-container {
    height: 50%;
  }
}

/* ==============================================================================
   MONCD WORKBENCH — primary operational surface
   ============================================================================== */
.workspace {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  height: 100vh;
  background: #060914;
}

.control-panel {
  width: auto;
  min-width: 0;
  border-right: 1px solid rgba(80, 116, 183, 0.28);
  background: linear-gradient(180deg, #0c1021 0%, #080b16 100%);
  padding: 14px 10px;
  gap: 10px;
  overflow-y: auto;
}

.control-panel .panel-section {
  border: 1px solid rgba(76, 106, 169, 0.24);
  background: rgba(15, 20, 39, 0.68);
  box-shadow: none;
  border-radius: 10px;
  padding: 12px;
}

.control-panel .panel-section::before { display: none; }
.control-panel .header-section { padding: 12px; }
.control-panel .sidebar-avatar { width: 42px; height: 42px; }
.control-panel .sidebar-title-container { gap: 9px !important; }
.control-panel .sidebar-title-text .main-title { font-size: 1.1rem; }
.control-panel .sidebar-title-text .sub-title { font-size: .51rem; letter-spacing: .35px; }
.control-panel .settings-toggle-btn { top: 10px; right: 10px; }
.control-panel .dropdown-select-section { padding: 10px 12px !important; }
.control-panel .status-label { font-size: .72rem; }
.control-panel .description-text { font-size: .78rem; line-height: 1.35; }
.control-panel .sidebar-status-footer { margin-top: auto; border-top: 0; padding: 8px 4px 0; }

.sidebar-toggle-btn {
  left: 264px;
  width: 22px;
  height: 48px;
  border-radius: 0 8px 8px 0;
}
.control-panel.collapsed-sidebar { margin-left: -264px; }

.workbench-shell {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(18px, 3vw, 42px);
  gap: 14px;
  background:
    radial-gradient(circle at 74% -10%, rgba(35, 113, 200, .16), transparent 36%),
    linear-gradient(145deg, #090d19 0%, #060913 58%, #080d1b 100%);
}

.workbench-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 3px 0 8px;
}

.eyebrow {
  color: #70b9ff;
  font: 700 .72rem var(--font-hud);
  letter-spacing: .16em;
  margin-bottom: 7px;
}

.workbench-header h1 {
  font: 600 clamp(1.55rem, 2.4vw, 2.35rem) var(--font-body);
  letter-spacing: -.045em;
  color: #f4f7ff;
}

.workbench-subtitle { color: #8d9bb8; margin-top: 7px; font-size: .94rem; }
.workbench-header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workbench-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #c6d5ef;
  background: rgba(21, 31, 55, .78);
  border: 1px solid rgba(96, 139, 211, .3);
  border-radius: 9px;
  cursor: pointer;
  font: 600 .8rem var(--font-body);
  transition: border-color .2s, background .2s, transform .2s;
}
.workbench-action:hover { border-color: #4fa9ff; background: rgba(35, 75, 125, .45); transform: translateY(-1px); }
.workbench-action i { color: #65b6ff; }

.workbench-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  padding: 10px 13px;
  border: 1px solid rgba(84, 117, 175, .2);
  border-radius: 10px;
  color: #92a2be;
  background: rgba(12, 18, 34, .56);
  font: .75rem var(--font-mono);
}
.workbench-status-row i { color: #5db5ff; margin-right: 5px; }
.workbench-status-row .status-online { color: #49d69a; font-size: .55rem; vertical-align: middle; }

.workbench-module-host {
  min-height: 0;
  flex: 1;
  display: flex;
}
.workbench-module-host > .sidebar-module-content { width: 100%; min-height: 0; }
.workbench-module-host > .sidebar-module-content:not(.hidden) { display: flex; }
.workbench-module-host .panel-section {
  width: 100%;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid rgba(89, 126, 195, .25);
  background: linear-gradient(145deg, rgba(18, 27, 49, .93), rgba(10, 15, 29, .94));
  box-shadow: 0 16px 45px rgba(0, 0, 0, .18);
}

#chat-module > .panel-section { display: flex; flex-direction: column; padding: clamp(18px, 2.2vw, 28px); }
#chat-module h3 { font: 600 1.15rem var(--font-body); letter-spacing: -.02em; }
#chat-module .description-text { color: #91a0bb; max-width: 720px; line-height: 1.5; }
#chat-module .dialogue-console-container { display: flex; flex: 1; min-height: 220px; margin-top: 20px !important; }
#chat-module .dialogue-console { height: auto !important; flex: 1; padding: 18px; border-radius: 10px; background: rgba(4, 8, 17, .64); border-color: rgba(87, 124, 189, .22); }
#chat-module .input-group { margin-top: 14px !important; }
#chat-module .input-group input { height: 48px; border-radius: 9px; background: rgba(5, 9, 18, .8); }
#chat-module .input-group .action-btn { min-width: 50px; border-radius: 9px; }

.workbench-graph {
  flex: 1;
  min-height: 0;
  position: relative;
  border: 1px solid rgba(89, 126, 195, .25);
  border-radius: 14px;
  overflow: hidden;
  background: #080c18;
}
.workbench-graph #cy { position: absolute; inset: 0; height: auto; }
.workbench-graph .canvas-overlay { top: 16px; right: 16px; }
.workbench-graph .canvas-footer { border-top: 1px solid rgba(89, 126, 195, .2); }

.mayerlab-fullscreen-active .workbench-shell { padding: 18px; }
.mayerlab-fullscreen-active .workbench-header,
.mayerlab-fullscreen-active .workbench-status-row { display: none; }

@media (max-width: 900px) {
  body { height: 100dvh; overflow: hidden; }
  .workspace { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
  .control-panel { grid-row: 1; width: 100%; height: auto !important; max-height: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible; padding: 8px; gap: 8px; border-right: none; border-bottom: 1px solid rgba(80, 116, 183, .28); }
  .control-panel .header-section { grid-column: 1; }
  .control-panel .dropdown-select-section { grid-column: 2; align-self: stretch; }
  .control-panel > .panel-section:nth-of-type(3) { grid-column: 1 / -1; padding: 9px 12px; }
  .control-panel > .panel-section:nth-of-type(3) h3 { font-size: .85rem; margin-bottom: 3px !important; }
  .control-panel > .panel-section:nth-of-type(3) .description-text { display: none; }
  .control-panel > .panel-section:nth-of-type(3) .action-btn { padding: 8px; font-size: .75rem; }
  .control-panel .sidebar-status-footer { display: none; }
  .sidebar-toggle-btn { display: none; }
  .workbench-shell { grid-column: 1; grid-row: 2; padding: 16px; gap: 10px; }
  .workbench-header { gap: 12px; align-items: flex-start; }
  .workbench-header h1 { font-size: 1.45rem; }
  .workbench-subtitle { display: none; }
  .workbench-header-actions { gap: 5px; }
  .workbench-action { padding: 9px; }
  .workbench-action span { display: none; }
  .workbench-status-row { font-size: .66rem; gap: 6px 10px; }
  #chat-module > .panel-section { padding: 16px; }
  #chat-module .dialogue-console-container { min-height: 0; }
  .sliding-drawer { width: min(94vw, 480px); }
}

@media (max-width: 480px) {
  .control-panel { max-height: none; }
  .control-panel .sidebar-avatar { width: 35px; height: 35px; }
  .control-panel .sidebar-title-text .sub-title { display: none; }
  .control-panel .settings-toggle-btn { display: none; }
  .workbench-shell { padding: 12px; }
  .workbench-header h1 { font-size: 1.27rem; }
  .workbench-status-row span:nth-child(2) { display: none; }
}
