/* ==========================================================================
   Aloe Liquid Glass macOS 26 Design System
   ========================================================================== */

:root {
  /* Elegant Lighter Midnight Contrast Palette - Production Ready */
  --bg-app: rgba(13, 16, 28, 0.93);
  --bg-sidebar: rgba(16, 20, 35, 0.65);
  --bg-card: rgba(26, 32, 56, 0.45);
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glass-hover: rgba(255, 255, 255, 0.1);
  
  --accent-primary: #818cf8; /* Sleek Electric Indigo */
  --accent-primary-glow: rgba(129, 140, 248, 0.15);
  --accent-secondary: #c084fc; /* Royal Violet */
  --accent-secondary-glow: rgba(192, 132, 252, 0.12);
  --accent-success: #10b981; /* Deep Jade Green */
  --accent-success-glow: rgba(16, 185, 129, 0.12);
  --accent-warning: #f59e0b; /* Amber */
  --accent-danger: #ef4444; /* Neon Crimson Red */
  --accent-danger-glow: rgba(239, 68, 68, 0.12);
  
  /* Text Contrast System - Significantly Brightened for Readability */
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1; /* Warm silver-slate */
  --text-muted: #94a3b8; /* Clear visible gray */
  
  /* Layout Dimensions */
  --sidebar-width: 280px;
  --titlebar-height: 48px;
  
  /* Fonts */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'Courier New', monospace;
}

/* Base Adjustments */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: #0b0d18; /* Sophisticated Midnight Slate */
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Global Form Fields Contrast Reset */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  background-color: rgba(0, 0, 0, 0.22) !important;
  border: 1px solid var(--border-glass) !important;
  color: #ffffff !important;
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
  transition: all 0.25s ease;
}

body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme input[type="password"],
body.light-theme input[type="email"],
body.light-theme select,
body.light-theme textarea {
  background-color: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1e1e24 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2) !important;
}

/* Custom Draggable Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   Liquid Background Ambient Glow Orbs
   ========================================================================== */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.06;
  mix-blend-mode: screen;
  animation: float 28s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-primary) 0%, rgba(99,102,241,0) 70%);
  top: -10%;
  left: 10%;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, rgba(168,85,247,0) 70%);
  bottom: -20%;
  right: 5%;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #3b82f6 0%, rgba(59,130,246,0) 70%);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0% {
    transform: translate(0px, 0px) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(60px, -40px) scale(1.15) rotate(180deg);
  }
  100% {
    transform: translate(-40px, 50px) scale(0.9) rotate(360deg);
  }
}

/* ==========================================================================
   Titlebar
   ========================================================================== */
.app-titlebar {
  height: var(--titlebar-height);
  background: rgba(13, 16, 28, 0.35);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  -webkit-app-region: drag;
  z-index: 10;
}

.window-controls-spacer {
  width: 72px; /* Leaves room for standard macOS Traffic Lights */
}

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

.app-badge {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  box-shadow: 0 0 12px var(--accent-primary-glow);
  letter-spacing: 0.5px;
}

.titlebar-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: color 0.3s;
}

.titlebar-status.running {
  color: var(--accent-success);
  text-shadow: 0 0 6px var(--accent-success-glow);
}

.titlebar-status.starting {
  color: var(--accent-warning);
  animation: pulse-glow 1.5s infinite alternate;
}

.titlebar-actions {
  -webkit-app-region: no-drag;
}

#btn-toggle-theme {
  display: none !important;
}

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

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

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

.icon-btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ==========================================================================
   Main Shell
   ========================================================================== */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: var(--bg-app);
  backdrop-filter: blur(28px) saturate(120%);
}

/* Left Navigation Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s;
}

.app-sidebar.collapsed {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
}

.sidebar-brand-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  width: 100%;
}

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

/* Profile Dropdown Trigger */
.profile-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-trigger-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.profile-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(129, 140, 248, 0.2);
}

.user-avatar-mini {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

/* Profile Dropdown Menu */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: rgba(13, 16, 28, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(129, 140, 248, 0.06);
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.profile-dropdown-menu.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

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

.profile-avatar-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.profile-info-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.profile-email-address {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.profile-menu-divider {
  height: 1px;
  background: var(--border-glass);
}

.profile-menu-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  width: 100%;
}

.profile-menu-item:hover {
  background: rgba(129, 140, 248, 0.08);
  border-color: rgba(129, 140, 248, 0.25);
  color: var(--accent-primary);
}

.profile-menu-item#btn-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.brand-logo:hover {
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 6px 16px rgba(192, 132, 252, 0.35);
}

.logo-mascot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  border-radius: 50%;
}

.brand-meta h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-meta span {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Sidebar sessions section */
.sidebar-sessions-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  overflow-y: auto;
  border-top: none;
  margin-top: 5px;
  margin-bottom: 15px;
}

.sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.sessions-header span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.sessions-new-btn,
.sessions-delete-all-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sessions-new-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
}

.sessions-delete-all-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-danger);
}

.sessions-new-btn svg,
.sessions-delete-all-btn svg {
  width: 14px;
  height: 14px;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-group-header {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  padding: 14px 10px 4px 10px;
  text-transform: uppercase;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 12.5px;
  border: 1px solid transparent;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.session-item.active {
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: var(--text-primary);
}

.session-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.session-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
}

.session-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Empty vs Filled session differentiations */
.session-item.empty-session {
  opacity: 0.7;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}
.session-item.empty-session:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.15);
}

.session-item.filled-session {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.session-item.active.empty-session {
  opacity: 1;
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.session-item.active.filled-session {
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.session-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.session-item:hover .session-delete-btn {
  display: flex;
}

.session-delete-btn:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.session-delete-btn svg {
  width: 12px;
  height: 12px;
}

/* Sidebar Footer (Local Model status + controls) */
.sidebar-footer {
  margin-top: auto;
}

.model-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.model-title {
  font-size: 12.5px;
  font-weight: 600;
}

.model-status-text {
  font-size: 10.5px;
  color: var(--text-muted);
}

.model-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

.btn {
  width: 100%;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary) 100%);
  color: white;
  box-shadow: 0 4px 12px var(--accent-primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-primary-glow);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary.server-running {
  background: linear-gradient(135deg, var(--accent-danger) 0%, var(--accent-danger) 100%);
  box-shadow: 0 4px 12px var(--accent-danger-glow);
}

.btn-primary.server-running:hover {
  box-shadow: 0 6px 16px var(--accent-danger-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
  box-shadow: 0 4px 12px var(--accent-danger-glow);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-danger-glow);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  flex: 1;
  overflow: hidden;
  padding: 24px;
}

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

/* Workspace Grid (Split Screen Chat & Dashboard) */
.workspace-grid {
  display: flex;
  flex: 1;
  gap: 24px;
  overflow: hidden;
}

/* Left Column: Chat Container */
.chat-container {
  flex: 1.3;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.session-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bubble Styling */
.message {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: slide-up 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message.system {
  align-self: center;
  max-width: 90%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px 16px;
}

.message.system .message-content {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.5;
}

.message.system .hint {
  color: var(--accent-primary);
  font-weight: 500;
  margin-top: 6px;
}

.message-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message.user .message-sender {
  text-align: right;
}

.message-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  position: relative;
  user-select: text !important;
}

.message-content * {
  user-select: text !important;
}

/* Collapsible message bubbles when content is too long */
.message-content.collapsible {
  max-height: 280px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding-bottom: 36px; /* Leave space for the View More button */
}

.message-content.collapsible.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(13, 16, 28, 0.98) 15%, rgba(13, 16, 28, 0.7) 45%, transparent 100%);
  pointer-events: none;
  z-index: 2;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}

/* Match the gradient background for User messages to their distinctive indigo tint */
.message.user .message-content.collapsible.collapsed::after {
  background: linear-gradient(to top, rgba(20, 18, 42, 0.98) 15%, rgba(20, 18, 42, 0.7) 45%, transparent 100%);
}

.view-more-btn {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e0e7ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 0px rgba(255, 255, 255, 0.1);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.view-more-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.65);
  color: #ffffff;
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.view-more-btn svg {
  transition: transform 0.2s ease;
}

.view-more-btn:hover svg {
  transform: translateY(1px);
}

.message.user .message-content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.06) 100%);
  border-color: rgba(99, 102, 241, 0.15);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.05);
}

