/* USDA Rural OS - White Liquid-Glass & 3D Operating Workspace Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* White Liquid-Glass Theme Tokens */
  --bg-workspace: #f8fafc;
  --bg-gradient: radial-gradient(circle at 15% 10%, rgba(241, 245, 249, 0.9) 0%, transparent 45%),
                 radial-gradient(circle at 85% 20%, rgba(226, 232, 240, 0.7) 0%, transparent 50%),
                 radial-gradient(circle at 50% 90%, rgba(248, 250, 252, 0.8) 0%, transparent 60%),
                 linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);

  --glass-surface: rgba(255, 255, 255, 0.78);
  --glass-surface-hover: rgba(255, 255, 255, 0.92);
  --glass-surface-solid: #ffffff;
  
  --glass-border: rgba(226, 232, 240, 0.85);
  --glass-border-silver: rgba(203, 213, 225, 0.7);
  --glass-border-active: rgba(16, 185, 129, 0.5);
  
  --glass-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.06), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  --glass-shadow-hover: 0 20px 45px -12px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  --glass-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  
  /* Text & Contrast Tokens (Solid High-Contrast Readability) */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Restrained Accents */
  --emerald: #059669;
  --emerald-light: #10b981;
  --emerald-dim: rgba(5, 150, 105, 0.12);
  --emerald-border: rgba(5, 150, 105, 0.3);

  --blue: #0284c7;
  --blue-dim: rgba(2, 132, 199, 0.12);
  --blue-border: rgba(2, 132, 199, 0.3);

  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.12);
  --purple-border: rgba(124, 58, 237, 0.3);

  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.12);
  --amber-border: rgba(217, 119, 6, 0.3);

  --rose: #e11d48;
  --rose-dim: rgba(225, 29, 72, 0.12);
  --rose-border: rgba(225, 29, 72, 0.3);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --backdrop: blur(24px) saturate(180%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-workspace);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================
   WORKSPACE SHELL LAYOUT: SIDEBAR + MAIN PANEL
   ======================================================== */
.workspace-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Sidebar */
.workspace-sidebar {
  width: 275px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--backdrop);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.02);
}

.sidebar-brand-block {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--glass-border);
}

.brand-symbol-3d {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #f7f7f4;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  flex-shrink: 0;
}

.brand-symbol-3d:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 20px -3px rgba(163, 13, 34, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title-main {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.brand-subsite-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--emerald);
  font-family: var(--font-mono);
}

/* Sidebar Navigation Items */
.sidebar-nav-menu {
  flex: 1;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding: 0.5rem 0.6rem 0.2rem 0.6rem;
}

.nav-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  position: relative;
}

.nav-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--glass-border);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transform: translateX(2px);
}

.nav-sidebar-item.active {
  background: #ffffff;
  border-color: rgba(5, 150, 105, 0.35);
  color: #065f46;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.08), inset 0 1px 1px #ffffff;
}

.nav-sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3.5px;
  border-radius: 4px;
  background: var(--emerald);
}

.item-icon {
  font-size: 1.05rem;
}

.item-title {
  flex: 1;
}

.badge-nav-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--purple-dim);
  color: var(--purple);
}

.pill-gold {
  background: var(--amber-dim);
  color: var(--amber);
}

.pill-green {
  background: var(--emerald-dim);
  color: var(--emerald);
}

/* User & Env Footer */
.sidebar-user-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(248, 250, 252, 0.6);
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #334155, #0f172a);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.user-avatar-circle.user-avatar-gate {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 3px;
  overflow: hidden;
}

.user-meta-col {
  display: flex;
  flex-direction: column;
}

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

.user-env-tag {
  font-size: 0.7rem;
  color: var(--emerald);
  font-family: var(--font-mono);
}

/* ========================================================
   MAIN WORKSPACE PANEL & TOP FLOATING BAR
   ======================================================== */
