/* ==========================================================================
   Claw Ouroboros 2026: Elegant Cyberpunk Glassmorphism Studio Theme
   ========================================================================== */

:root {
  --bg-base: #030712;
  --bg-sidebar: rgba(10, 15, 28, 0.85);
  --bg-glass: rgba(13, 20, 38, 0.72);
  --bg-glass-card: rgba(16, 24, 46, 0.75);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --bg-input: rgba(6, 11, 22, 0.90);
  --bg-modal: rgba(8, 14, 28, 0.96);

  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(56, 189, 248, 0.35);
  --glass-border-active: rgba(6, 182, 212, 0.60);
  --glass-inset-light: inset 0 1px 1px 0 rgba(255, 255, 255, 0.10);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Vibrant Cyberpunk Neon Gradients */
  --neon-cyan: #00f2fe;
  --neon-cyan-dark: #0284c7;
  --neon-purple: #c084fc;
  --neon-purple-dark: #7c3aed;
  --neon-green: #34d399;
  --neon-green-dark: #059669;
  --neon-amber: #fbbf24;
  --neon-amber-dark: #d97706;
  --neon-red: #f87171;
  --neon-red-dark: #dc2626;

  /* Refined, Elegant Glow Effects (Subtle & Clean) */
  --glow-cyan: 0 2px 12px rgba(6, 182, 212, 0.25);
  --glow-purple: 0 2px 12px rgba(168, 85, 247, 0.25);
  --glow-green: 0 2px 12px rgba(16, 185, 129, 0.25);
  --glow-amber: 0 2px 12px rgba(245, 158, 11, 0.25);

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 68px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --blur: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  background-image: 
    radial-gradient(circle at 12% 12%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(16, 24, 46, 0.85) 0%, rgba(3, 7, 18, 1) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom Cyberpunk Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(3, 7, 18, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.6);
}

/* Layout */
.app-wrapper {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Mobile Hamburger & Backdrop */
.mobile-hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 110;
  transition: all 0.2s ease;
}

.mobile-hamburger-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 95;
}

.sidebar-backdrop.active {
  display: block;
}

/* Reusable Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  stroke: var(--neon-cyan);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.4));
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.3)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(6, 182, 212, 0.7)); transform: scale(1.05); }
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(var(--blur)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar.collapsed .sidebar-brand span,
.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .sidebar-badge-count {
  display: none;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
}

/* Nav Menu */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-item-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.nav-item-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.nav-item-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.20) 0%, rgba(168, 85, 247, 0.14) 100%);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: var(--neon-cyan);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.18), inset 0 0 10px rgba(6, 182, 212, 0.10);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.nav-item-btn.active .nav-icon {
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.6));
}

/* Sidebar Badges */
.sidebar-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 32px;
  transition: margin 0.25s ease;
}

.main-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px 22px;
}

/* Glass Cards */
.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(var(--blur)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset-light), 0 8px 28px 0 rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-green {
  background: rgba(16, 185, 129, 0.14);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-blue {
  background: rgba(6, 182, 212, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.14);
  color: var(--neon-purple);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.14);
  color: var(--neon-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-red {
  background: rgba(239, 68, 68, 0.14);
  color: var(--neon-red);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Studio 2-Column Grid & Responsive Adaptations */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease, box-shadow 0.3s ease;
  }
  .app-sidebar.mobile-open {
    left: 0;
    box-shadow: 8px 0 32px rgba(0,0,0,0.8);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .app-main {
    padding: 12px 14px;
    width: 100%;
  }
  .studio-grid,
  .form-grid,
  #model-roles-editor-grid,
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
  .mobile-hamburger-btn {
    display: inline-flex !important;
  }
  .chat-container-layout {
    grid-template-columns: 1fr !important;
  }
  .chat-sessions-sidebar {
    margin-bottom: 12px;
    max-height: 200px;
  }
  .chat-selectors-row {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .chat-selectors-row > div {
    width: 100% !important;
    min-width: 0 !important;
  }
  .chat-selectors-row select {
    width: 100% !important;
    max-width: 100% !important;
    text-overflow: ellipsis;
  }
  .main-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
}

@media (max-width: 1024px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 8px;
}

/* Inputs & Form Elements */
textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  background: rgba(8, 14, 28, 0.96);
}

/* Buttons with Elegant, Subtle Glow */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  background-clip: padding-box;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.24) 0%, rgba(37, 99, 235, 0.38) 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 242, 254, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(0, 242, 254, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.38) 0%, rgba(37, 99, 235, 0.55) 100%);
  border-color: var(--neon-cyan);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 20px rgba(0, 242, 254, 0.6);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}

.btn-success {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.24) 0%, rgba(5, 150, 105, 0.38) 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(52, 211, 153, 0.35);
}
.btn-success:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.38) 0%, rgba(5, 150, 105, 0.55) 100%);
  border-color: var(--neon-green);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 20px rgba(52, 211, 153, 0.6);
}

.btn-purple {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.24) 0%, rgba(124, 58, 237, 0.38) 100%);
  color: #ffffff;
  border: 1px solid rgba(192, 132, 252, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(192, 132, 252, 0.35);
}
.btn-purple:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.38) 0%, rgba(124, 58, 237, 0.55) 100%);
  border-color: var(--neon-purple);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 20px rgba(192, 132, 252, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.24) 0%, rgba(220, 38, 38, 0.38) 100%);
  color: #ffffff;
  border: 1px solid rgba(248, 113, 113, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.38) 0%, rgba(220, 38, 38, 0.55) 100%);
  border-color: var(--neon-red);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 20px rgba(248, 113, 113, 0.6);
}

