/* ============================================================
   CYBERDECK PORTFOLIO (BlackBox / SecOps-UI)
   Custom Cyberpunk Stylesheet & Design System
   ============================================================ */

/* 1. Local Typography (Oxanium Webfonts) */
@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/oxanium/oxanium-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/oxanium/oxanium-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/oxanium/oxanium-latin-700-normal.woff2') format('woff2');
}

/* 2. Global Variables & Color States */
:root {
  --font-cyber: 'Oxanium', monospace, -apple-system, sans-serif;
  --bg-canvas: #020712;
  --win-bg: rgba(8, 20, 38, 0.80);
  --win-border: rgba(0, 229, 255, 0.28);
  --win-glow: #00e5ff;
  --accent: #00e5ff;
  --accent-rgb: 0, 229, 255;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --taskbar-bg: rgba(6, 16, 32, 0.85);
  --selection-bg: rgba(0, 229, 255, 0.3);
}

/* Color Schemes / State Machine */
.theme-cyan {
  --win-border: rgba(0, 229, 255, 0.35);
  --win-glow: #00e5ff;
  --accent: #00e5ff;
  --accent-rgb: 0, 229, 255;
}

.theme-amber {
  --win-border: rgba(255, 183, 3, 0.45);
  --win-glow: #ffb703;
  --accent: #ffb703;
  --accent-rgb: 255, 183, 3;
}

.theme-red {
  --win-border: rgba(255, 0, 85, 0.55);
  --win-glow: #ff0055;
  --accent: #ff0055;
  --accent-rgb: 255, 0, 85;
}

.theme-green {
  --win-border: rgba(112, 224, 0, 0.45);
  --win-glow: #70e000;
  --accent: #70e000;
  --accent-rgb: 112, 224, 0;
}

.theme-gold {
  --win-border: rgba(255, 215, 0, 0.65);
  --win-glow: #ffd700;
  --accent: #ffd700;
  --accent-rgb: 255, 215, 0;
}

.theme-purple {
  --win-border: rgba(217, 70, 239, 0.5);
  --win-glow: #d946ef;
  --accent: #d946ef;
  --accent-rgb: 217, 70, 239;
}

.theme-white {
  --win-border: rgba(248, 250, 252, 0.5);
  --win-glow: #f8fafc;
  --accent: #f8fafc;
  --accent-rgb: 248, 250, 252;
}

/* Overclock & Undervolt Modifiers */
body.mode-overclock {
  filter: saturate(1.5) brightness(1.25) contrast(1.1);
}

body.mode-undervolt {
  filter: saturate(0.4) brightness(0.75) contrast(0.9);
}

/* 3. Base & Desktop Root */
html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-cyber);
  user-select: none;
  -webkit-user-select: none;
}

::selection {
  background: var(--selection-bg);
  color: #ffffff;
}

/* Background Canvas Layer */
#matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Scanline Subgrid Overlay - disabled for clean, 100% uniform solid background */
.scanlines-overlay {
  display: none;
}

/* Desktop Work Area */
#desktop-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  z-index: 10;
  overflow: hidden;
}

/* Desktop Icon Grid */
/* Desktop Icon Grid */
.desktop-icons-container {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2vh;
  max-height: calc(100% - 72px);
  z-index: 12;
}

.desktop-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(92px, 7.5vw, 130px);
  height: clamp(82px, 10vh, 120px);
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  box-sizing: border-box;
}

.desktop-shortcut:hover {
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
  transform: translateY(-2px);
}

.desktop-shortcut .icon-box {
  width: clamp(48px, 5.5vh, 66px);
  height: clamp(48px, 5.5vh, 66px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.65));
}

.desktop-shortcut .label {
  margin-top: 6px;
  font-size: clamp(11px, 1.25vh, 13px);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  line-height: 1.2;
  word-break: break-word;
}

/* 4. Cyber-Window Geometry & Glassmorphism */
.cyber-window {
  position: absolute;
  background: var(--win-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--win-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  user-select: text;
  -webkit-user-select: text;
}

.cyber-window.is-focused {
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 18px rgba(var(--accent-rgb), 0.22);
}

/* Corner Brackets */
.cyber-window .bracket {
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--win-glow);
  filter: drop-shadow(0 0 4px var(--win-glow));
  pointer-events: none;
  z-index: 25;
}

.cyber-window .bracket-tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.cyber-window .bracket-tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.cyber-window .bracket-bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.cyber-window .bracket-br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