.workspace-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Floating Bar */
.workspace-top-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--backdrop);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 1.5rem;
}

.top-bar-crumb {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.top-bar-crumb strong {
  color: var(--text-primary);
}

.global-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 440px;
}

.search-symbol {
  position: absolute;
  left: 0.85rem;
  font-size: 0.85rem;
  opacity: 0.5;
  pointer-events: none;
}

.global-search-wrapper input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.55rem 2.8rem 0.55rem 2.3rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.global-search-wrapper input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.search-kbd {
  position: absolute;
  right: 0.75rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.edge-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s;
}

.edge-status-pill:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.edge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.btn-quick-pdf {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.2s ease;
}

.btn-quick-pdf:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ========================================================
   WORKSPACE BODY & 3D LIQUID GLASS PANELS
   ======================================================== */
.workspace-content-body {
  padding: 2rem;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.workspace-pane {
  display: none;
  animation: fadeInPane 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Glass Panel Card (Reusable Foundation) */
.glass-panel-card {
  background: var(--glass-surface);
  backdrop-filter: var(--backdrop);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  box-shadow: var(--glass-bevel), var(--glass-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Status Badges Glass */
.status-badge-glass {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-green { background: var(--emerald-dim); color: var(--emerald); border: 1px solid var(--emerald-border); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple-border); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-border); }

/* ========================================================
   HOME OVERVIEW VIEW STYLES
   ======================================================== */
.home-view-layout {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.glass-hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.85));
  backdrop-filter: var(--backdrop);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--glass-bevel), var(--glass-shadow);
}

.hero-status-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-tag-glass {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-body-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.hero-title-glass {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero-subtext-glass {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 780px;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.hero-actions-flex {
  display: flex;
  gap: 0.75rem;
  white-space: nowrap;
}

.btn-glass-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
}

.btn-glass-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-glass-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.btn-glass-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Obvious Next Action Strip */
.next-action-strip {
  background: rgba(236, 253, 245, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.next-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--emerald);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.next-action-text {
  flex: 1;
}

.next-action-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #065f46;
  letter-spacing: 0.04em;
  display: block;
}

.next-action-desc {
  font-size: 0.84rem;
  color: #047857;
  font-weight: 500;
}

.btn-action-jump {
  background: #065f46;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-jump:hover {
  background: #047857;
  transform: translateX(2px);
}

/* 4 Layered 3D Liquid-Glass KPI Cards */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  perspective: 1200px;
}

.kpi-card-3d {
  background: var(--glass-surface);
  backdrop-filter: var(--backdrop);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--glass-bevel), var(--glass-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card-3d:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-bevel), var(--glass-shadow-hover);
  background: var(--glass-surface-hover);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.kpi-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.pill-emerald { background: var(--emerald-dim); color: var(--emerald); }
.pill-blue    { background: var(--blue-dim); color: var(--blue); }
.pill-purple  { background: var(--purple-dim); color: var(--purple); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0.2rem 0;
}

.kpi-value small {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.kpi-footer-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.65rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  padding-top: 0.5rem;
}

/* Home Bottom Split */
.home-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pipeline-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pipeline-step-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
}