.message.assistant .message-content {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-glass);
}

/* Markdown Rendering Inside Bubbles */
.message-content p {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.6;
}
.message-content p:last-child {
  margin-bottom: 0;
}
.message-content strong {
  color: #c4b5fd;
  font-weight: 600;
}
.message-content em {
  color: var(--text-secondary);
  font-style: italic;
}
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  color: #e2d9f3;
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 8px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.message-content h1 { font-size: 1.4em; border-bottom: 1px solid rgba(196,181,253,0.15); padding-bottom: 5px; }
.message-content h2 { font-size: 1.22em; border-bottom: 1px solid rgba(196,181,253,0.08); padding-bottom: 4px; }
.message-content h3 { font-size: 1.12em; color: #c4b5fd; }
.message-content h4 { font-size: 1.02em; color: #a78bfa; }

.message-content a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}
.message-content a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.message-content code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  color: #f472b6; /* High-contrast pinkish highlight for inline code */
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.message-content pre {
  margin: 12px 0;
  background: rgba(8, 10, 20, 0.85);
  border: 1px solid rgba(196,181,253,0.1);
  border-top: 2px solid rgba(196,181,253,0.25);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 2px 12px rgba(0,0,0,0.2);
}

.message-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  font-size: 11.5px;
  color: #e2e8f0;
}

.message-content ul,
.message-content ol {
  margin-top: 6px;
  margin-bottom: 10px;
  padding-left: 20px;
}
.message-content ul {
  list-style-type: disc;
}
.message-content ol {
  list-style-type: decimal;
}
.message-content li {
  margin-bottom: 4px;
  line-height: 1.55;
}
.message-content li::marker {
  color: var(--accent-primary);
  font-weight: bold;
}

.message-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  background: rgba(196, 181, 253, 0.05);
  border-left: 3px solid #c4b5fd;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-secondary);
}
.message-content blockquote p {
  margin-bottom: 0;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  overflow: hidden;
}
.message-content th,
.message-content td {
  padding: 8px 12px;
  border: 1px solid var(--border-glass);
  text-align: left;
}
.message-content th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--text-primary);
}
.message-content tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.message-content hr {
  border: none;
  border-top: 1px solid rgba(196,181,253,0.12);
  margin: 16px 0;
}

/* Thinking Indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.01);
}

.thinking-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.alarm-pulse-icon {
  animation: alarm-pulse 1.4s infinite ease-in-out;
}

@keyframes alarm-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  20%, 60% { transform: scale(1.12) rotate(-8deg); }
  40%, 80% { transform: scale(1.12) rotate(8deg); }
}

.thinking-indicator span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Chat Input Area */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
}

.chat-form {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.chat-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 12px 50px 12px 70px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.chat-input:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.1);
}

.send-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

/* Mini Stats Telemetry Widget Styling */
.stats-trigger-btn {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-sans) !important;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.stats-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  border-color: rgba(192, 132, 252, 0.3) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.08);
}

.stats-trigger-btn.circle-meter:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.15) !important;
  border-color: rgba(192, 132, 252, 0.25) !important;
}

.stats-trigger-btn:active {
  transform: translateY(0);
}