/* Center Bottom Light Accent */
.cyber-window::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  height: 2px;
  background: radial-gradient(circle, var(--win-glow) 0%, transparent 100%);
  box-shadow: 0 0 8px var(--win-glow);
  pointer-events: none;
  opacity: 0.85;
}

/* Window Header */
.cyber-window-header {
  height: 38px;
  background: rgba(12, 28, 54, 0.75);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.cyber-window-header:active {
  cursor: grabbing;
}

.cyber-window-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.cyber-window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cyber-win-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.cyber-win-btn:hover {
  background: rgba(var(--accent-rgb), 0.25);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--win-glow);
}

.cyber-win-btn.close-btn:hover {
  background: rgba(255, 0, 85, 0.35);
  border-color: #ff0055;
  color: #ffffff;
  box-shadow: 0 0 8px #ff0055;
}

/* Window Content Body */
.cyber-window-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  position: relative;
  font-size: 13px;
  line-height: 1.6;
}

/* Resize Handles */
.resize-handle {
  position: absolute;
  z-index: 30;
}
.resize-n  { top: 0; left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.resize-s  { bottom: 0; left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.resize-e  { top: 6px; bottom: 6px; right: 0; width: 6px; cursor: ew-resize; }
.resize-w  { top: 6px; bottom: 6px; left: 0; width: 6px; cursor: ew-resize; }
.resize-nw { top: 0; left: 0; width: 10px; height: 10px; cursor: nwse-resize; }
.resize-ne { top: 0; right: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.resize-sw { bottom: 0; left: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.resize-se { bottom: 0; right: 0; width: 10px; height: 10px; cursor: nwse-resize; }

/* 5. Terminal Engine Styling */
.terminal-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'Oxanium', monospace;
  font-size: 13px;
  line-height: 1.45;
}

.terminal-history {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.terminal-line {
  margin-bottom: 4px;
  word-break: break-word;
  white-space: pre-wrap;
}

.terminal-line.output-info    { color: #38bdf8; }
.terminal-line.output-success { color: #4ade80; }
.terminal-line.output-warn    { color: #fbbf24; }
.terminal-line.output-error   { color: #f87171; }
.terminal-line.output-gold    { color: #facc15; font-weight: bold; }

.terminal-input-row {
  display: flex;
  align-items: center;
  position: relative;
  margin-top: 4px;
}

.terminal-prompt {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
}

.terminal-command-display {
  color: #ffffff;
  min-height: 1.2em;
  white-space: pre-wrap;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursor-blink 1s steps(2, start) infinite;
  box-shadow: 0 0 6px var(--win-glow);
}

@keyframes cursor-blink {
  to { visibility: hidden; }
}

/* Hidden input bridge for mobile virtual keyboard */
.terminal-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: text;
  border: none;
  background: transparent;
  outline: none;
  color: transparent;
  pointer-events: auto;
}

/* Terminal-specific window body layout to prevent collapse or double-scroll */
.cyber-window[id="win-terminal"] .cyber-window-body {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px !important;
}

/* Full-bleed flush window bodies (no outer padding / outer scrollbar) */
.cyber-window[id="win-projects-explorer"] .cyber-window-body,
.cyber-window[id="win-ai-comm"] .cyber-window-body,
.cyber-window[id="win-ai-comm-log"] .cyber-window-body,
.cyber-window:has(.agent-comm-container) .cyber-window-body {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

#terminal-mount {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 6. Windows-Style Cyber Taskbar / Dock */
#taskbar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  height: 48px;
  max-width: calc(100vw - 32px);
  background: var(--taskbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--win-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 12px rgba(var(--accent-rgb), 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  gap: 8px;
  z-index: 1000;
  transition: all 0.25s ease;
}

/* Centered list of open windows */
.dock-windows-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.taskbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 4px;
  color: var(--text-main);
  font-family: 'Oxanium', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.taskbar-item:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}

.taskbar-item.is-active {
  background: rgba(var(--accent-rgb), 0.26);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 12px var(--win-glow), inset 0 0 6px rgba(var(--accent-rgb), 0.35);
  font-weight: 600;
}

.taskbar-item.is-minimized {
  opacity: 0.55;
  border-style: dashed;
}

.taskbar-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.taskbar-item-icon svg {
  width: 16px;
  height: 16px;
}

.taskbar-item-icon img {
  width: 16px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

.taskbar-item-title {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auto-compact mode: when taskbar becomes too wide, hide window titles */
.dock-windows-list.compact-mode .taskbar-item-title {
  display: none;
}

.dock-windows-list.compact-mode .taskbar-item {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.taskbar-empty-hint {
  font-size: 11px;
  color: rgba(0, 229, 255, 0.5);
  letter-spacing: 1px;
  padding: 0 10px;
  white-space: nowrap;
}

/* Right System Tray (Sound & Clock) */
.dock-system-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.dock-tray-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dock-tray-item:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

.dock-clock {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
  padding: 0 4px;
  white-space: nowrap;
}

.dock-tray-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
  flex-shrink: 0;
}

.dock-info-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.dock-tray-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  height: 28px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dock-tray-info-btn:hover,
.dock-tray-info-btn.active {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25);
}

.dock-info-overlay {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: min(440px, calc(100vw - 32px));
  background: rgba(10, 15, 24, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  z-index: 10001;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-info-overlay.hidden {
  display: none !important;
}

.dock-info-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.dock-info-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
}

.dock-info-close-btn:hover {
  color: #ff5555;
  background: rgba(255, 85, 85, 0.15);
}

.dock-info-github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 4px;
  color: #38bdf8;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dock-info-github-link:hover {
  background: rgba(0, 229, 255, 0.22);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

@media (max-width: 639px) {
  .dock-tray-info-btn span {
    display: none;
  }
  .dock-info-overlay {
    right: -10px;
    width: min(340px, calc(100vw - 24px));
  }
}

/* 7. Offshore Wire Transfer HUD Banner */
#wire-transfer-banner {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(20, 15, 3, 0.96);
  border: 1px solid #ffd700;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.45);
  padding: 14px 22px;
  border-radius: 4px;
  z-index: 900;
  transform: translateY(-260px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.35s ease, visibility 0.45s;
  font-family: 'Oxanium', monospace;
}

#wire-transfer-banner.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 8. Desktop Context Menu */
#cyber-context-menu {
  position: absolute;
  display: none;
  background: rgba(6, 16, 32, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--win-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 12px rgba(var(--accent-rgb), 0.2);
  border-radius: 4px;
  padding: 6px 0;
  z-index: 2000;
  min-width: 190px;
  font-size: 12px;
}

.context-menu-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.12s ease;
  line-height: 1;
}

.context-menu-item:hover {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
}

.context-menu-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
}

.context-menu-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.context-menu-text {
  flex: 1;
  white-space: nowrap;
}

.context-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* 9. BIOS / Kernel Bootloader Overlay */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #020617;
  color: #38bdf8;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px;
  font-family: 'Oxanium', monospace;
  font-size: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.boot-lines {
  line-height: 1.8;
  white-space: pre-wrap;
}

.boot-skip-hint {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* 10. CRT Collapse & Glitch Animation */
@keyframes crt-collapse {
  0% {
    transform: scale(1, 1);
    filter: brightness(1);
  }
  60% {
    transform: scale(1, 0.003);
    filter: brightness(3);
  }
  100% {
    transform: scale(0, 0.003);
    filter: brightness(10);
  }
}

.crt-collapse-active {
  animation: crt-collapse 0.65s cubic-bezier(0.23, 1, 0.32, 1) forwards !important;
}

/* Self Destruct Visual FX */
#self-destruct-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  background: radial-gradient(circle at center, rgba(255, 0, 50, 0.06) 0%, rgba(220, 0, 40, 0.18) 70%, rgba(255, 0, 0, 0.38) 100%);
  box-shadow: inset 0 0 80px rgba(255, 0, 0, 0.45);
  animation: destruct-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes destruct-pulse {
  0% {
    opacity: 0.2;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.3));
  }
  100% {
    opacity: 0.65;
    filter: drop-shadow(0 0 25px rgba(255, 0, 0, 0.6));
  }
}

@keyframes violent-glitch {
  0% {
    transform: translate(0, 0) skew(0deg);
    filter: contrast(160%) hue-rotate(0deg);
  }
  12% {
    transform: translate(-12px, 6px) skew(-5deg);
    filter: invert(0.85) hue-rotate(90deg) contrast(200%);
  }
  25% {
    transform: translate(16px, -8px) skew(6deg) scale(1.02);
    filter: contrast(350%) drop-shadow(0 0 25px red);
  }
  38% {
    transform: translate(-20px, 12px) skew(-7deg);
    filter: invert(1) hue-rotate(180deg) saturate(3);
  }
  50% {
    transform: translate(14px, -14px) skew(8deg) scale(0.97);
    filter: contrast(450%) brightness(1.7);
  }
  65% {
    transform: translate(-10px, 16px) skew(-4deg);
    filter: invert(0.6) hue-rotate(270deg);
  }
  80% {
    transform: translate(12px, -8px) skew(5deg);
    filter: brightness(2.6) contrast(260%);
  }
  92% {
    transform: translate(-5px, 3px) skew(-2deg);
    filter: brightness(3.5);
  }
  100% {
    transform: translate(0, 0) skew(0deg);
    filter: brightness(4);
  }
}

.destruct-destruction-active {
  animation: violent-glitch 0.08s infinite alternate !important;
  position: relative !important;
}

.destruct-dissolution-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 0, 50, 0.65) 0px, rgba(255, 0, 50, 0.65) 3px, transparent 3px, transparent 8px);
  mix-blend-mode: color-dodge;
  animation: scanline-tear 0.07s steps(2) infinite;
}

@keyframes scanline-tear {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 25%, 0 28%, 0 65%, 100% 62%, 100% 100%, 0 100%);
    transform: translateX(-8px);
  }
  50% {
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 45%, 0 85%, 100% 80%, 100% 100%, 0 100%);
    transform: translateX(10px);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 15%, 0 12%, 0 55%, 100% 58%, 100% 100%, 0 100%);
    transform: translateX(-5px);
  }
}

/* 11. Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.35);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 12. Markdown Content Inside Project Windows */
.markdown-body {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.65;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--accent);
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.markdown-body p {
  margin-bottom: 10px;
}

.markdown-body code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Oxanium', monospace;
  color: #38bdf8;
}