/* Template Chips Bar */
.template-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.template-chips-bar::-webkit-scrollbar {
  height: 3px;
}

/* Form Actions Row */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .form-actions {
    justify-content: stretch;
  }
  .form-actions .btn {
    flex: 1 1 100%;
  }
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.22s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Code & Terminal */
pre, code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

pre {
  background: rgba(4, 7, 14, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  overflow-x: auto;
  color: #38bdf8;
}

/* Metrics Grid & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Task Tables */

.tasks-table, .task-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.tasks-table th, .tasks-table td,
.task-table th, .task-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  vertical-align: middle;
}

.tasks-table th, .task-table th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  background: rgba(8, 14, 28, 0.8);
  border-bottom: 1px solid var(--glass-border);
}

.tasks-table tr, .task-table tr {
  cursor: pointer;
  transition: all 0.15s ease;
}

.tasks-table tbody tr:hover td, .task-table tbody tr:hover td {
  background: rgba(6, 182, 212, 0.05);
}

.tasks-table tbody tr:active td, .task-table tbody tr:active td {
  background: rgba(6, 182, 212, 0.10);
}

/* Pipeline Stepper for B2B Harness */
.pipeline-stepper {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0;
  margin-bottom: 16px;
}

.pipeline-step {
  flex: 1;
  min-width: 90px;
  background: rgba(10, 15, 28, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pipeline-step.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(168, 85, 247, 0.16) 100%);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.pipeline-step.completed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.pipeline-step-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--glass-border-active);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Sub-Tabs */
.subtabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
  overflow-x: auto;
}

.subtab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subtab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.subtab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.20) 0%, rgba(168, 85, 247, 0.14) 100%);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* Cyberpunk Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.45) 0%, rgba(16, 185, 129, 0.45) 100%);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

/* Process & Resource Manager (Task Manager) */
.proc-metric-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}

.proc-metric-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.proc-metric-fill-cyan {
  background: linear-gradient(90deg, var(--neon-cyan) 0%, #38bdf8 100%);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.proc-metric-fill-purple {
  background: linear-gradient(90deg, var(--neon-purple) 0%, #a855f7 100%);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.proc-mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proc-mini-bar-track {
  width: 60px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.proc-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.proc-kill-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--neon-red);
  padding: 3px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.proc-kill-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: var(--neon-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.proc-kill-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Architect Studio Enhancements */
.arch-profile-btn {
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.arch-profile-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 3px 8px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.chip-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--neon-cyan);
  transform: translateY(-1px);
}

.btn-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-subtle.active {
  background: rgba(6, 182, 212, 0.2);
  color: var(--neon-cyan);
  font-weight: 600;
}

.markdown-preview, .markdown-body {
  line-height: 1.6;
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
}

.markdown-preview h1, .markdown-body h1 {
  color: var(--neon-cyan);
  margin: 16px 0 10px 0;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
  padding-bottom: 6px;
}

.markdown-preview h2, .markdown-body h2 {
  color: var(--neon-cyan);
  margin: 14px 0 8px 0;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 4px;
}

.markdown-preview h3, .markdown-body h3 {
  color: var(--neon-purple);
  margin: 12px 0 6px 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.markdown-preview h4, .markdown-preview h5, .markdown-preview h6,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: #38bdf8;
  margin: 10px 0 4px 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.markdown-preview p, .markdown-body p {
  margin: 6px 0 10px 0;
}

.markdown-preview strong, .markdown-preview b,
.markdown-body strong, .markdown-body b {
  color: #f8fafc;
  font-weight: 600;
}

.markdown-preview em, .markdown-preview i,
.markdown-body em, .markdown-body i {
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-preview ul, .markdown-preview ol,
.markdown-body ul, .markdown-body ol {
  margin: 6px 0 12px 22px;
  padding: 0;
}

.markdown-preview li, .markdown-body li {
  margin-bottom: 4px;
}

.markdown-preview code, .markdown-body code {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--neon-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.markdown-preview pre, .markdown-body pre {
  margin: 12px 0;
  background: rgba(2, 4, 8, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}

.markdown-preview pre code, .markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.82rem;
  display: block;
}

.markdown-preview blockquote, .markdown-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--neon-purple);
  background: rgba(168, 85, 247, 0.06);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  font-style: normal;
}

.markdown-preview hr, .markdown-body hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 16px 0;
}

.markdown-preview table, .markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.82rem;
}

.markdown-preview th, .markdown-body th {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  text-align: left;
  color: var(--neon-cyan);
  font-weight: 600;
}

.markdown-preview td, .markdown-body td {
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
}

.markdown-preview tr:nth-child(even), .markdown-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.markdown-preview a, .markdown-body a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.markdown-preview a:hover, .markdown-body a:hover {
  text-decoration: underline;
}

.council-opinion-card {
  background: rgba(10, 15, 28, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
}

/* Reusable .empty-state Component with Glowing SVG Icon */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: rgba(10, 15, 28, 0.5);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  margin: 12px 0;
  width: 100%;
}

.empty-state svg, .empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  stroke: var(--neon-cyan);
  fill: none;
  stroke-width: 1.75;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.6));
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.45;
  margin-bottom: 16px;
}

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 18px rgba(6, 182, 212, 0.8)); transform: scale(1.03); }
}



