/* ==========================================================================
   IEC 61850 CID VALIDATOR & ENGINEERING SUITE
   Design System: Enterprise Industrial / Dark Matte Precision UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Surface & Background Palettes (Deep Obsidian Matte) */
  --bg-canvas: #090b10;
  --bg-sidebar: #0f1218;
  --bg-topbar: rgba(15, 18, 24, 0.85);
  --bg-surface: #141822;
  --bg-surface-subtle: #191f2c;
  --bg-surface-hover: #1f2636;
  --bg-surface-active: #262e42;
  --bg-input: #10141d;
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: #222938;
  --border-strong: #2f384d;
  --border-focus: #3b82f6;

  /* Typography */
  --text-primary: #f3f5f9;
  --text-secondary: #9aa4b8;
  --text-muted: #647087;
  --text-disabled: #434c5e;

  /* Refined Matte Accents (No Blinding Neon Glow) */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-primary-subtle: rgba(59, 130, 246, 0.12);

  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);

  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);

  --accent-crimson: #ef4444;
  --accent-crimson-subtle: rgba(239, 68, 68, 0.12);

  --accent-cyan: #06b6d4;
  --accent-cyan-subtle: rgba(6, 182, 212, 0.12);

  --accent-indigo: #6366f1;
  --accent-indigo-subtle: rgba(99, 102, 241, 0.12);

  /* Layout Constants */
  --sidebar-width: 270px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  /* Shadows (Crisp & Subtle) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 0 0 1px var(--border-default), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Framework */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: relative;
  z-index: 40;
}

.brand-header {
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #1e293b;
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav-container {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 10px 6px 10px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  user-select: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  color: var(--text-muted);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-item:hover svg {
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-default);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-item.active svg {
  color: var(--accent-primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-default);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & TOPBAR
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-canvas);
}

.topbar {
  height: var(--header-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-default);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 30;
  flex-shrink: 0;
}

.active-file-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-pill svg {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   BUTTONS & INPUT CONTROLS
   ========================================================================== */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  outline: none;
  white-space: nowrap;
  user-select: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: #ffffff;
}

.btn-success {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
}

.btn-success:hover {
  background: #047857;
}

.btn-subtle {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-subtle:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.input-control {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-control:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   CONTENT BODY & TABS
   ========================================================================== */
.content-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0.7; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.card-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   GRID LAYOUTS & STAT BOXES
   ========================================================================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: border-color 0.15s ease;
}

.stat-box:hover {
  border-color: var(--border-strong);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.stat-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.stat-icon-wrapper svg {
  width: 14px;
  height: 14px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-footer {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   DROPZONE / UPLOAD BANNER
   ========================================================================== */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-hover);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.dropzone-icon svg {
  width: 20px;
  height: 20px;
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
}

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

.data-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-critical {
  background: var(--accent-crimson-subtle);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-warning {
  background: var(--accent-amber-subtle);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-info {
  background: var(--accent-primary-subtle);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-success {
  background: var(--accent-emerald-subtle);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-neutral {
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* ==========================================================================
   INTERACTIVE TREE VIEW
   ========================================================================== */
.tree-node {
  padding-left: 14px;
  margin: 2px 0;
  font-size: 12.5px;
}

.tree-header {
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.tree-header:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.tree-header.selected {
  background: var(--bg-surface-active);
  color: #ffffff;
  font-weight: 600;
}

.tree-header svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==========================================================================
   CODE BLOCKS & XML VIEWER
   ========================================================================== */
pre, code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: #93c5fd;
  font-size: 11px;
}

pre {
  background: #0d1017;
  border: 1px solid var(--border-default);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #d1d5db;
}

/* ==========================================================================
   VENDOR MATRIX & ARCHITECTURE BOXES
   ========================================================================== */
.vendor-card-item {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.progress-track {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.arch-stat-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arch-stat-pill span {
  font-size: 12px;
  color: var(--text-secondary);
}

.arch-stat-pill strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--text-primary);
}

/* Form Checkbox Styling */
.custom-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.custom-checkbox-row:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-default);
}

.custom-checkbox-row input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
}

/* ==========================================================================
   GEMINI AI & INTERACTIVE COPILOT STYLES
   ========================================================================== */
.btn-ai-settings {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-ai-settings:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
}

.btn-ai-copilot {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.btn-ai-copilot:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.status-pill-mini {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.card-ai-glow {
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.05) 0%, var(--bg-surface) 60%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(14, 165, 233, 0.08);
}

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

.custom-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  transition: .3s;
  border-radius: 20px;
}

.toggle-track:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

.custom-toggle input:checked + .toggle-track {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.custom-toggle input:checked + .toggle-track:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* AI Copilot Drawer */
.copilot-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.copilot-drawer.open {
  right: 0;
}

.copilot-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-subtle);
}

.copilot-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copilot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

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

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.copilot-chips {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(0, 0, 0, 0.15);
}

.copilot-chips::-webkit-scrollbar {
  display: none;
}

.copilot-chip {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.copilot-chip:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

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

.copilot-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.copilot-msg.msg-user {
  align-self: flex-end;
}

.copilot-msg.msg-user .msg-bubble {
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
}

.copilot-msg.msg-assistant {
  align-self: flex-start;
}

.copilot-msg.msg-assistant .msg-bubble {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 14px 14px 14px 2px;
}

.msg-bubble {
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-bubble pre {
  background: #090d16;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  overflow-x: auto;
  margin: 6px 0;
  border: 1px solid var(--border-subtle);
}

.msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-size: 11.5px;
}

.copilot-input-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-surface-subtle);
  display: flex;
  gap: 8px;
}

.copilot-input-bar textarea {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 12px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.copilot-input-bar textarea:focus {
  border-color: var(--accent-cyan);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 480px;
  max-width: 92vw;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