.markdown-body pre {
  background: rgba(2, 8, 20, 0.85);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
}

.markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: #94a3b8;
  margin: 12px 0;
  font-style: italic;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.markdown-body li {
  margin-bottom: 4px;
}

/* 13. Mobile / Responsive Adaptations (< 768px Tactic Pocket Mode) */
@media (max-width: 767px) {
  #desktop-area {
    height: calc(100% - 56px);
  }

  .desktop-icons-container {
    top: 16px;
    left: 16px;
    gap: 14px;
  }

  .desktop-shortcut {
    width: 68px;
  }

  .desktop-shortcut .icon-box {
    width: 36px;
    height: 36px;
  }

  .desktop-shortcut .label {
    font-size: 10px;
  }

  /* Fullscreen Single-Sheet Mode on Mobile */
  .cyber-window {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - 56px) !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--win-border) !important;
  }

  .resize-handle {
    display: none !important;
  }

  .cyber-win-btn.minimize-btn,
  .cyber-win-btn.maximize-btn {
    display: none !important;
  }

  .cyber-win-btn.close-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  #taskbar {
    width: 100%;
    left: 0;
    bottom: 0;
    transform: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    height: 56px;
    justify-content: space-around;
    padding: 0 4px;
  }

  .dock-item {
    width: 44px;
    height: 44px;
  }

  .dock-clock {
    display: none;
  }

  .dock-separator {
    display: none;
  }
}

