/* ─── CLAY-INSPIRED STYLE SYSTEM FOR AI-QA WORKFLOW ─── */

:root {
  /* Clay Color Palette (Warm Cream Base) */
  --canvas: #fffaf0;              /* warm cream canvas base */
  --surface: #ffffff;             /* elevated cards/panels */
  --surface2: #faf5e8;            /* pre-footer / footer / warm grouping */
  --surface-card: #f5f0e0;        /* neutral card background */
  --surface-strong: #ebe6d6;      /* stronger emphasized warm cream */
  --surface-dark: #0a1a1a;        /* teal-tinted near-black */
  --surface-dark-elevated: #1a2a2a;
  
  --border: #e5e5e5;              /* hairline */
  --border-strong: #0a0a0a;       /* primary black border */
  --text: #0a0a0a;                /* primary ink */
  --text-muted: #3a3a3a;          /* body text */
  --text-disabled: #6a6a6a;       /* muted / meta text */
  
  /* Brand accents */
  --primary: #0a0a0a;             /* Primary CTA near-black */
  --primary-hover: #1f1f1f;
  --primary-on: #ffffff;
  
  /* Clay Bold Pastel Accents */
  --brand-pink: #ff4d8b;          /* Hot Pink */
  --brand-teal: #1a3a3a;          /* Deep Teal */
  --brand-lavender: #b8a4ed;      /* Soft Lavender */
  --brand-peach: #ffb084;         /* Warm Peach */
  --brand-ochre: #e8b94a;         /* Ochre / Mustard */
  --brand-mint: #a4d4c5;          /* Mint */
  --brand-coral: #ff6b5a;         /* Coral */
  
  /* Semantic */
  --success: #22c55e;
  --success-bg-soft: #f0fdf4;
  --danger: #ef4444;
  --danger-bg-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-bg-soft: #fefbeb;
  
  /* Radii (Friendly rounded clay shape system) */
  --radius-xs: 6px;
  --radius-sm: 8px;               /* small controls */
  --radius-md: 12px;              /* buttons & text inputs */
  --radius-lg: 16px;              /* normal cards */
  --radius-xl: 24px;              /* large containers / hero */
  --radius-pill: 9999px;          /* pill badges / navigation tabs */
  
  /* Typography */
  --font-display: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  /* Shadows (Clay uses minimal soft shadows, focusing on contrast borders) */
  --shadow-1: 0px 2px 4px rgba(10, 10, 10, 0.04);
  --shadow-2: 0px 4px 8px rgba(10, 10, 10, 0.05), 0px 1px 2px rgba(10, 10, 10, 0.05);
  --shadow-3: 0px 8px 16px rgba(10, 10, 10, 0.06), 0px 2px 4px rgba(10, 10, 10, 0.04);
  --shadow-hover: 0px 12px 24px rgba(10, 10, 10, 0.08), 0px 4px 6px rgba(10, 10, 10, 0.04);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--canvas);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Headings with Display Font and Negative Spacing */
h1, h2, h3, h4, .hero h1, .page-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

/* ─── Top Sticky Navbar ─── */
.navbar {
  background-color: var(--canvas);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--brand-pink);
  border-radius: 50%;
  border: 2px solid var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover {
  color: var(--text);
  background-color: var(--surface-card);
}

.btn-refresh {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow-1);
}

.btn-refresh:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: rotate(30deg);
}

/* ─── Hero Section with Soft Clay Mesh Gradient ─── */
.hero {
  position: relative;
  text-align: center;
  padding: 4.5rem 2rem 3.5rem;
  background: radial-gradient(circle at 100% 0%, rgba(255, 77, 139, 0.08) 0%, rgba(184, 164, 237, 0.08) 35%, rgba(164, 212, 197, 0.05) 70%, transparent 100%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  letter-spacing: -0.01em;
}

.hero-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 1.5rem !important;
  font-weight: 500;
}

/* ─── Stats Row & Cards ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.04em;
}

.stat-label {
  color: var(--text-disabled);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

/* ─── Standard Cards & Colorful Modifiers ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-2);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Saturated Clay Brand Modifier Cards */
.card-pink {
  background-color: var(--brand-pink);
  color: #ffffff;
  border-color: var(--border-strong);
}
.card-pink h3, .card-pink .stat-number, .card-pink .stat-label {
  color: #ffffff !important;
}

.card-teal {
  background-color: var(--brand-teal);
  color: #ffffff;
  border-color: var(--border-strong);
}
.card-teal h3, .card-teal .stat-number, .card-teal .stat-label, .card-teal p {
  color: #ffffff !important;
}

.card-lavender {
  background-color: var(--brand-lavender);
  color: var(--text);
  border-color: var(--border-strong);
}

.card-peach {
  background-color: var(--brand-peach);
  color: var(--text);
  border-color: var(--border-strong);
}

.card-ochre {
  background-color: var(--brand-ochre);
  color: var(--text);
  border-color: var(--border-strong);
}

.card-cream {
  background-color: var(--surface-card);
  color: var(--text);
  border-color: var(--border);
}