.stats-dropdown-popup {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stats-dropdown-popup.show {
  display: flex !important;
}

/* Right Column: Goal Planner & Trace Timeline */
.workspace-observability {
  width: 100%;
  max-width: 420px;
  flex: 0.9;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  min-height: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.workspace-observability.collapsed {
  flex: 0;
  width: 0;
  max-width: 0;
  min-width: 0;
  gap: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.obs-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.card-goals {
  flex: 0 0 auto;
  max-height: 40%;
  min-height: 0;
}

.card-traces {
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Premium Floating Scroll to Bottom button */
.scroll-bottom-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(13, 16, 28, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(129, 140, 248, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 
              0 0 15px rgba(129, 140, 248, 0.08), 
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

.scroll-bottom-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.scroll-bottom-btn:hover {
  background: rgba(24, 28, 48, 0.95);
  border-color: var(--accent-secondary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 
              0 0 20px rgba(129, 140, 248, 0.2), 
              inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transform: translateX(-50%) translateY(-2px);
}

.scroll-bottom-btn:active {
  transform: translateX(-50%) translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 
              0 0 10px rgba(129, 140, 248, 0.1), 
              inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.scroll-bottom-btn svg {
  width: 12px;
  height: 12px;
  animation: trace-bounce-slow 2s infinite alternate ease-in-out;
  color: var(--accent-secondary);
  flex-shrink: 0;
}

@keyframes trace-bounce-slow {
  0% { transform: translateY(-1px); }
  100% { transform: translateY(2px); }
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
}

.badge-accent {
  background: rgba(192, 132, 252, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.2);
  color: var(--accent-secondary);
}

.turn-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  padding: 2px 5px;
}

.turn-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.turn-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.turn-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.turn-nav-label {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  line-height: 1;
}

.card-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.goal-statement-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 14px;
}

.goal-statement-box .label, 
.subgoals-section .label,
.obs-card .meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.goal-statement-box .value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.subgoals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subgoal-item {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: slide-up 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.subgoal-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(129, 140, 248, 0.3);
  transform: translateY(-1.5px) scale(1.01);
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.05);
}

.subgoal-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: transparent;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.subgoal-item:hover .subgoal-checkbox {
  border-color: var(--accent-secondary);
  transform: scale(1.1);
}

.subgoal-item.done {
  color: var(--text-muted);
  background: rgba(16, 185, 129, 0.02);
  border-color: rgba(16, 185, 129, 0.15);
}

.subgoal-item.done span {
  text-decoration: line-through;
  opacity: 0.65;
}

.subgoal-item.done .subgoal-checkbox {
  border-color: var(--accent-success);
  background: linear-gradient(135deg, var(--accent-success) 0%, #34d399 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.empty-state, .empty-trace-state {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* Trace Timeline Styling */
#trace-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 10px;
}

#trace-timeline::before {
  content: '';
  position: absolute;
  left: 25px; /* Aligned perfectly with the circular phase icons */
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(129, 140, 248, 0.1) 0%,
    rgba(168, 85, 247, 0.25) 30%,
    rgba(244, 114, 182, 0.25) 70%,
    rgba(16, 185, 129, 0.1) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Premium humanized trace nodes */
/* ==========================================================================
   Execution Trace — Phase-based layout
   ========================================================================== */

/* Phase section container */
.phase-section {
  position: relative;
  z-index: 2; /* Elevated above the timeline gradient line */
  margin-left: 30px; /* Shifts card to the right to make room for pulled-out timeline nodes */
  background: linear-gradient(135deg, rgba(20, 24, 43, 0.7) 0%, rgba(10, 12, 22, 0.75) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  animation: slide-up 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.phase-section.phase-pending {
  opacity: 0.45;
  background: linear-gradient(135deg, rgba(20, 24, 43, 0.3) 0%, rgba(10, 12, 22, 0.35) 100%);
}

.phase-section.phase-active {
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(168, 85, 247, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.005);
}

.phase-section.phase-done {
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(16, 185, 129, 0.06);
  opacity: 0.92;
}

.phase-section.phase-error {
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(239, 68, 68, 0.15);
}

.phase-section.phase-skipped {
  opacity: 0.28;
  filter: grayscale(0.6);
  background: linear-gradient(135deg, rgba(20, 24, 43, 0.2) 0%, rgba(10, 12, 22, 0.25) 100%);
  pointer-events: none;
}

.phase-status-pill.skipped {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Phase header row */
.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  user-select: none;
  cursor: pointer;
  transition: background 0.25s ease, border-bottom-color 0.25s ease;
  position: relative;
}

.phase-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.phase-section.collapsed .phase-header {
  border-bottom-color: transparent;
}

.phase-section.collapsed .phase-log-body {
  display: none !important;
}

.phase-section.collapsed .phase-toggle-icon {
  transform: rotate(-90deg);
}

.phase-icon {
  position: absolute;
  left: -30px; /* Pulls the icon outside the left card border */
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.phase-section.phase-active .phase-icon {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.phase-section.phase-done .phase-icon {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.phase-section.phase-error .phase-icon {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.phase-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.phase-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.phase-desc {
  font-size: 10.5px;
  color: var(--text-muted);
}

.phase-status-pill {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

.phase-status-pill.running {
  background: rgba(192, 132, 252, 0.1);
  color: var(--accent-secondary);
  border-color: rgba(192, 132, 252, 0.25);
  animation: pulse-glow-glass 2s infinite alternate;
}

.phase-status-pill.done {
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-success);
  border-color: rgba(16, 185, 129, 0.2);
}

.phase-status-pill.error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

@keyframes pulse-glow-glass {
  100% { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.08); }
}

/* Log body inside a phase */
.phase-log-body {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

/* Single log row */
.phase-log-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.phase-log-row.clickable {
  cursor: pointer;
}

.phase-log-row.clickable:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.phase-log-row:not(.clickable):hover {
  background: rgba(255, 255, 255, 0.015);
}

/* Collapsible row chevron details */
.row-toggle-icon {
  font-size: 8px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-left: 6px;
  transition: transform 0.2s ease, opacity 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.phase-log-row.clickable:hover .row-toggle-icon {
  opacity: 0.8;
}

.phase-log-item.expanded .row-toggle-icon {
  transform: rotate(90deg);
}

/* Collapsible trace detail block */
.phase-log-details {
  display: none;
  background: rgba(10, 12, 22, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin: 6px 14px 12px 14px;
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
  animation: trace-detail-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

@keyframes trace-detail-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.phase-log-item.expanded .phase-log-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.detail-header-title {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-copy-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-0.5px);
}

.detail-copy-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
}

.detail-body {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* Premium Parameter Grid */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 8px 10px;
}

.detail-grid-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 5px;
}

.detail-grid-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-grid-key {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--accent-secondary);
  opacity: 0.95;
  min-width: 90px;
  max-width: 120px;
  padding-top: 1px;
  flex-shrink: 0;
}

.detail-grid-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #e2e8f0;
  flex: 1;
  word-break: break-all;
}

.detail-grid-pre {
  margin: 2px 0 0 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: pre-wrap;
  color: #a7f3d0;
  max-height: 120px;
  overflow-y: auto;
}

.detail-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  height: auto;
  margin: 0;
  max-height: none;
}

/* Collapsible Pre Blocks */
.collapsible-pre-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.collapsible-pre {
  max-height: 120px;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding-bottom: 24px; /* Space for the overlay */
}

.collapsible-pre.expanded {
  max-height: 800px;
  overflow-y: auto;
  padding-bottom: 30px;
}

.pre-expand-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(to top, rgba(10, 12, 22, 0.95) 0%, rgba(10, 12, 22, 0.6) 50%, rgba(10, 12, 22, 0) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-secondary);
  transition: all 0.25s ease;
  user-select: none;
}

.pre-expand-overlay:hover {
  background: linear-gradient(to top, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, rgba(168, 85, 247, 0) 100%);
  color: #f472b6;
}

/* Custom scrollbar inside details content */
.detail-content::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.detail-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.detail-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

.phase-log-row.log-error {
  color: var(--accent-danger);
}

.phase-log-row.log-warn {
  color: #e0af68;
}

.log-ts {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.7;
}

.log-glyph {
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0.6;
  min-width: 12px;
  text-align: center;
}

.log-label {
  flex: 1;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.4;
}

.log-detail {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}

/* Iteration divider inside react_loop */
.phase-iter-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-secondary);
  opacity: 0.85;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 16px;
  flex-shrink: 0;
}

.phase-iter-divider::before,
.phase-iter-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(244, 114, 182, 0.25), transparent);
}

.goal-verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.goal-verification-badge.achieved {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.1);
  animation: gv-pulse-success 2s infinite alternate;
}
.goal-verification-badge.incomplete {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.1) 0%, rgba(202, 138, 4, 0.05) 100%);
  border-color: rgba(234, 179, 8, 0.35);
  color: #facc15;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.1);
}
.goal-verification-badge .gv-icon { font-size: 12px; }

@keyframes gv-pulse-success {
  100% { 
    border-color: rgba(34, 197, 94, 0.55); 
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.25); 
  }
}

/* ==========================================================================
   Tab 2: Skills Dashboard
   ========================================================================== */
.skills-dashboard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.sub-tabs-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.dashboard-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.firewall-policy-card {
  background: linear-gradient(135deg, rgba(24, 28, 48, 0.4) 0%, rgba(13, 16, 28, 0.45) 100%);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
}

.firewall-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.firewall-status-header .status-meta h3 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.status-indicator-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  padding: 6px 12px;
  border-radius: 99px;
}

.indicator-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  animation: pulse-glow-green 1.5s infinite alternate;
}

@keyframes pulse-glow-green {
  100% { transform: scale(1.2); box-shadow: 0 0 14px var(--accent-success); }
}

.firewall-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.policy-item h4 {
  font-size: 13.5px;
  font-weight: 600;
}

.policy-item p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.select-wrapper {
  position: relative;
  max-width: 320px;
}