/* ============================================================
   Lightbox Gallery Viewer (Cyber-Style)
   ============================================================ */
.cyber-lightbox-overlay {
  display: none;
}

.cyber-lightbox-overlay.is-open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(2, 7, 18, 0.94);
  backdrop-filter: blur(12px);
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  user-select: none;
  animation: lightboxFadeIn 0.2s ease-out;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-header {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  font-family: var(--font-cyber);
}

.lightbox-main-stage {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 0.5rem 1rem;
  gap: 1.25rem;
}

.lightbox-img-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: 72vh;
  position: relative;
  overflow: hidden;
}

.lightbox-image {
  max-height: calc(72vh - 36px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.2);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-caption {
  margin-top: 0.6rem;
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
  max-width: 800px;
}

.lightbox-nav-btn {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex: 0 0 52px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
  line-height: 1;
}

.lightbox-nav-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.lightbox-nav-spacer {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 52px;
  flex: 0 0 52px;
  visibility: hidden;
}

@media (max-width: 640px) {
  .lightbox-main-stage {
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
  }
  .lightbox-nav-btn,
  .lightbox-nav-spacer {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    flex: 0 0 42px;
  }
  .lightbox-nav-btn svg {
    width: 20px;
    height: 20px;
  }
}

.lightbox-nav-btn:hover {
  background: rgba(0, 229, 255, 0.25);
  border-color: #00e5ff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
  color: #ffffff;
  transform: scale(1.08);
}

.lightbox-nav-btn:active {
  transform: scale(0.95);
}

.lightbox-thumbs-bar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem;
  overflow-x: auto;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
}