.step-completed .step-icon-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--emerald-dim);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.step-active {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.step-active .step-icon-active {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.step-pending .step-icon-pending {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.step-content {
  flex: 1;
}

.step-content h5 { font-size: 0.84rem; font-weight: 700; color: var(--text-primary); }
.step-content p { font-size: 0.75rem; color: var(--text-muted); }
.step-date { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

.quick-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.quick-tool-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.quick-tool-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.tool-icon { font-size: 1.6rem; }
.tool-meta h4 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.tool-meta p { font-size: 0.74rem; color: var(--text-muted); line-height: 1.35; }

/* ========================================================
   AI WORKSPACE VIEW STYLES
   ======================================================== */
.ai-workspace-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ai-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.engine-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  animation: pulseMarker 1.8s infinite;
}

.goal-input-box {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.goal-textarea {
  width: 100%;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}

.goal-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.preset-goals-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-lbl { font-size: 0.72rem; color: var(--text-dim); font-weight: 700; }

.preset-goal-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-goal-chip:hover {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
}

.btn-execute-goal {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
}

.btn-execute-goal:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* AI Execution Grid */
.ai-execution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.workflow-state-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
}

.state-running { background: var(--blue-dim); color: var(--blue); }
.state-awaiting { background: var(--amber-dim); color: var(--amber); }
.state-completed { background: var(--emerald-dim); color: var(--emerald); }

.workflow-stages-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.stage-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
}

.stage-done { border-color: rgba(5, 150, 105, 0.3); background: rgba(236, 253, 245, 0.6); }
.stage-done .stage-bullet { background: var(--emerald); color: #ffffff; }

.stage-active { border-color: var(--purple); background: #ffffff; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1); }
.stage-active .stage-bullet { background: var(--purple); color: #ffffff; }

.stage-waiting .stage-bullet { background: #e2e8f0; color: var(--text-dim); }

.stage-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.stage-text { flex: 1; }
.stage-text h5 { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.stage-text p { font-size: 0.72rem; color: var(--text-muted); }
.stage-status-indicator { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }

/* Approval Gate Modal in Pipeline */
.approval-gate-container {
  margin-bottom: 1.25rem;
  animation: slideDown 0.3s ease;
}

.gate-modal-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
}

.gate-modal-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.gate-lock-icon { font-size: 1.5rem; }
.gate-modal-header h4 { font-size: 0.95rem; font-weight: 800; color: #78350f; }
.gate-modal-header p { font-size: 0.78rem; color: #92400e; }

.gate-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
}

.gate-actions-flex {
  display: flex;
  gap: 0.75rem;
}

.btn-gate-approve {
  background: #059669;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-gate-reject {
  background: #ffffff;
  color: #78350f;
  border: 1px solid #d97706;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Audit Log Stream */
.audit-log-stream {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.stream-header {
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

.stream-body {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stream-entry { line-height: 1.4; }
.entry-time { color: #64748b; }
.entry-info { color: #94a3b8; }
.entry-success { color: #34d399; }
.entry-warn { color: #fbbf24; }

/* Right: Artifact Delivery Panel */
.artifact-display-container {
  min-height: 480px;
}

.artifact-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.placeholder-icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.5; }
.artifact-placeholder h4 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; }
.artifact-placeholder p { font-size: 0.82rem; max-width: 360px; }

.artifact-card-finished {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.art-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
}

.art-doc-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  background: var(--emerald-dim);
  color: var(--emerald);
  border-radius: var(--radius-full);
}

.art-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin: 0.25rem 0; }
.art-meta { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.btn-art-download {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.art-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.a-lbl { font-size: 0.7rem; color: var(--text-dim); display: block; }
.a-val { font-size: 0.95rem; font-weight: 800; display: block; margin-top: 0.15rem; }

.art-breakdown-box {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(248, 250, 252, 0.8);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.art-breakdown-box h5 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.3rem; }

.art-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-view-preview {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.art-security-note { font-size: 0.75rem; color: var(--text-dim); }

/* ========================================================
   DOCUMENTS & REAL PDF ENGINE STYLES
   ======================================================== */
.documents-view-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.doc-toolbar-glass {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.doc-status-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.doc-version-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.doc-id-pill {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.doc-toolbar-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-download-pdf-real {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
}

.btn-download-pdf-real:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-print-doc {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-content-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

/* High-Contrast Document Sheet Preview */
.doc-preview-wrapper {
  background: #cbd5e1;
  padding: 2rem;
  border-radius: var(--radius-xl);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

.doc-paper-sheet {
  background: #ffffff;
  color: #0f172a;
  border-radius: 4px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 850px;
  margin: 0 auto;
}

.doc-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
}

.sheet-fed-seal {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: #064e3b;
  display: block;
}

.sheet-subhead {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
}

.sheet-meta-block {
  text-align: right;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
}

.sheet-id-txt { font-weight: 800; font-family: var(--font-mono); }
.sheet-date-txt, .sheet-ver-txt { color: #64748b; }

.sheet-title-block {
  margin-bottom: 1.75rem;
  text-align: center;
}

.sheet-title-block h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #064e3b;
  line-height: 1.25;
}

.sheet-title-block p {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 0.2rem;
}

.sheet-section {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1.15rem;
}

.sheet-sec-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
}

.sheet-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.sheet-row {
  display: flex;
  justify-content: space-between;
  background: #f8fafc;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
}

.sheet-row span { color: #64748b; }

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.sheet-table th {
  background: #f1f5f9;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #cbd5e1;
  color: #475569;
}

.sheet-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.sheet-table-highlight {
  background: #ecfdf5;
  font-weight: 700;
}

.sheet-table-total {
  background: #ecfdf5;
  font-weight: 900;
  font-size: 0.85rem;
}

.sheet-stat-triplet {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.sheet-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.65rem;
  text-align: center;
}

.stat-l { font-size: 0.7rem; color: #64748b; display: block; }
.stat-v { font-size: 1.1rem; font-weight: 800; color: #0f172a; display: block; margin-top: 0.15rem; }

.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.sig-box p {
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.35;
  margin-bottom: 1.25rem;
}

.sig-rule-line {
  border-bottom: 1px solid #0f172a;
  height: 25px;
}

.sig-box span { font-size: 0.7rem; color: #64748b; font-weight: 600; display: block; margin-top: 0.25rem; }

.sheet-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.5rem;
}

/* Document Sidebar */
.btn-download-pdf-sidebar {
  width: 100%;
  margin-top: 1rem;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.meta-data-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.35rem;
}

.meta-k { color: var(--text-dim); }
.meta-v { color: var(--text-primary); font-weight: 600; }

.version-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.version-item {
  display: flex;
  gap: 0.65rem;
}

.ver-badge {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  height: fit-content;
}

.version-current .ver-badge {
  background: var(--emerald-dim);
  color: var(--emerald);
}

.ver-text h5 { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.ver-text p { font-size: 0.72rem; color: var(--text-muted); }
.ver-text small { font-size: 0.68rem; color: var(--text-dim); }

/* ========================================================
   ACTIVITY & APPROVALS VIEW STYLES
   ======================================================== */
.activity-view-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.activity-grid-split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

.activity-stream-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-event {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--glass-border);
}

.event-marker {
  font-size: 1.25rem;
}

.event-content { flex: 1; }
.event-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.2rem; }
.event-header-row h5 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.event-timestamp { font-size: 0.7rem; color: var(--text-dim); }
.event-content p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 0.4rem; }
.event-tag { font-size: 0.68rem; font-weight: 700; color: var(--blue); background: var(--blue-dim); padding: 0.15rem 0.45rem; border-radius: var(--radius-sm); }

.gates-checklist-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gate-status-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--glass-border);
}

.gate-cleared .gate-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--emerald-dim);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.gate-text { flex: 1; }
.gate-text strong { font-size: 0.78rem; color: var(--text-primary); display: block; }
.gate-text small { font-size: 0.7rem; color: var(--text-muted); display: block; }
.gate-badge { font-size: 0.68rem; font-weight: 800; color: var(--emerald); }

.control-rules-list {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

/* ========================================================
   SETTINGS & 3FS DEPLOYMENT VIEW STYLES
   ======================================================== */
.settings-view-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.endpoint-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.endpoint-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--glass-border);
}

.card-primary-edge {
  border-color: rgba(5, 150, 105, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(236, 253, 245, 0.6));
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.08);
}

.endpoint-icon { font-size: 1.5rem; }
.endpoint-meta { flex: 1; }
.endpoint-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.2rem; }
.endpoint-label { font-size: 0.7rem; font-weight: 800; color: var(--text-dim); }
.endpoint-status-active { font-size: 0.7rem; font-weight: 800; color: var(--emerald); }
.endpoint-url { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700; color: var(--blue); text-decoration: none; display: block; margin-bottom: 0.2rem; }
.endpoint-desc { font-size: 0.74rem; color: var(--text-muted); }

.deployment-specs-table {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  margin-bottom: 1.25rem;
}

.spec-row { display: flex; justify-content: space-between; }
.spec-row span { color: var(--text-dim); }

.btn-deploy-now {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.pref-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.system-build-info {
  margin-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ========================================================
   COMMON FORM & UTILITY STYLES
   ======================================================== */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.form-select, .form-input {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}
.form-select:focus, .form-input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.font-emerald { color: var(--emerald) !important; }
.font-blue { color: var(--blue) !important; }
.font-purple { color: var(--purple) !important; }
.font-amber { color: var(--amber) !important; }
.font-bold { font-weight: 700 !important; }
.font-mono { font-family: var(--font-mono) !important; }

/* ========================================================
   CALCULATOR SUITE & FINANCIAL ENGINEERING HUB
   ======================================================== */
.calc-suite-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calc-selector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.calc-chip-btn {
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.calc-chip-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--emerald);
  color: var(--emerald);
  transform: translateY(-1px);
}

.calc-chip-btn.active {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}

.calc-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.calc-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.results-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.res-stat-card {
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.res-stat-card:hover {
  background: #ffffff;
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.res-stat-card span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.res-stat-card strong {
  font-size: 1.18rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.res-stat-card small {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.res-footnote {
  margin-top: 1rem;
  padding: 0.85rem 1.15rem;
  background: rgba(241, 245, 249, 0.65);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--emerald);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================================
   SYSTEM TEST SUITE & INTERACTIVE HARNESS
   ======================================================== */
.test-runner-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.btn-run-tests-top {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-run-tests-top:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

.test-kpi-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.t-kpi {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.t-lbl {
  color: var(--text-muted);
  font-weight: 600;
}

.t-val {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.test-grid-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
}

.test-suites-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.test-suite-card {
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.test-suite-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

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

.suite-title-group h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.suite-title-group p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.suite-tests-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.test-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: all 0.15s ease;
}

.test-item-row.pass,
.test-item-row.test-passed {
  border-left: 3px solid var(--emerald);
  background: rgba(240, 253, 244, 0.5);
}

.test-item-row.fail,
.test-item-row.test-failed {
  border-left: 3px solid var(--rose);
  background: rgba(254, 242, 242, 0.5);
}

.test-status-sym {
  font-weight: 800;
  margin-right: 0.5rem;
  color: var(--emerald);
}
.test-failed .test-status-sym {
  color: var(--rose);
}

.test-text-col {
  flex: 1;
}

.test-desc {
  font-weight: 600;
  color: var(--text-secondary);
}

.test-latency {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-left: 0.75rem;
}

.suite-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.suite-header-bar h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.suite-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(226, 232, 240, 0.8);
  color: var(--text-secondary);
}

.test-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.test-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.test-badge.pass {
  background: rgba(5, 150, 105, 0.1);
  color: var(--emerald);
}

.test-badge.fail {
  background: rgba(225, 29, 72, 0.1);
  color: var(--rose);
}

.test-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

.assertion-console-box {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 1rem;
  height: 520px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}

.console-line {
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.line-pass {
  color: #a7f3d0;
}

.line-fail {
  color: #fca5a5;
}

.c-bullet {
  font-weight: 800;
}

.stream-badge-mono {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
}

/* ========================================================
   CONNECTED BUILDING-PROJECT PLATFORM STYLES
   ======================================================== */
.project-scope-toggle-group {
  display: flex;
  align-items: center;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.4rem;
}

.scope-toggle-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.scope-toggle-btn:hover {
  color: var(--emerald);
}

.scope-toggle-btn.active {
  background: #ffffff;
  color: var(--emerald);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.party-item-card {
  transition: all 0.2s ease;
}

.party-item-card:hover {
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.blocker-item {
  transition: all 0.2s ease;
}

.blocker-item:hover {
  transform: translateY(-1px);
}

.btn-blocker-action {
  transition: all 0.2s ease;
}

.btn-blocker-action:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.change-propagation-banner {
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.06);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.sheet-table th {
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.sheet-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  color: var(--text-primary);
}

.sheet-table tr:hover td {
  background: rgba(248, 250, 252, 0.8);
}

.row-highlight td {
  background: rgba(236, 253, 245, 0.7) !important;
  font-weight: 700;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .workspace-sidebar { display: none; }
  .kpi-cards-grid { grid-template-columns: 1fr 1fr; }
  .home-bottom-grid, .ai-execution-grid, .doc-content-split, .activity-grid-split, .settings-grid-split, .test-grid-split {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   USDA GUIDED AI NAVIGATOR & COPILOT DRAWER STYLES
   ======================================================== */

.ai-guide-fab-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(5, 150, 105, 0.4);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px -4px rgba(5, 150, 105, 0.25), 0 4px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #065f46;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
}

.ai-guide-fab-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: #ffffff;
  border-color: var(--emerald);
  box-shadow: 0 14px 30px -4px rgba(5, 150, 105, 0.35);
}

.ai-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

.ai-fab-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

/* Header AI Assistant Button */
.btn-ai-assistant {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: #065f46;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-ai-assistant:hover {
  background: rgba(5, 150, 105, 0.15);
  border-color: var(--emerald);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
  transform: translateY(-1px);
}

.btn-ai-assistant kbd {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* Backdrop */
.ai-guide-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.ai-guide-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-Over Drawer */
.ai-guide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 95vw;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.ai-guide-drawer.open {
  transform: translateX(0);
}

.ai-drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.85);
}

.ai-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ai-badge-crest {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ai-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
}

.ai-version-pill {
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.ai-drawer-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.ai-btn-close {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-btn-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

/* Tabs Bar */
.ai-guide-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(248, 250, 252, 0.7);
  padding: 0.35rem 1rem 0;
  gap: 0.5rem;
}

.ai-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-tab-btn:hover {
  color: var(--text-primary);
}

.ai-tab-btn.active {
  color: #065f46;
  border-bottom-color: var(--emerald);
  background: rgba(255, 255, 255, 0.8);
}

.ai-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

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

/* Walkthroughs Tab */
.ai-tour-hero {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.8) 0%, rgba(240, 253, 250, 0.9) 100%);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.ai-tour-hero h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #064e3b;
  margin: 0.35rem 0 0.25rem;
}

.ai-tour-hero p {
  font-size: 0.78rem;
  color: #047857;
  margin: 0;
  line-height: 1.45;
}

.ai-tours-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-tour-card {
  display: flex;
  gap: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
}

.ai-tour-card:hover {
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.06);
  transform: translateY(-1px);
}

.ai-tour-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-tour-info {
  flex: 1;
}

.ai-tour-info h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.ai-tour-info p {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0 0 0.65rem;
}

.ai-tour-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-step-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-start-tour {
  background: #0f172a;
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-start-tour:hover {
  background: var(--emerald);
  transform: translateX(2px);
}

/* Active Step Card */
.ai-active-step-container {
  margin-top: 1rem;
}

.ai-active-step-card {
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(5, 150, 105, 0.1);
  animation: slide-up 0.25s ease;
}

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

.ai-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.ai-step-close-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.ai-step-body {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.55;
  margin: 0 0 1rem;
}

.ai-step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.85rem;
}

.btn-jump-to-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(5, 150, 105, 0.1);
  color: #065f46;
  border: 1px solid rgba(5, 150, 105, 0.3);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-jump-to-tool:hover {
  background: var(--emerald);
  color: #ffffff;
}

.btn-tour-nav {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tour-nav.primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-tour-nav.primary:hover {
  background: var(--emerald);
}

/* Chat Assistant Tab */
.ai-chat-header-bar {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
}

.ai-quick-chips-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.85rem;
}

.ai-chip-prompt {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  color: #334155;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chip-prompt:hover {
  background: #f8fafc;
  border-color: var(--emerald);
  color: var(--emerald);
}

.ai-messages-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.25rem;
  margin-bottom: 1rem;
}

.ai-msg {
  display: flex;
  gap: 0.65rem;
  max-width: 90%;
}

.ai-msg-system {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(5, 150, 105, 0.12);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-msg-body {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ai-msg-user .ai-msg-body {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.ai-msg-user .ai-msg-body p {
  color: #ffffff;
  margin: 0;
}

.ai-guidance-points {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.ai-guide-point {
  font-size: 0.78rem;
  color: #1e293b;
  line-height: 1.45;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 2px solid var(--emerald);
}

.ai-msg-actions-row {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.ai-loading-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.ai-loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--emerald);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.ai-chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--glass-border);
}

.ai-chat-input-bar input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input-bar input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.ai-chat-send-btn {
  background: var(--emerald);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-send-btn:hover {
  background: #047857;
  transform: scale(1.05);
}

/* Regulatory Cheatsheet Tab */
.ai-cheat-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.ai-cheat-card .cheat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.ai-cheat-card p {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

/* ========================================================
   PROJECT INTAKE MODAL & LIVE EDITOR
   ======================================================== */

.intake-modal-backdrop,
.runner-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.intake-modal-backdrop.open,
.runner-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.intake-modal-window,
.runner-modal-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.97);
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
  z-index: 1060;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.intake-modal-window.open,
.runner-modal-window.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.intake-modal-header,
.runner-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.9);
}

.intake-icon-crest,
.runner-badge-crest {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.intake-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: #f8fafc;
  padding: 0 1rem;
  overflow-x: auto;
}

.intake-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.intake-tab-btn:hover {
  color: var(--text-primary);
}

.intake-tab-btn.active {
  color: #065f46;
  border-bottom-color: var(--emerald);
  background: #ffffff;
}

.intake-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.intake-pane {
  display: none;
}

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

.intake-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.intake-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.intake-divider {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--glass-border);
}

.intake-modal-footer,
.runner-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================================
   AUTONOMOUS AI PROJECT RUNNER STYLES
   ======================================================== */

.runner-status-strip {
  padding: 1rem 1.5rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--glass-border);
}

.runner-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.runner-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.runner-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.runner-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald);
}

.runner-stages-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.runner-stage-card {
  display: flex;
  gap: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  transition: all 0.25s ease;
}

.runner-stage-card.active-processing {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  background: #f0fdf4;
}

.runner-stage-card.stage-finished {
  border-color: rgba(5, 150, 105, 0.35);
  background: #ffffff;
}

.stage-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.runner-stage-card.active-processing .stage-num-badge {
  background: var(--emerald);
  color: #ffffff;
}

.runner-stage-card.stage-finished .stage-num-badge {
  background: #064e3b;
  color: #ffffff;
}

.stage-card-info {
  flex: 1;
}

.stage-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.stage-title-row h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.stage-state-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.stage-state-pill.in-progress {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.stage-state-pill.completed {
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
}

.stage-card-info p {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.45;
}

.stage-telemetry-output {
  margin-top: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: #0f172a;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  border-radius: 6px;
  white-space: pre-wrap;
  animation: fadeIn 0.2s ease;
}

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

/* ========================================================
   TOAST NOTIFICATION NOTICES
   ======================================================== */

.usda-toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.usda-toast-notice.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}