.select-wrapper select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.select-wrapper select:focus {
  border-color: var(--accent-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

.skill-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

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

.skill-meta h4 {
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.skill-policy {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
}

.skill-policy.auto {
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-success);
}

.skill-policy.gated {
  background: rgba(245, 158, 11, 0.08);
  color: var(--accent-warning);
}

.skill-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Tab 3: System Panel
   ========================================================================== */
.system-monitor {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  backdrop-filter: blur(10px);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

#console-log-search:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
  background: rgba(0, 0, 0, 0.25) !important;
}

.console-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 400px;
}

.console-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.console-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-xs {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
}

.console-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.console-line.system { color: var(--accent-primary); }
.console-line.llama { color: #38bdf8; }
.console-line.lemura { color: #f472b6; }
.console-line.error { color: var(--accent-danger); }
.console-line.warn { color: #e0af68; }

.console-filter-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.console-filter-select:hover {
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}

.console-filter-select option {
  background: #0f111a;
  color: var(--text-primary);
}

/* ==========================================================================
   FLOATING FIREWALL DIALOG MODAL
   ========================================================================== */
.firewall-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 5, 9, 0.6);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.firewall-modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 24px var(--accent-danger-glow);
  padding: 24px;
  animation: modal-slide-down 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@keyframes modal-slide-down {
  from { transform: translateY(-40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.firewall-modal-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.firewall-modal-header .header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  display: flex;
  align-items: center;
  justify-content: center;
}

.firewall-modal-header .header-icon svg {
  width: 22px;
  height: 22px;
}

.firewall-modal-header .header-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.firewall-modal-header .header-text span {
  font-size: 11px;
  color: var(--text-secondary);
}

.firewall-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
}

.font-mono {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-secondary);
}

.arguments-box {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow-x: auto;
  max-height: 180px;
  margin-top: 4px;
}

.security-note {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
}

.security-note p {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.firewall-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.firewall-modal-footer .btn {
  width: auto;
  min-width: 130px;
}

/* Universal Animation Utility */
@keyframes pulse-glow {
  0% { text-shadow: 0 0 2px var(--accent-warning); opacity: 0.8; }
  100% { text-shadow: 0 0 8px var(--accent-warning); opacity: 1; }
}

/* ==========================================================================
   Light Mode Glass Custom Variables
   ========================================================================== */
body.light-theme {
  --bg-app: rgba(255, 250, 250, 0.9);
  --bg-sidebar: rgba(253, 244, 245, 0.5);
  --bg-card: rgba(255, 255, 255, 0.7);
  --border-glass: rgba(199, 137, 164, 0.15);
  --border-glass-hover: rgba(199, 137, 164, 0.3);
  --text-primary: #3c2f41;
  --text-secondary: #605166;
  --text-muted: #95849c;
  --accent-primary: #ea580c; /* Sunset Orange */
  --accent-secondary: #db2777; /* Deep Hot Pink */
  background-color: #fcf5f7;
}

body.light-theme .glow-orb {
  opacity: 0.35;
}

body.light-theme .brand-meta h1 {
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .message.assistant .message-content {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .message.system {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .message-content strong {
  color: #0f172a;
}

body.light-theme .phase-section {
  background: rgba(0, 0, 0, 0.01);
}

body.light-theme .phase-section.phase-skipped {
  background: rgba(0, 0, 0, 0.005);
}

body.light-theme .phase-header {
  background: rgba(0, 0, 0, 0.025);
}

body.light-theme .phase-log-row {
  color: #334155;
}

body.light-theme .phase-log-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .arguments-box {
  background: rgba(0, 0, 0, 0.04);
  color: #334155;
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .console-box {
  background: rgba(255, 255, 255, 0.65);
}

body.light-theme .console-header {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .console-line.system {
  color: var(--accent-primary);
}

body.light-theme .chat-input {
  background: rgba(255, 255, 255, 0.6);
}

body.light-theme .chat-input:focus {
  background: rgba(255, 255, 255, 0.9);
}

body.light-theme .sidebar-nav button:hover,
body.light-theme .sidebar-nav button.active {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .model-box {
  background: rgba(255, 255, 255, 0.5);
}

/* Light mode overrides for settings/skills panel */
body.light-theme .config-section-card,
body.light-theme .firewall-policy-card {
  background: rgba(255, 255, 255, 0.7);
}

body.light-theme .config-field input[type="number"],
body.light-theme .config-field input[type="text"],
body.light-theme .config-field select {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
}

body.light-theme .config-field-toggle {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .toggle-track {
  background: rgba(0, 0, 0, 0.1);
}

body.light-theme .skill-card {
  background: rgba(255, 255, 255, 0.75);
}

body.light-theme .skill-icon {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .select-wrapper select {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
}

body.light-theme .prompt-meta {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .firewall-modal-overlay {
  background: rgba(200, 210, 230, 0.55);
}

/* Cloud Active Banner Notice */
.cloud-active-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(13, 148, 136, 0.03) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 0 12px rgba(56, 189, 248, 0.06);
  position: relative;
  overflow: hidden;
  animation: slide-down-banner 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cloud-active-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

@keyframes slide-down-banner {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.cloud-active-banner .banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.1);
}

.cloud-active-banner .banner-icon svg {
  width: 20px;
  height: 20px;
}

.cloud-active-banner .banner-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-active-banner .banner-content h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

.cloud-active-banner .banner-content p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cloud-active-banner .banner-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.cloud-active-banner .banner-actions .btn {
  width: auto;
  min-width: 150px;
  padding: 6px 12px;
  font-size: 11.5px;
  border-radius: 8px;
}

.config-section-card {
  background: linear-gradient(135deg, rgba(24, 28, 48, 0.4) 0%, rgba(13, 16, 28, 0.45) 100%);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
  color: var(--text-primary);
}

.config-section-title h3 {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.config-section-title svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.config-note {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 2px 8px;
}

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

.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.config-field label code {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(99,102,241,0.1);
  color: var(--accent-primary);
  padding: 1px 4px;
  border-radius: 3px;
}

.config-field input[type="number"],
.config-field input[type="text"],
.config-field input[type="password"],
.config-field select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.config-field input[type="number"]:focus,
.config-field input[type="text"]:focus,
.config-field input[type="password"]:focus,
.config-field select:focus {
  border-color: var(--accent-primary);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 40px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.password-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.config-field label svg {
  width: 13px;
  height: 13px;
  margin-right: 6px;
  vertical-align: middle;
  display: inline-block;
  color: var(--accent-primary);
  opacity: 0.85;
}

.config-field-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
}

.config-field-toggle label:first-child {
  text-transform: none;
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  transition: .3s;
  border-radius: 99px;
}

.toggle-track:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

input:checked + .toggle-track {
  background-color: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

input:checked + .toggle-track:before {
  transform: translateX(16px);
  background-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

.config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.config-actions .btn {
  width: auto;
  min-width: 100px;
}

.config-save-status {
  font-size: 12px;
  color: var(--accent-success);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.config-save-status.visible {
  opacity: 1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}

/* MCP Servers List */
.mcp-servers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcp-server-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcp-server-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mcp-server-row-header input[type="text"] {
  flex: 1;
}

.mcp-transport-select {
  width: 110px;
  flex-shrink: 0;
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 7px;
  color: var(--accent-danger);
  cursor: pointer;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

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

.btn-icon-danger svg {
  width: 14px;
  height: 14px;
}

.mcp-server-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mcp-server-fields .config-field {
  gap: 4px;
}

.mcp-server-fields .config-field label {
  font-size: 10px;
}

.mcp-server-fields.full-width {
  grid-template-columns: 1fr;
}

.mcp-empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  padding: 16px;
}

/* ==========================================================================
   Skills Dashboard Sub-Tabs Styling
   ========================================================================== */
.sub-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for standard browsers */
}

.sub-tabs-bar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.sub-tab-btn {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.sub-tab-btn svg {
  transition: transform 0.3s ease;
}

.sub-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1.5px);
}

.sub-tab-btn:hover svg {
  transform: scale(1.15);
}

.sub-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
}

.sub-tab-btn.active svg {
  color: white !important; /* Ensure icons turn white when active */
}

/* Sub-Tab Panel Transitions */
.sub-tab-panel {
  display: none;
  animation: subtab-fade-in 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sub-tab-panel.active {
  display: block;
}

@keyframes subtab-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Multimodal Attachment UI (Vision & Audio)
   ========================================================================== */
.attach-btn {
  position: absolute;
  left: 12px;
  bottom: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.attach-btn:hover {
  color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.attach-btn svg {
  width: 18px;
  height: 18px;
}

.mic-btn {
  position: absolute;
  left: 40px;
  bottom: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.mic-btn:hover {
  color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.mic-btn svg {
  width: 18px;
  height: 18px;
}

.mic-btn.recording {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.chat-attachment-preview-container {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
  backdrop-filter: blur(10px);
}

.attachment-preview-card {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.attachment-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.attachment-preview-card.audio-preview {
  width: 130px;
  height: 64px;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.audio-preview-icon {
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-preview-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.attachment-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-danger);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 5;
}

.attachment-remove-btn:hover {
  transform: scale(1.15) rotate(90deg);
  background: #f87171;
}

.attachment-remove-btn svg {
  width: 11px;
  height: 11px;
}

/* Chat bubble image adjustments */
.bubble-image-attachment:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.bubble-image-attachment {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bubble-audio-container svg {
  transition: transform 0.2s;
}

.bubble-audio-play-btn:hover svg {
  transform: scale(1.15);
}

/* ==========================================================================
   Chat Bubble Copy Clipboard UI
   ========================================================================== */
.bubble-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(13, 16, 28, 0.65);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.message-content:hover .bubble-copy-btn {
  opacity: 1;
}

.bubble-copy-btn:hover {
  color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.bubble-copy-btn svg {
  width: 14px;
  height: 14px;
}

.bubble-tts-btn {
  position: absolute;
  top: 8px;
  right: 40px;
  background: rgba(13, 16, 28, 0.65);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.message-content:hover .bubble-tts-btn {
  opacity: 1;
}

.bubble-tts-btn:hover {
  color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.bubble-tts-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.bubble-tts-btn svg {
  width: 14px;
  height: 14px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Advanced Agent Settings Collapsible Accordion & Premium Select Styles
   ────────────────────────────────────────────────────────────────────────── */

.advanced-agent-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.advanced-agent-toggle-header:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px -4px rgba(99, 102, 241, 0.15);
}

.advanced-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.accordion-arrow {
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(180deg); /* points down by default or is rotated */
}

.advanced-agent-toggle-header.collapsed .accordion-arrow {
  transform: rotate(90deg); /* points right when collapsed */
}

.advanced-toggle-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

/* Modern and smooth CSS grid-template-rows transition */
.advanced-config-accordion {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 1;
  overflow: hidden;
}

.advanced-config-accordion.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}

.advanced-accordion-content {
  min-height: 0;
  padding: 16px 4px 8px 4px;
}

.settings-subgroup-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 10px 0;
  border-left: 2px solid var(--accent-primary);
  padding-left: 8px;
  user-select: none;
}

/* Elegant glassmorphic styling for standard select fields */
select.config-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px !important;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select.config-select:hover {
  background-color: rgba(255, 255, 255, 0.07);
}

select.config-select option {
  background: #18181b; /* sleek deep dark bg */
  color: var(--text-primary);
  padding: 8px;
}

/* Custom Alert & Confirm Modals Glows & Borders */
#app-dialog-modal .firewall-modal-card {
  border: 1px solid var(--border-glass);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(249, 115, 22, 0.1);
}

#app-dialog-modal.warning .firewall-modal-card {
  border: 1px solid rgba(249, 115, 22, 0.3);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(249, 115, 22, 0.2);
}

#app-dialog-modal.danger .firewall-modal-card {
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   INPAGE INLINE FIREWALL CONFIRMATION CARDS
   ========================================================================== */
/* Agent steps group — wraps all tool approval cards for one run */
.agent-steps-group {
  width: 100%;
  border: 1px solid rgba(129, 140, 248, 0.14);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 12, 22, 0.45);
  animation: slide-up 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
body.light-theme .agent-steps-group {
  background: rgba(245, 246, 252, 0.85);
  border-color: rgba(99, 102, 241, 0.12);
}

.agent-steps-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(129, 140, 248, 0.1);
  transition: background 0.15s;
}
.agent-steps-toggle:hover { background: rgba(129, 140, 248, 0.05); }

.steps-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.agent-steps-group.collapsed .steps-chevron {
  transform: rotate(-90deg);
}

.steps-toggle-label { flex: 1; }

.steps-count-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-primary);
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.agent-steps-body {
  display: flex;
  flex-direction: column;
}

.agent-steps-group.collapsed .agent-steps-body {
  display: none;
}

/* Cards inside the group lose their outer border/radius — separated by a thin line */
.agent-steps-body .firewall-inline-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(129, 140, 248, 0.07);
  background: transparent;
  margin: 0;
  max-width: 100%;
  box-shadow: none;
}
.agent-steps-body .firewall-inline-card:last-child {
  border-bottom: none;
}

/* Firewall inline card — compact, content-first */
.firewall-inline-card {
  width: 100%;
  max-width: 560px;
  background: rgba(10, 12, 22, 0.55);
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: 10px;
  padding: 8px 10px 6px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slide-up 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: text !important;
}
.firewall-inline-card * { user-select: text !important; }

body.light-theme .firewall-inline-card {
  background: rgba(245, 246, 252, 0.9);
  border-color: rgba(99, 102, 241, 0.14);
}

/* Top bar: badge left, icon-buttons right */
.firewall-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.firewall-action-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
}
.firewall-action-badge span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Corner icon-only buttons */
.firewall-corner-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.fw-icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  padding: 0;
  background: transparent;
}
.fw-icon-btn svg { width: 11px; height: 11px; }

.fw-skip {
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.06);
}
.fw-skip:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.fw-stop {
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}
.fw-stop:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }

.fw-allow {
  color: #34d399;
  border-color: rgba(52,211,153,0.25);
}
.fw-allow:hover { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.45); }

body.light-theme .fw-skip { color: var(--text-secondary); border-color: rgba(0,0,0,0.08); }
body.light-theme .fw-skip:hover { background: rgba(0,0,0,0.05); }

/* Params — full width, no margin waste */
.firewall-params-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.firewall-param-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 5px 8px;
  width: 100%;
}

.firewall-param-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-secondary);
  opacity: 0.7;
}

.firewall-param-value-wrapper { width: 100%; }

.firewall-param-text {
  font-size: 11.5px;
  color: #f1f5f9;
  font-family: var(--font-mono);
  word-break: break-all;
}

.firewall-param-pre {
  margin: 0;
  background: rgba(0, 0, 0, 0.3) !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 5px 6px !important;
  font-size: 11px !important;
  color: #e2e8f0 !important;
  font-family: var(--font-mono) !important;
  max-height: 160px !important;
  overflow-y: auto !important;
  white-space: pre-wrap !important;
  word-break: break-all !important;
}

body.light-theme .firewall-param-row {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .firewall-param-text { color: #0f172a; }
body.light-theme .firewall-param-pre {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

/* Status bar — inline, minimal */
.firewall-status-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 0;
}
.firewall-status-bar.approved { color: #34d399; }
.firewall-status-bar.skipped  { color: var(--text-muted); }
.firewall-status-bar.stopped  { color: #f87171; }

/* Firewall footer actions & premium buttons */
.firewall-footer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.fw-footer-btn {
  flex: 1;
  height: 28px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

.fw-footer-btn.fw-cancel {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}
.fw-footer-btn.fw-cancel:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.fw-footer-btn.fw-accept {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.05);
}
.fw-footer-btn.fw-accept:hover {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.15);
}

body.light-theme .fw-footer-btn.fw-cancel {
  background: rgba(239, 68, 68, 0.04);
}
body.light-theme .fw-footer-btn.fw-accept {
  background: rgba(52, 211, 153, 0.04);
}


/* ==========================================================================
   About Page (Liquid Glass Aesthetic)
   ========================================================================== */
.about-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.about-glass-card {
  width: 100%;
  max-width: 680px;
  background: rgba(24, 28, 48, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fade-in-slide 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

@keyframes fade-in-slide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.about-logo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
}

.about-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(129, 140, 248, 0.2);
  z-index: 2;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-logo-wrapper:hover .about-logo {
  transform: scale(1.08) rotate(4deg);
}

.about-logo-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  filter: blur(20px);
  opacity: 0.5;
  z-index: 1;
  animation: pulse-logo 3s infinite alternate ease-in-out;
}

@keyframes pulse-logo {
  0% { transform: scale(0.9); opacity: 0.3; }
  100% { transform: scale(1.15); opacity: 0.6; }
}

.about-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-version {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
  background: rgba(249, 115, 22, 0.1);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.about-purpose {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 32px;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-bottom: 36px;
}

.about-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.about-stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.about-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.about-stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.about-footer {
  width: 100%;
  border-top: 1px solid var(--border-glass);
  padding-top: 24px;
  display: flex;
  justify-content: center;
}

.about-developer-badge {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.developer-name {
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  transition: all 0.3s;
}

.developer-name:hover {
  text-shadow: 0 0 10px var(--accent-secondary-glow);
}

.developer-name::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, var(--accent-secondary), var(--accent-primary));
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.developer-name:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

body.light-theme .about-glass-card {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 
    0 20px 50px rgba(15, 23, 42, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

body.light-theme .about-title {
  background: linear-gradient(135deg, #0f172a 30%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Tool Firewall Data Table & Premium Controls
   ========================================================================== */
.firewall-controls-card {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

body.light-theme .firewall-controls-card {
  background: rgba(255, 255, 255, 0.5);
}

.search-and-sync-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input-container {
  position: relative;
  flex: 1;
}

.search-input-container .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-container input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  outline: none;
  transition: all 0.25s;
}

body.light-theme .search-input-container input {
  background: rgba(0, 0, 0, 0.02);
}

.search-input-container input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}

.btn-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.25s;
  cursor: pointer;
  width: auto !important;
}

.btn-sync .sync-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.6s ease;
}

.btn-sync:hover .sync-icon {
  transform: rotate(180deg);
}

.btn-sync.syncing .sync-icon {
  animation: spin 1s infinite linear;
}

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

.filter-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

body.light-theme .filter-pill {
  background: rgba(0, 0, 0, 0.02);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.filter-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.bulk-policy-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.btn-bulk {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

body.light-theme .btn-bulk {
  background: rgba(0, 0, 0, 0.02);
}

.btn-bulk:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

/* Table Container Glass */
.table-container-glass {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
  transition: all 0.3s;
}

body.light-theme .table-container-glass {
  background: rgba(255, 255, 255, 0.3);
}

.firewall-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.firewall-data-table th, 
.firewall-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-glass);
}

.firewall-data-table th {
  background: rgba(0, 0, 0, 0.15);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

body.light-theme .firewall-data-table th {
  background: rgba(0, 0, 0, 0.03);
}

.firewall-data-table th.sortable {
  cursor: pointer;
}

.firewall-data-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.firewall-data-table th .sort-direction {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  transition: transform 0.2s;
}

.firewall-data-table tr {
  transition: background 0.15s;
}

.firewall-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

body.light-theme .firewall-data-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.01);
}

.firewall-data-table td code {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-secondary);
}

body.light-theme .firewall-data-table td code {
  background: rgba(0, 0, 0, 0.02);
}

.table-loading-row {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 0.8s infinite linear;
  vertical-align: middle;
  margin-right: 6px;
}

.text-right {
  text-align: right;
}

.policy-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.policy-badge.policy-accept {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.policy-badge.policy-ask {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.policy-badge.policy-deny {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Category Badges */
.category-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

body.light-theme .category-badge {
  background: rgba(0, 0, 0, 0.02);
}

.category-badge.mcp {
  background: rgba(192, 132, 252, 0.08);
  color: var(--accent-secondary);
  border-color: rgba(192, 132, 252, 0.2);
}

.tool-row-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dynamic Policy Selector Color-Coding */
.fw-tool-select.policy-select-accept,
#firewall-default-decision.policy-select-accept {
  color: #10b981 !important; /* Elegant Jade Green */
  border-color: rgba(16, 185, 129, 0.4) !important;
  background-color: rgba(16, 185, 129, 0.04) !important;
}

.fw-tool-select.policy-select-ask,
#firewall-default-decision.policy-select-ask {
  color: #f59e0b !important; /* Amber Orange */
  border-color: rgba(245, 158, 11, 0.4) !important;
  background-color: rgba(245, 158, 11, 0.04) !important;
}

.fw-tool-select.policy-select-deny,
#firewall-default-decision.policy-select-deny {
  color: #ef4444 !important; /* Neon Crimson Red */
  border-color: rgba(239, 68, 68, 0.4) !important;
  background-color: rgba(239, 68, 68, 0.04) !important;
}

.fw-tool-select.policy-select-inherit,
#firewall-default-decision.policy-select-inherit {
  color: var(--text-muted) !important;
  border-color: var(--border-glass) !important;
  background-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .fw-tool-select.policy-select-inherit,
body.light-theme #firewall-default-decision.policy-select-inherit {
  color: var(--text-secondary) !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
}

/* ==========================================================================
   Premium Glassmorphic Authentication System
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(13, 16, 32, 0.85) 0%, rgba(7, 9, 18, 0.96) 100%);
  backdrop-filter: blur(45px) saturate(130%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
  width: 440px;
  background: rgba(28, 35, 64, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 
    0 24px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 30%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg) translateY(-50%);
  animation: authShimmer 8s infinite linear;
  pointer-events: none;
}

@keyframes authShimmer {
  0% { transform: translate(-30%, -30%) rotate(25deg); }
  100% { transform: translate(30%, 30%) rotate(25deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cardEntrance {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.auth-logo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
}

.auth-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.3);
  z-index: 2;
  position: relative;
}

.auth-logo-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.6;
  z-index: 1;
  animation: pulse-glow 2s infinite alternate;
}

.auth-logo-container h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo-container p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-form-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.btn-auth-submit {
  padding: 12px 18px;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(129, 140, 248, 0.2);
  color: #fff;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(192, 132, 252, 0.35);
}

.auth-actions-row {
  display: flex;
  gap: 12px;
}

.auth-helper-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

/* Status Loading Display */
.auth-status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 16px;
}

.auth-status-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sidebar User Profile Widget styling */
.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
  text-transform: uppercase;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.user-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  padding: 0;
  text-align: left;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-logout:hover {
  color: var(--accent-danger);
}

/* Choice Cards Grid styling */
.choice-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin-top: 4px;
}

.choice-card {
  background: rgba(30, 41, 59, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.choice-card:hover {
  background: rgba(129, 140, 248, 0.05);
  border-color: rgba(129, 140, 248, 0.3);
  transform: translateY(-2px);
}

.choice-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 15px rgba(99, 102, 241, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.choice-card .card-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-glass);
}

.choice-card.active .card-icon {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.2);
}

.choice-card .card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-card .card-meta h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.choice-card .card-meta span {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Directive Buttons Styling */
.directive-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 900px;
  margin-top: 4px;
}

.directive-btn {
  background: rgba(30, 41, 59, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: inherit;
  font-family: inherit;
  outline: none;
}

.directive-btn:hover {
  background: rgba(129, 140, 248, 0.05);
  border-color: rgba(129, 140, 248, 0.3);
  transform: translateY(-1px);
}

.directive-btn.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-primary);
}

.directive-btn .btn-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.directive-btn.active .btn-check {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.directive-btn.active .btn-check::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.directive-btn h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.directive-btn span {
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive Mobile & Tablet Design Adapters
   ========================================================================== */

/* Tablet & Smaller Screens Layout Adjustments */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
  .app-sidebar {
    padding: 16px;
  }
  .choice-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .settings-grid,
  .monitoring-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}
/* Sidebar Close Button for Mobile Screens - Default Hidden */
.sidebar-mobile-close {
  display: none !important;
}

/* Mobile & Portrait Screens Responsive Flow */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 270px;
  }

  /* Sidebar Close Button Style for Mobile Viewports */
  .sidebar-mobile-close {
    display: flex !important;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .sidebar-mobile-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: rotate(90deg);
  }

  /* Slide-out Overlay Sidebar */
  .app-sidebar {
    position: fixed !important;
    top: var(--titlebar-height);
    left: 0;
    bottom: 0;
    z-index: 99999 !important;
    height: calc(100vh - var(--titlebar-height));
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
    background: rgba(13, 16, 28, 0.98) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.6);
    opacity: 1 !important;
    width: var(--sidebar-width) !important;
    padding: 20px !important;
  }

  /* When NOT collapsed, slide the sidebar in */
  .app-sidebar:not(.collapsed) {
    transform: translateX(0) !important;
  }

  /* Default collapsed state for mobile slides it out */
  .app-sidebar.collapsed {
    transform: translateX(-100%) !important;
    display: flex !important;
    opacity: 1 !important;
    width: var(--sidebar-width) !important;
    padding: 20px !important;
    border-right: none !important;
  }

  /* Dark Blurred Backdrop overlay when sidebar is open */
  .app-container::before {
    content: '';
    position: fixed;
    top: var(--titlebar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 4, 8, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Make backdrop active when sidebar is visible */
  .app-container:has(.app-sidebar:not(.collapsed))::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* Tab Panel and Content pane scales fully to full viewport width */
  .tab-panel {
    padding: 12px !important;
  }

  .main-content, 
  .chat-panel, 
  .tab-pane,
  .app-main {
    width: 100vw !important;
    min-width: 100vw !important;
    margin-left: 0 !important;
  }

  /* Titlebar adjustments */
  .window-controls-spacer {
    display: none !important;
  }
  .app-titlebar {
    padding: 0 12px !important;
  }

  /* Workspace Grid - Column Stacking */
  .workspace-grid {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Slide-up Details sheet on mobile (Observability panel) */
  .workspace-observability {
    position: fixed !important;
    top: var(--titlebar-height);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100vh - var(--titlebar-height));
    z-index: 99990 !important;
    background: rgba(13, 16, 28, 0.98) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 20px !important;
    transform: translateY(100%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s !important;
    opacity: 0;
    margin: 0 !important;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--border-glass);
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.6);
  }

  .workspace-observability:not(.collapsed) {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }

  .workspace-observability.collapsed {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    display: flex !important; /* Keep display flex to allow transform transitions */
  }

  /* Chat list bubble responsiveness */
  .chat-messages {
    padding: 16px !important;
  }
  .chat-message {
    max-width: 92% !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
  }
  .message-header {
    font-size: 11px !important;
  }

  /* Stack layout for grids */
  .choice-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .welcome-hero h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }
  .welcome-hero p {
    font-size: 13.5px !important;
  }

  /* Input panel adjustments */
  .chat-input-wrapper {
    margin: 10px !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }
  .chat-input-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Modal / Dialog Scale down */
  .modal-content, 
  .auth-card {
    width: 92% !important;
    max-width: 360px !important;
    padding: 24px 20px !important;
  }
  
  /* Choice config cards stacking */
  .choice-card {
    padding: 16px !important;
  }
}

/* Stats reset button secure hover state */
#btn-reset-stats:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ==========================================================================
   PREMIUM CUTE LEMUR EMPTY STATES
   ========================================================================== */
.lemur-empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  height: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.4s ease-out;
}

.lemur-mascot-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.lemur-empty-mascot {
  width: 90px;
  height: 90px;
  object-fit: contain;
  opacity: 0.16;
  filter: grayscale(100%) contrast(0.9);
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: lemur-float 4s infinite alternate ease-in-out;
}

.lemur-mascot-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.15) 0%, transparent 70%);
  opacity: 0.4;
  z-index: -1;
  animation: lemur-glow-pulse 4s infinite alternate ease-in-out;
}

.lemur-empty-view:hover .lemur-empty-mascot {
  opacity: 0.38;
  filter: grayscale(40%) contrast(1.1) drop-shadow(0 4px 12px rgba(192, 132, 252, 0.25));
  transform: translateY(-4px) scale(1.05);
}

.lemur-empty-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.lemur-empty-desc {
  margin: 0 0 16px 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

.lemur-empty-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.lemur-empty-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

/* Starter prompts */
.lemur-starter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  max-width: 360px;
}

.lemur-starter-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lemur-starter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.lemur-starter-chip {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  outline: none;
}

.lemur-starter-chip:hover {
  background: rgba(192, 132, 252, 0.08);
  border-color: rgba(192, 132, 252, 0.3);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(192, 132, 252, 0.1);
}

.lemur-starter-chip:active {
  transform: translateY(0);
}

@keyframes lemur-float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes lemur-glow-pulse {
  0% { transform: scale(0.9); opacity: 0.3; }
  100% { transform: scale(1.1); opacity: 0.5; }
}

/* Specific view adjustments */
.chat-container .lemur-empty-view {
  height: 100%;
  justify-content: center;
  padding: 40px 20px;
}

.chat-container .lemur-empty-mascot {
  width: 110px;
  height: 110px;
}

/* ==========================================================================
   Modern & Highly Polished Task Observability & Cron Card Styles
   ========================================================================== */

/* Active Running Task Box styling */
.active-task-box {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.active-task-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.active-task-box.running {
  border-color: rgba(129, 140, 248, 0.25);
  background: rgba(129, 140, 248, 0.01);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2), 
    0 0 15px rgba(129, 140, 248, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.02);
}

.active-task-box.running::before {
  opacity: 1;
  animation: active-task-scan 2s infinite linear;
}

@keyframes active-task-scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Upcoming Executions Queue Item */
.queue-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Responsive Grid for Cron Workflow Cards */
.cron-cards-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-right: 4px;
  margin-bottom: 12px;
}

/* Beautiful Cron Workflow Card */
.cron-card {
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  container-type: inline-size;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.cron-card:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(129, 140, 248, 0.25);
  transform: translateY(-2.5px);
  box-shadow: 
    0 8px 30px rgba(129, 140, 248, 0.06),
    0 1px 1px rgba(255, 255, 255, 0.05) inset,
    var(--shadow-premium);
}

/* Stylized Goal Inset Container (Avoids blank visual space) */
.cron-card-goal-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  min-height: 52px;
  display: flex;
  align-items: center;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cron-card-goal-text {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}

/* Metadata tag container */
.cron-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cron-card-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2.5px 6.5px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cron-card-tag-interval {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-secondary);
}