.lightbox-thumb-item {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  opacity: 0.55;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.lightbox-thumb-item:hover {
  opacity: 0.9;
  border-color: #00e5ff;
}

.lightbox-thumb-item.active {
  opacity: 1;
  border: 2px solid #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  transform: scale(1.08);
}

/* ============================================================
   Circuit Timeline Stream (Design 4)
   ============================================================ */
.timeline-stream-wrapper {
  position: relative;
  padding: 1.5rem 1.5rem 2.5rem 3rem;
}

/* The vertical glowing circuit bus */
.timeline-circuit-bus {
  position: absolute;
  top: 1.25rem;
  bottom: 2rem;
  left: 3rem;
  width: 2px;
  background: linear-gradient(180deg, 
    rgba(0, 229, 255, 0.95) 0%, 
    rgba(0, 229, 255, 0.6) 50%, 
    rgba(0, 229, 255, 0.95) 100%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5), 0 0 20px rgba(0, 229, 255, 0.25);
  z-index: 1;
}

/* Year Milestone Header */
.timeline-year-milestone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.75rem 0 1.5rem -3rem;
  padding-left: 0.5rem;
  z-index: 2;
}

.timeline-year-milestone:first-child {
  margin-top: 0.5rem;
}

.timeline-year-badge {
  background: #020712;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
  font-family: var(--font-cyber);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 5rem;
  justify-content: center;
}

.timeline-year-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), rgba(0, 229, 255, 0.08));
}

/* Individual Project Timeline Item */
.timeline-item {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-bottom: 1.5rem;
  z-index: 2;
}

/* Connector Branch Zone (between circuit bus and card) */
.timeline-connector {
  position: relative;
  width: 6rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Glowing node dot on the vertical circuit bus */
.timeline-node-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #020712;
  border: 2px solid #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
  transform: translate(-50%, -50%);
  transition: all 0.25s ease;
  z-index: 3;
}

/* Connecting circuit branch line */
.timeline-branch-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 229, 255, 0.45);
  transform: translateY(-50%);
  transition: all 0.2s ease;
}

/* Month text positioned directly above the horizontal branch line */
.timeline-branch-month {
  position: absolute;
  bottom: calc(50% + 5px);
  left: 0.5rem;
  right: 0.5rem;
  text-align: center;
  font-family: var(--font-cyber);
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

.timeline-item:hover .timeline-node-dot {
  background: #00e5ff;
  box-shadow: 0 0 16px #00e5ff, 0 0 24px rgba(0, 229, 255, 0.8);
  transform: translate(-50%, -50%) scale(1.35);
}

.timeline-item:hover .timeline-branch-line {
  background: #00e5ff;
  box-shadow: 0 0 10px #00e5ff;
}

.timeline-item:hover .timeline-branch-month {
  color: #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

/* Timeline Card */
.timeline-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(8, 20, 38, 0.7);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .timeline-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.timeline-card:hover {
  background: rgba(10, 28, 52, 0.85);
  border-color: #00e5ff;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.25), inset 0 0 15px rgba(0, 229, 255, 0.05);
  transform: translateX(4px);
}

.timeline-card-media {
  width: 100%;
  height: 160px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(10, 25, 47, 0.6) 0%, rgba(2, 6, 18, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .timeline-card-media {
    width: 200px;
    height: auto;
    align-self: stretch;
  }
}

.timeline-card-img {
  width: 100%;
  height: 100%;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
}

.timeline-card:hover .timeline-card-img {
  transform: scale(1.05);
}

.timeline-card-body {
  flex: 1;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.timeline-card-title {
  color: #00e5ff;
  font-family: var(--font-cyber);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.timeline-card-desc {
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0.4rem 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .timeline-stream-wrapper {
    padding: 1rem 0.75rem 2rem 2.25rem;
  }
  .timeline-circuit-bus {
    left: 2.25rem;
  }
  .timeline-year-milestone {
    margin-left: -2.25rem;
    padding-left: 0.25rem;
  }
  .timeline-connector {
    width: 3.8rem;
  }
  .timeline-branch-month {
    font-size: 0.68rem;
    left: 0.25rem;
    right: 0.25rem;
  }
}

/* Animated Cyber Pulse Dot */
.cyber-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  background-color: var(--accent, #00e5ff);
  box-shadow: 0 0 8px var(--accent, #00e5ff), 0 0 2px #ffffff;
  animation: cyberDotPulse 1.6s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes cyberDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--accent, #00e5ff), 0 0 2px #ffffff;
  }
  50% {
    opacity: 0.3;
    transform: scale(0.75);
    box-shadow: 0 0 2px var(--accent, #00e5ff);
  }
}

/* Operator Dossier: Unclamped timeline descriptions, Skills & Attachments */
.operator-timeline-card-desc {
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0.5rem 0 0.5rem 0;
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  white-space: pre-line;
}

.operator-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.22);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #a5f3fc;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.operator-skill-chip:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
  transform: translateY(-1px);
}

.operator-attachment-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.operator-attachment-card:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
  transform: translateX(2px);
}

.operator-attachment-card .att-title {
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-cyber);
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}

.operator-attachment-card:hover .att-title {
  color: #00e5ff;
}

.operator-attachment-card .att-meta {
  color: #94a3b8;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.4;
  margin-top: 2px;
}

.operator-attachment-card .att-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #38bdf8;
  border-radius: 3px;
}

.job-attachment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #38bdf8;
  transition: all 0.2s ease;
  text-decoration: none;
}

