/* ==========================================================================
   ANTS Premium Dark Theme Design Tokens
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg-dark: #0B0F19;
  --card-bg: rgba(17, 24, 39, 0.75);
  --border-glow: rgba(16, 185, 129, 0.15);
  --border-soft: rgba(255, 255, 255, 0.08);
  
  /* Text */
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  /* HSL Tailored Colors */
  --accent: #10B981;        /* Neon Green */
  --accent-strong: #059669;
  --cyan: #06B6D4;          /* Cyan Glow */
  --indigo: #6366F1;        /* Indigo */
  
  /* Status */
  --ok: #10B981;
  --ok-bg: rgba(16, 185, 129, 0.1);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  
  /* Console */
  --console-bg: #030712;
  --console-text: #34D399;  /* Emerald Monospace */
}

/* ==========================================================================
   Base Elements & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand-mark {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   Topbar Header
   ========================================================================== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

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

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #030712;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  letter-spacing: -0.05em;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
}

h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

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

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #030712;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-soft);
  color: var(--text-primary);
}
.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn.compact-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn.icon-btn {
  font-size: 1rem;
  padding: 6px 10px;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  padding: 10px 14px;
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.navigation-tabs {
  display: flex;
  gap: 8px;
  background: rgba(3, 7, 18, 0.4);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  overflow-x: auto;
}

.nav-tab {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.nav-tab.active {
  color: #030712;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}
.nav-tab.hidden {
  display: none !important;
}

/* ==========================================================================
   Tab Panels
   ========================================================================== */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   Glass Panels
   ========================================================================== */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head.border-bottom {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
h2 {
  font-size: 1.1rem;
  font-weight: 600;
}
h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack.compact {
  gap: 8px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
label span {
  display: inline-block;
}
.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  cursor: pointer;
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ==========================================================================
   Workspace View (User Default)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 20px;
}

.flex-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

/* Flex UI */
.flex-ui-grid {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 20px;
}

.branch-summary,
.muted-card,
.flex-detail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px;
}

.branch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.branch-summary p,
.flex-muted {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.branch-targets,
.nocodb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.flex-checkbox {
  align-self: end;
  min-height: 42px;
}

.flex-columns {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  min-height: 420px;
}

.flex-list,
.flex-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 520px;
  overflow: auto;
}

.flex-task-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

.flex-task-item:hover {
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.flex-task-item small {
  display: block;
  color: var(--text-muted);
  margin-top: 2px;
}

.flex-detail-card {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.flex-detail-card h4 {
  margin-top: 12px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.flex-lifecycle-card {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.flex-lifecycle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.flex-lifecycle-head h4 {
  margin: 0;
}

.flex-lifecycle-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.flex-lifecycle-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 0.55;
}

.flex-lifecycle-step.active {
  opacity: 1;
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.08);
}

.flex-lifecycle-step.completed {
  opacity: 0.9;
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.06);
}

.flex-lifecycle-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.flex-lifecycle-step.active .flex-lifecycle-dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.flex-lifecycle-step.completed .flex-lifecycle-dot {
  background: var(--ok);
}

.flex-lifecycle-label {
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-secondary);
}

.flex-lifecycle-summary {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.flex-detail-card ul {
  padding-left: 18px;
}

.flex-approval-box {
  width: 100%;
  align-self: stretch;
  margin-top: 12px;
}

/* Preflight & Routing Status Badge */
.routing-badge {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.routing-badge-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.routing-badge-main strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
}
.badge-accent {
  color: var(--cyan);
  font-weight: 700;
}
.routing-badge-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Chat Terminal */
.chat-conversation {
  flex: 1;
  background-color: var(--console-bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 85%;
  font-size: 0.9rem;
}
.message-bubble.user {
  background: rgba(255, 255, 255, 0.05);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.message-bubble.assistant {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.message-bubble pre {
  margin-top: 8px;
  overflow: auto;
}

.system-message {
  align-self: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 99px;
  border: 1px solid var(--border-soft);
}

/* Harness Validation Card */
.harness-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.20);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.harness-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.harness-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.harness-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Admin Dashboard & Visuals
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metric-card span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric-card strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
}
.metric-card strong.cost-stat {
  color: var(--cyan);
}

.dashboard-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.chart-container {
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}
.bar-label {
  width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.bar-track {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 99px;
}
.bar-value {
  width: 70px;
  text-align: right;
  font-weight: 600;
  color: var(--cyan);
}

/* ==========================================================================
   Spec Builder View
   ========================================================================== */
.specs-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr;
  gap: 20px;
}

.specs-list {
  max-height: 520px;
  overflow-y: auto;
}
.spec-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.spec-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

/* ==========================================================================
   Operator Panel & Tables
   ========================================================================== */
.operator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.compact-panel {
  gap: 10px;
}
.health-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border-soft);
}
th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  background: rgba(3, 7, 18, 0.2);
}
tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.output-console {
  background: var(--console-bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  max-height: 220px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--console-text);
  line-height: 1.4;
}