.cron-card-tag-rules {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

/* Card footer row */
.cron-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
  margin-top: auto;
  gap: 8px;
}

/* Smart responsive last run time display */
.cron-card-last-run {
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cron-card-last-run svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.7;
}

@container (min-width: 250px) {
  .cron-card-last-run {
    max-width: 180px;
  }
}

/* Card Actions styling */
.cron-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-cron-action {
  padding: 4px 8px;
  font-size: 10px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn-cron-action svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.btn-cron-action span {
  display: none;
}

@container (min-width: 250px) {
  .btn-cron-action {
    padding: 4px 10px;
  }
  .btn-cron-action span {
    display: inline;
  }
}

/* Action: Edit button style */
.btn-cron-edit {
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: var(--accent-primary);
  background: rgba(129, 140, 248, 0.03);
}

.btn-cron-edit:hover {
  background: rgba(129, 140, 248, 0.15);
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
  border-color: rgba(129, 140, 248, 0.5);
}

/* Action: Run Now style */
.btn-cron-run {
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  background: rgba(16, 185, 129, 0.03);
}

.btn-cron-run:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
}

/* Action: Delete style */
.btn-cron-delete {
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.03);
}

.btn-cron-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Titlebar Icon Navigation Button Overrides */
.titlebar-actions .nav-item {
  width: auto !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  gap: 0 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  transition: all 0.25s ease !important;
}