.job-attachment-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* ============================================================
   Project Status Badges (Online/Offline, Visibility, Dev State)
   ============================================================ */
.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.25;
  white-space: nowrap;
  vertical-align: middle;
}

.project-badge svg {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  vertical-align: middle;
}

.badge-status-online {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.badge-status-offline {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fb7185;
}

.badge-status-neutral {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.badge-vis-public {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #38bdf8;
}

.badge-vis-private {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.badge-dev-finished {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.badge-dev-closed {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.45);
  color: #f43f5e;
}

.badge-dev-paused,
.badge-status-paused {
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.55);
  color: #fb923c;
}

.badge-dot-paused {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.65);
}

.badge-dev-wip {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.badge-dev-prod {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #22d3ee;
}

.badge-dot-pulsing {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 6px #10b981;
  animation: cyberDotPulse 1.6s ease-in-out infinite;
}

.badge-dot-static {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f43f5e;
}

/* ============================================================
   AI AGENT COMM: SECOPS COMMUNICATOR v4.7 (Dual-Panel UI)
   ============================================================ */

.agent-comm-container {
  display: flex;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(6, 18, 36, 0.95) 0%, rgba(2, 6, 18, 0.98) 100%);
  overflow: hidden;
  position: relative;
}

/* Left Panel: Stream & Input */
.agent-comm-main-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid rgba(0, 229, 255, 0.2);
}

/* Stream Sub-Header */
.agent-comm-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(8, 22, 42, 0.7);
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  flex-shrink: 0;
}

.comm-stream-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comm-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #00e5ff;
  box-shadow: 0 0 8px #00e5ff, 0 0 14px rgba(0, 229, 255, 0.8);
  animation: cyberDotPulse 1.4s ease-in-out infinite;
}

/* Messages Scrollable Viewport */
.agent-comm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) rgba(2, 6, 18, 0.5);
}

.agent-comm-messages::-webkit-scrollbar {
  width: 5px;
}

.agent-comm-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 2px;
}

/* Message Items */
.comm-message-item {
  display: flex;
  width: 100%;
}

.comm-msg-user {
  justify-content: flex-end;
}

