:root {
  --bg-dark: #0a0e17;
  --panel-bg: rgba(15, 23, 42, 0.85);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

#canvas3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Glassmorphism utility */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Top Navigation & Controls Container */
.top-nav-container {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.top-bar {
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: auto;
}

/* Expandable & Retractable Controls Dock directly below company name */
.controls-dock {
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, transform 0.3s ease, padding 0.25s ease;
  max-height: 120px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  pointer-events: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.controls-dock.retracted {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-12px);
  pointer-events: none;
  border-color: transparent;
}

.btn-dock-toggle {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-weight: 600;
  gap: 5px;
}

.btn-dock-toggle:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
}

/* Camera & Direction Controls */
.direction-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ctrl:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.btn-ctrl.active {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

/* Agent Quick Jump Dropdown */
.agent-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.agent-select option {
  background: #111827;
  color: #ffffff;
}

/* Controls Guide Pill */
.controls-hint {
  position: absolute;
  bottom: 58px;
  left: 20px;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 10;
  display: flex;
  gap: 14px;
  align-items: center;
}

.controls-hint span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.controls-hint b {
  color: #38bdf8;
}

/* Real-Time Hover HUD / Tooltip */
.agent-hover-hud {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  width: 290px;
  border-radius: 14px;
  padding: 14px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  opacity: 0;
  transform: translate(-50%, -120%) scale(0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.agent-hover-hud.visible {
  opacity: 1;
  transform: translate(-50%, -120%) scale(1);
}

.hud-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hud-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.hud-info {
  flex: 1;
}

.hud-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.hud-title {
  font-size: 11px;
  color: var(--text-muted);
}

.hud-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.hud-task-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.hud-task-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 3px;
}

.hud-task-desc {
  color: #f1f5f9;
  font-weight: 500;
  line-height: 1.3;
}

.hud-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  width: 45%;
  transition: width 0.4s ease;
}

.hud-thought {
  font-size: 11px;
  font-style: italic;
  color: #cbd5e1;
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1;
  padding: 5px 8px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 6px;
}

.hud-click-hint {
  font-size: 10px;
  color: #38bdf8;
  text-align: right;
  font-weight: 600;
}

/* Slide-in Agent Command & Chat Modal / Panel */
.agent-modal {
  position: absolute;
  top: 86px;
  right: 20px;
  bottom: 60px;
  width: 480px;
  border-radius: 18px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}

.agent-modal.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.modal-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-title {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Quick Office Interaction Actions */
.modal-actions-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--panel-border);
}

.btn-action {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-summon {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.btn-summon:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-dismiss {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}

.btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Tabs */
.modal-tabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--panel-border);
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.modal-tabs::-webkit-scrollbar {
  height: 3px;
}

.modal-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.modal-tab {
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-tab:hover {
  color: #fff;
}

.modal-tab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

/* Tab Contents */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

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

/* Command Center */
.command-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.command-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.command-input-row {
  display: flex;
  gap: 8px;
}

.command-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.command-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-send-cmd {
  background: #6366f1;
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-send-cmd:hover {
  background: #4f46e5;
}

.presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #fff;
}

.execution-feed {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Chat Tab */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #4f46e5;
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: #f1f5f9;
  border-bottom-left-radius: 2px;
}

.chat-bubble-sender {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* Inspector Tab */
.file-view {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  overflow-y: auto;
  max-height: 380px;
  white-space: pre-wrap;
}

/* Bottom Event Ticker */
.bottom-ticker {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
  font-size: 12px;
}

.ticker-label {
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ticker-content {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Settings Modal */
.settings-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(920px, 94vw);
  max-height: 88vh;
  border-radius: 16px;
  padding: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.settings-modal.open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: flex;
  flex-direction: column;
}

.agent-edit-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.agent-edit-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.agent-edit-row {
  display: grid;
  grid-template-columns: 160px 1fr 130px auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .agent-edit-row {
    grid-template-columns: 1fr;
  }
}

.settings-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 45;
  display: none;
}

.settings-backdrop.open {
  display: block;
}

/* WhatsApp Conversations & Replay Module */
.wa-hub-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.wa-threads-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wa-threads-scroll::-webkit-scrollbar {
  height: 4px;
}

.wa-threads-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.wa-thread-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  max-width: 190px;
}

.wa-thread-pill:hover {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.4);
}

.wa-thread-pill.active {
  background: rgba(37, 211, 102, 0.15);
  border-color: #25D366;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

.wa-thread-pill-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-thread-pill-snippet {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.wa-chat-window {
  flex: 1;
  min-height: 260px;
  max-height: 440px;
  background: rgba(10, 15, 25, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wa-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--panel-border);
}

.wa-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  position: relative;
  animation: fadeIn 0.2s ease;
}

.wa-bubble.client {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-bottom-left-radius: 2px;
}

.wa-bubble.pixel_chen {
  align-self: flex-end;
  background: rgba(37, 211, 102, 0.18);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #e2fbe8;
  border-bottom-right-radius: 2px;
}

.wa-bubble.director {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #e0e7ff;
  border-bottom-right-radius: 2px;
}

.wa-bubble.guardrailed {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.15);
}

.wa-bubble-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-bubble.client .wa-bubble-badge { color: #38bdf8; }
.wa-bubble.pixel_chen .wa-bubble-badge { color: #4ade80; }
.wa-bubble.director .wa-bubble-badge { color: #a5b4fc; }

.wa-guardrail-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
}

.wa-bubble-time {
  font-size: 9px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.wa-bubble.replaying-active {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
  transform: scale(1.02);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-replay:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.btn-replay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================================================================
   DIRECTOR EXECUTIVE SUITE (CEO PERSONAL ASSISTANT & CONSIGLIERE)
   ========================================================================= */

.director-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.director-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.director-modal-content {
  width: 100%;
  max-width: 820px;
  max-height: 86vh;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.15), 0 0 1px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: directorModalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: #0f172a;
}

@keyframes directorModalSlideIn {
  from {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.director-modal-header {
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.director-avatar-box {
  width: 34px;
  height: 34px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: none;
}

.director-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.director-badge-title {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.director-modal-header .btn-ctrl {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 7px;
  font-size: 11px;
  padding: 5px 9px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.director-modal-header .btn-ctrl:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.director-modal-header .btn-ctrl.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.director-modal-header .modal-close {
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.director-modal-header .modal-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.director-tabs-bar {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 0 18px;
  gap: 16px;
}

.director-modal-tab {
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.director-modal-tab:hover {
  color: #0f172a;
}

.director-modal-tab.active {
  color: #0f172a;
  font-weight: 600;
  border-bottom-color: #0f172a;
  text-shadow: none;
}

.director-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  min-height: 440px;
  background: #ffffff;
}

.director-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Prompt Chips */
.director-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
}

.director-preset-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.director-preset-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: none;
}

/* Dialogue Feed */
.director-chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 2px;
  max-height: 420px;
}

.director-chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

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

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

.director-chat-msg .msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.director-chat-msg.msg-director .msg-avatar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.director-chat-msg.msg-ceo .msg-avatar {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-size: 12px;
}

.director-chat-msg .msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
}

.director-chat-msg.msg-director .msg-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-top-left-radius: 3px;
}

.director-chat-msg.msg-ceo .msg-bubble {
  background: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff;
  border-top-right-radius: 3px;
}

.director-chat-msg .msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 3px;
  font-weight: 600;
  color: #64748b;
}

.director-chat-msg.msg-ceo .msg-meta {
  color: #94a3b8;
}

.director-chat-msg .msg-time {
  font-size: 10px;
  font-weight: 400;
  color: #94a3b8;
}

/* Chat formatting */
.chat-h3 {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 6px 0 3px 0;
}

.chat-h4 {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin: 5px 0 2px 0;
}

.chat-code {
  background: #e2e8f0;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #0f172a;
  border: none;
}

.director-chat-msg.msg-ceo .chat-code {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.chat-li {
  margin: 3px 0 3px 12px;
  color: inherit;
}

.chat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 11px;
}

.chat-table td {
  padding: 5px 7px;
  border: 1px solid #e2e8f0;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: #64748b;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Input Row */
.director-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.director-text-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #0f172a;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.director-text-input:focus {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.05);
}

.director-text-input::placeholder {
  color: #94a3b8;
}

.btn-director-mic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: all 0.15s ease;
}

.btn-director-mic:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-director-mic.listening {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  animation: micPulse 1s infinite alternate ease-in-out;
}

@keyframes micPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.director-voice-listening-banner {
  padding: 6px 12px;
  margin-top: 6px;
  border-radius: 6px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-wave-anim {
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  animation: pulseDot 0.8s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.4; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.btn-director-send {
  background: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-director-send:hover {
  background: #1e293b;
  border-color: #1e293b;
}

/* Radar & Telemetry Tab Styles */
.radar-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.radar-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.radar-card-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.radar-card-val {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.radar-card-sub {
  font-size: 10px;
  color: #94a3b8;
}

.radar-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.radar-health-box {
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.radar-health-box.box-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.radar-health-box.box-bad {
  border-color: #fecaca;
  background: #fef2f2;
}

.radar-health-box .box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.radar-health-box .box-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.radar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radar-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #334155;
}

.radar-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.radar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  color: #334155;
}

.radar-table th {
  background: #f8fafc;
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.radar-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.btn-ctrl-sm {
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.btn-ctrl-sm:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.badge-cabin {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.badge-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-status.status-working {
  background: #dcfce7;
  color: #15803d;
}

.progress-bar-sm {
  width: 50px;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.progress-bar-sm .fill {
  height: 100%;
  background: #0f172a;
}

/* Delegator Tab */
.delegation-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

/* =========================================================================
   FLOATING ANIMATED AI DIRECTOR ASSISTANT WIDGET ("ZERO" / "JEROO")
   ========================================================================= */

.zero-floating-widget {
  position: fixed;
  bottom: 58px;
  right: 24px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.zero-floating-widget:hover {
  transform: translateY(-3px);
}

/* Animated Glowing Holographic AI Orb */
.zero-orb {
  width: 58px;
  height: 58px;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.zero-orb-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(6, 182, 212, 0.2) 60%, transparent 80%);
  filter: blur(8px);
  animation: zeroOrbGlowPulse 2.8s infinite alternate ease-in-out;
}

@keyframes zeroOrbGlowPulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0.95; }
}

.zero-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed transparent;
}

.zero-orb-ring.ring-1 {
  border-top-color: #f59e0b;
  border-bottom-color: #06b6d4;
  animation: zeroRingSpin 5s infinite linear;
}

.zero-orb-ring.ring-2 {
  inset: 4px;
  border-left-color: #d97706;
  border-right-color: #818cf8;
  animation: zeroRingSpinRev 4s infinite linear;
}

@keyframes zeroRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes zeroRingSpinRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.zero-orb-core {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a1505 0%, #15110e 50%, #0b101b 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
}

.zero-orb:hover .zero-orb-core {
  border-color: #fde047;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.8);
  transform: scale(1.06);
}

.zero-orb-emoji {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(255, 69, 0, 0.6));
  animation: zeroEmojiBob 2s infinite ease-in-out alternate;
}

@keyframes zeroEmojiBob {
  from { transform: translateY(-1px) rotate(-3deg); }
  to { transform: translateY(1px) rotate(3deg); }
}

.zero-live-pulse {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 8px #10b981;
  animation: liveBeacon 1.5s infinite alternate;
}

@keyframes liveBeacon {
  from { opacity: 0.6; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.2); }
}

/* Pulsing state when listening to speech */
.zero-orb.listening .zero-orb-glow {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.7) 0%, rgba(220, 38, 38, 0.4) 60%, transparent 80%);
  animation: micListenGlow 0.8s infinite alternate ease-in-out;
}

.zero-orb.listening .zero-orb-core {
  border-color: #ef4444;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
}

@keyframes micListenGlow {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.4); opacity: 1; }
}

/* Info Pill & Hover Action Dock */
.zero-hover-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(14px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 14, 11, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 28px;
  padding: 5px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(12px);
}

.zero-floating-widget:hover .zero-hover-bar,
.zero-hover-bar.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.btn-zero-hover-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-zero-hover-action .action-icon {
  font-size: 14px;
}

.btn-zero-hover-action .action-label {
  font-size: 11px;
  letter-spacing: 0.3px;
}

.btn-zero-hover-mic {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde047;
}

.btn-zero-hover-mic:hover {
  background: rgba(245, 158, 11, 0.4);
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
  transform: scale(1.05);
}

.btn-zero-hover-mic.listening {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.8);
  animation: micPulse 1s infinite alternate;
}

.btn-zero-hover-chat {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.btn-zero-hover-chat:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: #818cf8;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
  transform: scale(1.05);
}

/* Proactive Autonomous Pulse Speech Bubble */
.zero-pulse-bubble {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 320px;
  background: rgba(22, 16, 12, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.7);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 24px rgba(245, 158, 11, 0.35);
  backdrop-filter: blur(16px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: zeroPulsePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zeroPulsePop {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.zero-pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zero-pulse-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zero-pulse-icon {
  font-size: 16px;
}

.zero-pulse-title {
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.3px;
}

.zero-pulse-dismiss {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s ease;
}

.zero-pulse-dismiss:hover {
  color: #f87171;
}

.zero-pulse-text {
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.45;
}

.zero-pulse-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-pulse-act {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pulse-reply {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #f59e0b;
  color: #fff;
}

.btn-pulse-reply:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: translateY(-1px);
}

.btn-pulse-voice {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fde047;
}

.btn-pulse-voice:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

/* Durable Rules Tab Styling (Clean White Theme) */
.durable-rules-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.durable-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  gap: 12px;
  transition: all 0.15s ease;
}

.durable-rule-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.durable-rule-text {
  font-size: 12px;
  color: #0f172a;
  line-height: 1.4;
  flex: 1;
}

.durable-rule-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  text-transform: uppercase;
}

.btn-delete-rule {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #ef4444;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.btn-delete-rule:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}