/* ==========================================================================
   Pills and Badges
   ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.pill.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.pill.highlight {
  background: rgba(99, 102, 241, 0.1);
  color: var(--indigo);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Audit Logs & Analysis
   ========================================================================== */
.audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr;
  gap: 20px;
}
.catalog-info {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.text-link {
  color: var(--cyan);
  font-weight: 600;
}
.analysis-results {
  font-size: 0.85rem;
}
.top-gap {
  margin-top: 12px;
}

/* ==========================================================================
   Modal Overlays & Drawers
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s ease;
}
.modal-overlay.hidden, .hidden {
  display: none !important;
}
.modal-card {
  width: 480px;
  background: #111827;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.modal-card h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
}
.modal-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.settings-drawer {
  background: #111827;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: block;
}
.settings-drawer.collapsed {
  display: none;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-actions {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   Helpers & Utility
   ========================================================================== */
.empty-state {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.01);
}

.code-block {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1080px) {
  .workspace-grid,
  .flex-ui-grid,
  .flex-columns,
  .operator-grid,
  .audit-grid,
  .dashboard-visuals,
  .specs-wrapper {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .topbar-controls {
    align-self: stretch;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Google Sign-In & User Profile Styles
   ========================================================================== */
.user-profile-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--cyan);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Auth Modal Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.auth-card {
  width: 400px;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ==========================================================================
   File Upload Area Styles
   ========================================================================== */
.file-upload-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.file-dropzone {
  border: 2px dashed var(--border-soft);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(3, 7, 18, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.03);
}

.upload-icon {
  font-size: 1.5rem;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.browse-link {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: underline;
}

.upload-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hidden-input {
  display: none !important;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-list.hidden {
  display: none !important;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 0.8rem;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-name {
  color: var(--text-primary);
  font-weight: 500;
}

.file-item-size {
  color: var(--text-muted);
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  line-height: 1;
}

.btn-remove:hover {
  color: #EF4444;
  transform: scale(1.1);
}

/* ==========================================================================
   ANTS Interactive Multi-Agent Workspace Styles
   ========================================================================== */
.agent-roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.agent-card:hover {
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}
.agent-card.active {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.05);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.agent-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.agent-card.active .agent-avatar-mini {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
}

.agent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.agent-header strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.agent-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.agent-status {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.agent-status:empty {
  display: none;
}
.agent-status.idle {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-secondary);
}
.agent-status.thinking {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.2);
  animation: pulse 1.5s infinite;
}
.agent-status.active-task {
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Pipeline Stepper */
.pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(3, 7, 18, 0.4);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  margin-bottom: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: all 0.3s ease;
}
.step.active {
  opacity: 1;
}
.step.completed {
  opacity: 0.85;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.step.active .step-num {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #030712;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}
.step.completed .step-num {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
}

.step-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.step.active .step-lbl {
  color: var(--cyan);
}
.step.completed .step-lbl {
  color: var(--text-secondary);
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
  margin: 0 8px;
  margin-bottom: 12px; /* Align with circles */
}
.step-line.completed {
  background: var(--ok);
}

/* Chat Bubbles custom agent colors */
.agent-bubble-header {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.agent-bubble-header .agent-avatar-mini {
  width: 14px;
  height: 14px;
  font-size: 0.65rem;
  border: none;
  background: transparent;
}
.bubble-kimi {
  border-left: 3px solid var(--indigo) !important;
}
.bubble-deepseek {
  border-left: 3px solid var(--warn) !important;
}
.bubble-qwen {
  border-left: 3px solid var(--cyan) !important;
}
.bubble-gpt {
  border-left: 3px solid var(--ok) !important;
}

/* Decision Gates in Chat */
.decision-gate {
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed var(--indigo);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: center;
  width: 90%;
  margin: 10px 0;
}
.decision-gate-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.decision-gate-actions {
  display: flex;
  gap: 10px;
}
.decision-gate-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* ==========================================================================
   Proposals MP Tab
   ========================================================================== */
.proposals-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1024px) {
  .proposals-grid { grid-template-columns: 1fr; }
}

.advanced-options {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 14px;
}
.advanced-options summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* RAG match list */
.rag-match-list { gap: 10px; }
.rag-match-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
}
.rag-match-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.rag-match-rank {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 22px;
}
.rag-match-title {
  font-size: 0.82rem;
  flex: 1;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rag-match-score { font-size: 0.72rem; }
.rag-match-content {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

/* Proposal output */
.proposal-output {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 300px;
}
.proposal-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.proposal-body h2 {
  font-size: 1rem;
  color: var(--accent);
  margin: 18px 0 6px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 4px;
}
.proposal-body h3 {
  font-size: 0.9rem;
  color: var(--cyan);
  margin: 14px 0 4px;
}
.proposal-body h4 {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 10px 0 4px;
}
.proposal-body p { margin: 8px 0; }
.proposal-body ul {
  padding-left: 18px;
  margin: 6px 0;
}
.proposal-body li { margin: 3px 0; }
.proposal-body hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 16px 0;
}
.proposal-body strong { color: var(--text-primary); }

/* Spinner */
.proposal-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.proposal-spinner.hidden { display: none; }
.spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