.comm-msg-ai {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Avatar Box */
.comm-avatar-box {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: rgba(4, 14, 30, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}

.comm-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile Subheader Avatar (Hidden on Desktop, Visible 30x30 on Mobile) */
.comm-mobile-avatar-wrap {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
  flex-shrink: 0;
  position: relative;
  background: #020713;
}

.comm-mobile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bubbles */
.comm-bubble-content {
  position: relative;
  border-radius: 4px;
  font-family: var(--font-cyber);
}

.user-bubble {
  max-width: 82%;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 0.65rem 0.9rem;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.12), inset 0 0 10px rgba(0, 229, 255, 0.04);
}

.user-bubble .comm-bubble-body {
  color: #f1f5f9;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}

.ai-bubble {
  max-width: 88%;
  background: rgba(8, 20, 38, 0.88);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.75rem 1rem;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(0, 229, 255, 0.03);
}

.comm-bubble-header {
  font-size: 10px;
  color: #00e5ff;
  opacity: 0.85;
  margin-bottom: 0.35rem;
  letter-spacing: 0.6px;
  user-select: none;
}

.ai-bubble .comm-bubble-body {
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: break-word;
}

.ai-bubble .comm-bubble-body p {
  margin-bottom: 0.5rem;
}

.ai-bubble .comm-bubble-body p:last-child {
  margin-bottom: 0;
}

.ai-bubble .comm-bubble-body strong {
  color: #00e5ff;
}

.ai-bubble .comm-bubble-body em {
  color: #94a3b8;
  font-size: 0.78rem;
  display: inline-block;
  margin-top: 0.35rem;
}

.ai-bubble .comm-bubble-body ul {
  list-style: square;
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.ai-bubble .comm-bubble-body code {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.78rem;
  color: #67e8f9;
}

.comm-bubble-footer {
  margin-top: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comm-routing-tag {
  font-size: 9px;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* Typewriter Cursor */
.comm-typewriter-cursor {
  display: inline-block;
  color: #00e5ff;
  margin-left: 2px;
  animation: typewriterBlink 0.7s infinite;
}

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

/* Typing Indicator */
.comm-typing-dots {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
}

.comm-typing-dots span:not(.font-mono) {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00e5ff;
  margin-right: 4px;
  animation: commTypingBounce 1.2s infinite ease-in-out;
}

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

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

/* Notice Bubble */
.comm-notice-bubble {
  padding: 0.5rem 0.8rem;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  color: #fde68a;
  font-size: 11px;
  border-radius: 2px;
  margin: 0.25rem 0;
}

/* Input Dock */
.agent-comm-input-dock {
  padding: 0.75rem 1.15rem;
  background: rgba(4, 12, 26, 0.9);
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.agent-comm-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(8, 22, 44, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.agent-comm-input-wrapper:focus-within {
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.agent-comm-prompt-symbol {
  padding-left: 0.75rem;
  color: #00e5ff;
  font-family: var(--font-cyber);
  font-weight: bold;
  font-size: 0.9rem;
  user-select: none;
}

.agent-comm-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  padding: 0.6rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1.4;
  resize: none;
  min-height: 2.2rem;
  max-height: 6rem;
}

.agent-comm-textarea::placeholder {
  color: #64748b;
  opacity: 0.8;
}

.agent-comm-char-counter {
  padding: 0 0.75rem;
  font-size: 10px;
  font-family: var(--font-cyber);
  color: #64748b;
  white-space: nowrap;
  user-select: none;
}

.agent-comm-send-btn {
  padding: 0.65rem 1.25rem;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid #00e5ff;
  color: #00e5ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.agent-comm-send-btn:hover:not(:disabled) {
  background: #00e5ff;
  color: #020712;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.6);
  transform: translateY(-1px);
}

.agent-comm-send-btn:disabled {
  opacity: 0.6;
  border-color: #64748b;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.btn-cooldown-active {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: #f59e0b !important;
  color: #fbbf24 !important;
}

/* Dock Footer under Chat (Daily limit display - Mobile only) */
.agent-comm-dock-footer {
  display: none;
  justify-content: flex-end;
  align-items: center;
  padding: 0.25rem 0.85rem 0.35rem;
  background: rgba(4, 12, 24, 0.9);
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  font-size: 10px;
}

.comm-footer-quota {
  letter-spacing: 0.5px;
}

/* Right Panel: OPERATOR AI Sidebar */
.agent-comm-sidebar {
  width: 250px;
  background: rgba(4, 12, 26, 0.75);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  flex-shrink: 0;
}

.comm-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

/* Sidebar Operator AI Avatar Stage (Desktop 100x100) */
.comm-sidebar-avatar-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.15rem 0 0.35rem 0;
}

.comm-avatar-portrait-wrap {
  width: 100px;
  height: 100px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.22);
  background: #020713;
}

.comm-avatar-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comm-avatar-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.35) 51%);
  background-size: 100% 4px;
  opacity: 0.4;
}

.comm-sidebar-section {
  display: flex;
  flex-direction: column;
}

.comm-telemetry-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-cyber);
  padding: 0.2rem 0;
}

.comm-telemetry-row .label {
  color: #64748b;
}

/* Quota Gauge */
.comm-gauge-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.comm-gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #00e5ff);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transition: width 0.35s ease, background 0.35s ease;
}

.comm-gauge-bar-fill.bar-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.comm-gauge-bar-fill.bar-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Audio / Signal Frequency Bars */
.comm-signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
  background: rgba(8, 20, 38, 0.5);
  padding: 2px 4px;
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 2px;
}

.comm-signal-bars .bar {
  flex: 1;
  background: #00e5ff;
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
  animation: commSignalPulsing 1.8s infinite ease-in-out;
}

.comm-signal-bars .bar-1 { height: 35%; animation-delay: 0.1s; }
.comm-signal-bars .bar-2 { height: 75%; animation-delay: 0.3s; }
.comm-signal-bars .bar-3 { height: 45%; animation-delay: 0.5s; }
.comm-signal-bars .bar-4 { height: 90%; animation-delay: 0.2s; }
.comm-signal-bars .bar-5 { height: 60%; animation-delay: 0.7s; }
.comm-signal-bars .bar-6 { height: 80%; animation-delay: 0.4s; }
.comm-signal-bars .bar-7 { height: 40%; animation-delay: 0.6s; }
.comm-signal-bars .bar-8 { height: 65%; animation-delay: 0.25s; }