.titlebar-actions .nav-item svg {
  width: 16px !important;
  height: 16px !important;
}

.titlebar-actions .nav-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-primary) !important;
}

/* Core Engineering Group (Workspace, Tasks, Monitoring) Active State - Sleek Cyan/Teal Aura */
.titlebar-actions #nav-workspace.active,
.titlebar-actions #nav-tasks.active,
.titlebar-actions #nav-system.active {
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.12) !important;
}

/* Interaction Group (Session, Settings) Active State - Royal Amethyst/Purple Aura */
.titlebar-actions #nav-session.active,
.titlebar-actions #nav-skills.active {
  background: rgba(192, 132, 252, 0.08) !important;
  border-color: rgba(192, 132, 252, 0.25) !important;
  color: #c084fc !important;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.12) !important;
}

/* Premium Crimson Close Button */
.titlebar-actions .icon-btn-close {
  color: rgba(244, 63, 94, 0.65) !important;
  border: 1px solid transparent !important;
}

.titlebar-actions .icon-btn-close:hover {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #f43f5e !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.18) !important;
}

/* Premium Bordered Glassmorphic Navigation Groups */
.nav-btn-group {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border-glass) !important;
  border-radius: 8px !important;
  padding: 2px 6px !important;
  background: rgba(255, 255, 255, 0.01) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.01), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  position: relative;
  transition: all 0.25s ease !important;
}