/* ─── Pipeline Flow ─── */
.pipeline-flow {
  margin: 2.5rem 0;
  background: var(--surface-card);
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

.pipeline-flow h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.flow-steps {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  flex: 1;
  min-width: 140px;
  box-shadow: var(--shadow-1);
  transition: all 0.2s ease;
}

.flow-step.step-active {
  background-color: var(--brand-peach);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
}

.flow-step.step-active .step-name {
  color: var(--text);
}

.step-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.step-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.step-desc {
  color: var(--text-disabled);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.flow-arrow {
  color: var(--text-disabled);
  font-size: 1.5rem;
  font-weight: 500;
  user-select: none;
}

/* ─── Grid Systems ─── */
.project-grid, .row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 280px;
}

.col-30 { flex: 0 0 calc(30% - 1rem); }
.col-40 { flex: 0 0 calc(40% - 1rem); }
.col-50 { flex: 0 0 calc(50% - 1rem); }
.col-60 { flex: 0 0 calc(60% - 1rem); }
.col-70 { flex: 0 0 calc(70% - 1rem); }

/* ─── Project Cards ─── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  box-shadow: var(--shadow-1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.project-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.project-path {
  font-family: var(--font-mono);
  color: var(--text-disabled);
  font-size: 0.78rem;
  word-break: break-all;
  margin-top: 0.35rem;
}

.project-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.project-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
}

/* ─── Buttons (Thick Pill & Border Styling) ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-1);
}

.btn:hover {
  background-color: var(--surface-card);
  box-shadow: var(--shadow-2);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-on);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-on);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background-color: var(--surface);
}

.btn-danger:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

/* ─── Page Headers & Action Groups ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 2.25rem;
}

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

/* ─── Modern Input Fields ─── */
.form {
  max-width: 550px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.form-group small {
  display: block;
  color: var(--text-disabled);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.form-input, .form input[type="text"], .form select, .form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus, .form input[type="text"]:focus, .form select:focus, .form textarea:focus {
  border-color: var(--brand-pink);
  box-shadow: 0px 0px 0px 3px rgba(255, 77, 139, 0.15);
}

/* ─── Badges (Stark Rounded Badges) ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-project {
  background-color: var(--surface-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-plan {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-spec {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-draft {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-pass {
  background-color: var(--success-bg-soft);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.badge-fail {
  background-color: var(--danger-bg-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ─── Story Cards & Lists ─── */
.story-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

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

.story-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

.story-title:hover {
  color: var(--brand-pink);
}

.story-badges {
  display: flex;
  gap: 0.35rem;
}

.story-preview {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.story-preview p {
  margin: 0.25rem 0;
}

.story-actions {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.story-action-output {
  margin-left: auto;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-disabled);
}

/* ─── Execution Runs & History ─── */
.run-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.run-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: all 0.2s ease;
}

.run-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
  transform: translateX(2px);
}

.run-passed {
  border-left: 6px solid var(--success);
}

.run-failed {
  border-left: 6px solid var(--danger);
}

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

.run-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.run-test {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.run-meta {
  color: var(--text-disabled);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* ─── Autoscrolling Live Terminal Stream (Teal-tinted Near Black) ─── */
.output-box {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  max-height: 450px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  line-height: 1.6;
  border: 2px solid var(--border-strong);
  box-shadow: inset 0px 2px 8px rgba(0, 0, 0, 0.4);
}

.output-running {
  background-color: var(--surface-dark);
  color: #e5e7eb;
}

.output-success {
  background-color: #052e16; /* very dark green */
  color: #4ade80;
  border-color: #15803d;
}

.output-error {
  background-color: #450a0a; /* very dark red */
  color: #f87171;
  border-color: #b91c1c;
}

/* Neon activity pulse dot indicators */
.terminal-pulse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1.25rem;
  background-color: var(--border-strong);
  border-radius: var(--radius-pill);
  width: fit-content;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-pink); /* Neon Pink */
  box-shadow: 0 0 8px var(--brand-pink);
  animation: pulse-blink 1.4s infinite both;
}

.pulse-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.pulse-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.pulse-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-mono);
}

@keyframes pulse-blink {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Custom Scrollbar for Terminal and page */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-card);
  border-radius: var(--radius-pill);
  border: 2px solid var(--canvas);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ─── Code Snippets Block ─── */
.code-block {
  background: var(--surface-dark);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  font-size: 0.8rem;
  overflow-x: auto;
  max-height: 450px;
  font-family: var(--font-mono);
  line-height: 1.6;
  color: #e5e7eb;
}

/* ─── Info/Data Tables ─── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.info-table th {
  color: var(--text-disabled);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
}

.info-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.info-table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  width: 35%;
}

/* ─── Markdown Content Formatting ─── */
.markdown-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.markdown-content p {
  margin-bottom: 0.85rem;
}

.markdown-content code {
  font-family: var(--font-mono);
  background-color: var(--surface-card);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

/* ─── Quick Links Grid ─── */
.quick-links-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.quick-link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quick-link-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.ql-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.ql-label {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ─── Empty State Placeholder ─── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ─── Alert & Notification Components ─── */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border-strong);
}

.alert-info {
  background-color: var(--brand-peach);
  color: var(--text);
}

.alert-error {
  background-color: var(--danger-bg-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* ─── Dynamic Spinner Animation ─── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Media Query Adaptations ─── */
@media (max-width: 959px) {
  .row {
    flex-direction: column;
    gap: 1.25rem;
  }
  .col-30, .col-40, .col-50, .col-60, .col-70 {
    flex: 0 0 100%;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-links-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 1rem;
  }
  .nav-inner {
    height: 56px;
  }
  .nav-links {
    gap: 0.5rem;
  }
  .nav-links a {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
  .hero {
    padding: 3rem 1rem 2rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .quick-links-row {
    grid-template-columns: 1fr;
  }
  .flow-steps {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
}

/* ─── Extra EJS Template Alignments ─── */
.action-buttons-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.action-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.big-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.04em;
}

.fail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fail-list li {
  padding: 1rem;
  border: 1px solid var(--border-strong);
  background-color: var(--canvas);
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
}

.fail-list li strong {
  font-family: var(--font-mono);
  color: var(--danger);
}

.heal-attempt {
  padding: 0.75rem;
  border-left: 4px solid var(--success);
  background-color: var(--surface-card);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