@keyframes commSignalPulsing {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* RAG Badges */
.comm-rag-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: rgba(8, 22, 44, 0.5);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.rag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.rag-dot-ok {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Sidebar Footer & Purge */
.comm-sidebar-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.comm-btn-log {
  width: 100%;
  padding: 0.4rem;
  font-size: 10px;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
}

.comm-btn-log:hover {
  color: #ffffff;
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.comm-purge-btn {
  width: 100%;
  padding: 0.4rem;
  font-size: 10px;
  color: #64748b;
  background: transparent;
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.comm-purge-btn:hover {
  color: #f87171;
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

/* Cyber Error Card (Disabled Feature State) */
.agent-comm-error-card {
  margin: auto;
  max-width: 520px;
  background: rgba(18, 12, 16, 0.95);
  border: 2px solid #f43f5e;
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.25);
  text-align: center;
  position: relative;
}

.error-card-badge {
  display: inline-block;
  font-size: 10px;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.error-card-title {
  color: #f43f5e;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 0.35rem;
}

.error-card-code {
  color: #94a3b8;
  font-size: 10px;
  margin-bottom: 1rem;
}

.error-card-text {
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.cyber-btn-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid #f43f5e;
  color: #f43f5e;
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cyber-btn-error:hover {
  background: #f43f5e;
  color: #030712;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.6);
}

.cyber-btn {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #22d3ee;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: monospace;
}

.cyber-btn:hover {
  background: #06b6d4;
  color: #030712;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.cyber-btn-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.cyber-btn-warning:hover {
  background: #f59e0b;
  color: #030712;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* AI COMM Buffer Log Viewer Window */
.comm-log-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.75rem 1rem;
  background: #060a12;
  color: #e2e8f0;
  box-sizing: border-box;
  overflow: hidden;
}

.comm-log-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
  flex-shrink: 0;
}

.comm-log-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  color: #22d3ee;
  letter-spacing: 0.5px;
}

.comm-log-scrollable {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comm-log-scrollable::-webkit-scrollbar {
  width: 5px;
}
.comm-log-scrollable::-webkit-scrollbar-track {
  background: rgba(4, 8, 18, 0.6);
}
.comm-log-scrollable::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.35);
  border-radius: 2px;
}

.comm-log-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(10, 18, 32, 0.5);
  border: 1px dashed rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  margin: auto 0;
}

.comm-log-card {
  background: rgba(10, 19, 34, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-left: 3px solid #06b6d4;
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s ease;
}

.comm-log-card:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.comm-log-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.12);
  font-size: 11px;
}

.comm-log-prompt-preview {
  font-size: 11px;
  color: #94a3b8;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: auto;
}

.comm-log-tag {
  font-size: 9px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.comm-log-tag.tag-ok {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.comm-log-tag.tag-error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.comm-log-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.comm-log-step {
  background: rgba(4, 10, 20, 0.75);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 3px;
  padding: 0.45rem 0.65rem;
  font-size: 11px;
}

.comm-step-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  line-height: 1.4;
}

.comm-step-feedback {
  margin-top: 0.35rem;
  padding-left: 0.4rem;
  border-left: 2px solid rgba(6, 182, 212, 0.3);
  font-size: 10px;
  color: #cbd5e1;
  word-break: break-word;
  line-height: 1.45;
}

.comm-log-code {
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 2px;
}

.comm-log-code.code-200 {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.comm-log-code.code-429 {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.comm-log-code.code-err {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.comm-log-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.6rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  flex-shrink: 0;
}

/* Responsive Mobile Handling (<768px) */
@media (max-width: 768px) {
  .agent-comm-container {
    flex-direction: column;
  }

  .agent-comm-main-panel {
    border-right: none;
    flex: 1;
  }

  /* Hide sidebar on mobile to prioritize full-height chat stream */
  .agent-comm-sidebar {
    display: none !important;
  }

  /* Mobile Subheader Avatar (30x30) */
  .comm-mobile-avatar-wrap {
    display: block;
  }

  /* Minimized Subheader */
  .agent-comm-sub-header {
    padding: 0.35rem 0.65rem;
    font-size: 10px;
    gap: 0.5rem;
  }

  .comm-stream-indicator span.text-cyan-300 {
    font-size: 10px;
  }

  .comm-operator-tag {
    font-size: 10px;
  }

  /* Right-aligned daily limit below the chat */
  .agent-comm-dock-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.25rem 0.75rem 0.35rem;
  }

  .user-bubble, .ai-bubble {
    max-width: 95%;
  }
}