.nav-btn-group:hover {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.nav-btn-group .group-title {
  font-size: 8px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.12em !important;
  padding: 2px 6px 2px 2px !important;
  border-right: 1px solid var(--border-glass) !important;
  margin-right: 4px !important;
  user-select: none !important;
  font-family: var(--font-mono) !important;
}

/* Premium Custom Weekday Selector Buttons */
.weekday-btn-group {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.weekday-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.weekday-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.weekday-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #000 !important;
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

/* ==========================================================================
   Goal Verification Warning Accordion (Premium Glassmorphic Design)
   ========================================================================== */
.goal-verification-warning {
  margin: 14px 0;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.03) 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.goal-verification-warning:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gvw-toggle {
  display: none !important;
}

.gvw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  user-select: none;
  background: rgba(239, 68, 68, 0.02);
  transition: background 0.2s ease;
}

.gvw-header:hover {
  background: rgba(239, 68, 68, 0.05);
}

.gvw-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f87171;
}

.gvw-warning-icon {
  width: 16px;
  height: 16px;
  color: #ef4444;
  flex-shrink: 0;
  animation: gvw-pulse-glow 2s infinite alternate;
}

@keyframes gvw-pulse-glow {
  0% { filter: drop-shadow(0 0 1px rgba(239, 68, 68, 0.4)); }
  100% { filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.95)); }
}

.gvw-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gvw-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 3px 8px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.gvw-chevron {
  width: 14px;
  height: 14px;
  color: #fca5a5;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gvw-content {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
  opacity: 1;
  padding: 14px 16px 16px 16px;
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gvw-toggle:not(:checked) ~ .gvw-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-top-color: transparent;
  pointer-events: none;
}

.gvw-toggle:not(:checked) ~ .gvw-header .gvw-chevron {
  transform: rotate(-90deg);
}

.gvw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gvw-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(252, 165, 165, 0.6);
  letter-spacing: 0.5px;
}

.gvw-value {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.gvw-value.status-unmet {
  color: #fca5a5;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gvw-value.status-unmet::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.gvw-value.missing-highlight {
  background: rgba(239, 68, 68, 0.05);
  border: 1px dashed rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fecaca;
  font-weight: 500;
}






