:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-input: #1a2236;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-dim: #64748b;
  --accent: #06b6d4;
  --accent-dim: #0e7490;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --compliance: #10b981;
  --compliance-bg: rgba(16, 185, 129, 0.1);
  --radius: 8px;
}

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

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

header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.accent { color: var(--accent); }
.subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

/* Architecture Flow */
.arch-section {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.arch-node {
  text-align: center;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-width: 120px;
}
.lt-node { border-color: var(--yellow); background: var(--yellow-bg); }
.gem2-node { border-color: var(--accent); background: rgba(6, 182, 212, 0.1); }
.compliance-node { border-color: var(--compliance); background: var(--compliance-bg); }
.node-icon { font-size: 1.5rem; }
.node-label { font-weight: 600; font-size: 0.85rem; margin-top: 0.25rem; }
.node-detail { font-size: 0.7rem; color: var(--text-dim); }
.node-speed { font-size: 0.65rem; color: var(--accent); font-weight: 600; }
.arch-arrow { font-size: 1.25rem; color: var(--text-dim); transition: all 0.4s ease; }
.arch-arrow.active {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  animation: arrowFlow 0.6s ease;
}

/* Clickable pipeline nodes */
.arch-node.clickable { cursor: pointer; transition: all 0.3s ease; position: relative; }
.arch-node.clickable:hover { transform: translateY(-2px); }
.input-node.clickable:hover { border-color: var(--accent); box-shadow: 0 0 15px rgba(6,182,212,0.3); }
.lt-node.clickable:hover:not(.node-disabled) { box-shadow: 0 0 15px rgba(234,179,8,0.4); }
.gem2-node.clickable:hover:not(.node-disabled) { box-shadow: 0 0 15px rgba(6,182,212,0.4); }
.compliance-node.clickable:hover:not(.node-disabled) { box-shadow: 0 0 15px rgba(16,185,129,0.4); }

/* Disabled pipeline nodes (no input yet) */
.arch-node.node-disabled { opacity: 0.35; cursor: not-allowed !important; pointer-events: auto; }
.arch-node.node-disabled:hover { transform: none; box-shadow: none; }

/* Input node attract-attention blink on page load */
.arch-node.attract {
  animation: attractBlink 1.8s ease-in-out infinite;
}
@keyframes attractBlink {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  50% { border-color: var(--accent); box-shadow: 0 0 18px rgba(6,182,212,0.5), 0 0 36px rgba(6,182,212,0.15); }
}

/* Pipeline glow states */
.arch-node.glow-input {
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(6,182,212,0.6), 0 0 40px rgba(6,182,212,0.2), inset 0 0 15px rgba(6,182,212,0.1);
  animation: nodeGlow 1.2s ease infinite;
}
.arch-node.glow-lt {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 20px rgba(234,179,8,0.6), 0 0 40px rgba(234,179,8,0.2), inset 0 0 15px rgba(234,179,8,0.1);
  animation: nodeGlowYellow 0.8s ease infinite;
}
.arch-node.glow-gem2 {
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(6,182,212,0.6), 0 0 40px rgba(6,182,212,0.2), inset 0 0 15px rgba(6,182,212,0.1);
  animation: nodeGlow 1.5s ease infinite;
}
.arch-node.glow-compliance {
  border-color: var(--compliance) !important;
  box-shadow: 0 0 20px rgba(16,185,129,0.6), 0 0 40px rgba(16,185,129,0.2), inset 0 0 15px rgba(16,185,129,0.1);
  animation: nodeGlowCompliance 1.5s ease infinite;
}
@keyframes nodeGlowCompliance {
  0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.6), 0 0 40px rgba(16,185,129,0.2); }
  50% { box-shadow: 0 0 30px rgba(16,185,129,0.8), 0 0 60px rgba(16,185,129,0.3); }
}
.arch-node.glow-done {
  opacity: 0.45;
  transition: opacity 0.6s ease;
}
.arch-node.glow-verdict-allow {
  border-color: var(--green) !important;
  box-shadow: 0 0 25px rgba(34,197,94,0.7), 0 0 50px rgba(34,197,94,0.25);
  animation: verdictPop 0.5s ease;
}
.arch-node.glow-verdict-deny, .arch-node.glow-verdict-block {
  border-color: var(--red) !important;
  box-shadow: 0 0 25px rgba(239,68,68,0.7), 0 0 50px rgba(239,68,68,0.25);
  animation: verdictPop 0.5s ease;
}
.arch-node.glow-verdict-review {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 25px rgba(234,179,8,0.7), 0 0 50px rgba(234,179,8,0.25);
  animation: verdictPop 0.5s ease;
}

/* Reset button */
.btn-reset {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--yellow);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-reset:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(234,179,8,0.4);
  transform: rotate(-90deg);
}
.btn-reset:active { transform: rotate(-360deg); transition: transform 0.4s; }

/* Auto button */
.arch-auto { text-align: center; margin-top: 0.75rem; }
.btn-auto {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 2rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  box-shadow: 0 2px 12px rgba(6,182,212,0.3);
}
.btn-auto:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(6,182,212,0.5); }
.btn-auto:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-auto.running { animation: autoPulse 1.5s ease infinite; }

@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(6,182,212,0.6), 0 0 40px rgba(6,182,212,0.2); }
  50% { box-shadow: 0 0 30px rgba(6,182,212,0.8), 0 0 60px rgba(6,182,212,0.3); }
}
@keyframes nodeGlowYellow {
  0%, 100% { box-shadow: 0 0 20px rgba(234,179,8,0.6), 0 0 40px rgba(234,179,8,0.2); }
  50% { box-shadow: 0 0 30px rgba(234,179,8,0.8), 0 0 60px rgba(234,179,8,0.3); }
}
@keyframes arrowFlow {
  0% { transform: translateX(-4px); opacity: 0.4; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes verdictPop {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes autoPulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(6,182,212,0.3); }
  50% { box-shadow: 0 2px 25px rgba(6,182,212,0.6); }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.tabs-left { display: flex; gap: 0; }
.tabs-right {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.5rem 0.5rem 0.5rem;
}
.tabs-right .wf-controls-label {
  font-size: 0.8rem; color: var(--text-dim);
}
.tabs-right select {
  background: var(--bg-input, #0e1320); color: var(--text);
  border: 1px solid var(--border, #2a3142); border-radius: 4px;
  padding: 0.3rem 0.5rem; font-size: 0.85rem; cursor: pointer;
}

/* WP-ST-27: Vultr LLM toggle in tab bar — judge's "steam-packed marine" switch */
.vultr-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  cursor: pointer; user-select: none;
  padding: 0.25rem 0.5rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #2a3142);
}
.vultr-toggle input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.vultr-toggle-track {
  position: relative; display: inline-block;
  width: 32px; height: 18px;
  background: #444; border-radius: 9px;
  transition: background 0.2s ease;
}
.vultr-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #ddd; border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}
.vultr-toggle input:checked + .vultr-toggle-track {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}
.vultr-toggle input:checked + .vultr-toggle-track .vultr-toggle-thumb {
  transform: translateX(14px);
  background: #fff;
}
.vultr-toggle-label {
  font-size: 0.78rem; color: var(--text-dim);
  letter-spacing: 0.3px;
}
.vultr-toggle input:checked ~ .vultr-toggle-label {
  color: var(--green, #4ade80);
}
.vultr-toggle-spark {
  font-size: 0.85rem;
  color: #fbbf24;
  display: inline-block;
  transition: opacity 0.2s ease;
  opacity: 0.4;
}
.vultr-toggle input:checked ~ .vultr-toggle-label .vultr-toggle-spark {
  opacity: 1;
  text-shadow: 0 0 6px rgba(251,191,36,0.7);
}
.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Input Area */
.input-area { margin-bottom: 1.5rem; }
.input-area label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--text-dim); }

.input-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
}

/* Buttons */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: #22d3ee; }
.btn-primary:disabled { background: var(--accent-dim); cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

/* Results */
.results-area { animation: fadeIn 0.3s ease; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 1024px) {
  .results-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .results-grid { grid-template-columns: 1fr; }
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.lt-header { background: var(--yellow-bg); }
.gem2-header { background: rgba(6, 182, 212, 0.1); }
.compliance-header { background: var(--compliance-bg); }
.layer-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}
.layer-name { font-weight: 600; font-size: 0.85rem; }
.layer-speed { margin-left: auto; font-size: 0.75rem; color: var(--text-dim); }
.layer-provider { font-size: 0.7rem; color: var(--accent); font-weight: 600; }

.card-body { padding: 1rem; }

.verdict-display {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.verdict-allow { color: var(--green); background: var(--green-bg); }
.verdict-deny, .verdict-block { color: var(--red); background: var(--red-bg); }
.verdict-review, .verdict-human_review { color: var(--yellow); background: var(--yellow-bg); }
.verdict-log { color: var(--text-dim); background: rgba(100,116,139,0.1); }
.verdict-loading {
  color: var(--text-dim);
  background: rgba(100,116,139,0.1);
  animation: pulse 1.5s infinite;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.score-row .label { color: var(--text-dim); }
.score-row .value { font-weight: 600; font-family: 'JetBrains Mono', monospace; }

.flags-area {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.flag-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 600;
}
.flag-tag.spt { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.deny-message {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--red-bg);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--red);
}

.error-message {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--yellow-bg);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--yellow);
}

.eval-items {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}
.eval-item {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.eval-pass { color: var(--green); }
.eval-warn { color: var(--yellow); }
.eval-fail { color: var(--red); }

/* Compliance results */
.compliance-regs-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.regs-violated { color: var(--red); }
.regs-ok { color: var(--green); }
.compliance-regs { margin-top: 0.25rem; }
.compliance-reg-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.75rem;
  line-height: 1.4;
}
.compliance-reg-item:last-child { border-bottom: none; }
.reg-framework {
  display: inline-block;
  background: var(--compliance-bg);
  color: var(--compliance);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.25rem;
}
.reg-article {
  color: var(--text);
  font-weight: 600;
  font-size: 0.7rem;
}
.reg-title {
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* Compliance samples dropdown */
.compliance-select {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--compliance) !important;
  color: var(--compliance) !important;
  font-weight: 600;
}
.compliance-select:hover {
  background: rgba(16, 185, 129, 0.25) !important;
}

/* Banking mode toggle */
.banking-toggle {
  color: var(--compliance) !important;
  font-weight: 600;
  white-space: nowrap;
}
.banking-toggle input[type="checkbox"] {
  accent-color: var(--compliance);
}

/* Ledger button */
.btn-ledger {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--compliance);
  border-radius: var(--radius);
  color: var(--compliance);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-ledger:hover {
  background: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Ledger modal */
.ledger-card { max-width: 700px; }
.ledger-modal-header {
  background: var(--compliance-bg);
  border-bottom-color: var(--compliance);
}
.ledger-subtitle {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.ledger-table td { font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; }
.ledger-table .ledger-active { color: var(--green); font-weight: 600; }
.ledger-table .ledger-frozen { color: var(--red); font-weight: 600; }
.ledger-table .ledger-balance { text-align: right; }
.ledger-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.btn-copy-prompt {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--compliance);
  border-radius: 4px;
  color: var(--compliance);
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-copy-prompt:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Scenario progress bar */
.progress-area { margin-bottom: 1.25rem; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.progress-count {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}
.progress-name {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 60%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim));
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  animation: progressShimmer 1.5s ease-in-out infinite;
}
@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.progress-fill.progress-done {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

/* Row flash animation for newly added scenario rows */
.data-table tr.row-flash {
  animation: rowFlash 0.8s ease;
}
@keyframes rowFlash {
  0% { background: rgba(6,182,212,0.2); }
  100% { background: transparent; }
}

/* Scenarios */
.scenarios-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.checkbox-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.status-text { font-size: 0.85rem; color: var(--accent); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}
.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.pass-cell { color: var(--green); font-weight: 700; }
.fail-cell { color: var(--red); font-weight: 700; }
.verdict-cell-allow { color: var(--green); }
.verdict-cell-deny, .verdict-cell-block { color: var(--red); }
.verdict-cell-review { color: var(--yellow); }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}
.status-pass { background: var(--green-bg); color: var(--green); }
.status-partial { background: var(--yellow-bg); color: var(--yellow); }
.status-fail { background: var(--red-bg); color: var(--red); }

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.metric-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.metric-green { color: var(--green); }
.metric-red { color: var(--red); }
.metric-accent { color: var(--accent); }

/* ── Red Team Resilience Tab ─────────────────────────────────────── */

.redteam-panel {
  max-width: 1200px;
  margin: 0 auto;
}
.rt-summary h3, .rt-timeline h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.rt-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Round timeline */
.rt-timeline { margin-top: 1.5rem; }
.rt-round-card {
  position: relative;
  margin-bottom: 0;
  padding-left: 2rem;
}
.rt-round-connector {
  position: absolute;
  left: 0.7rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.rt-round-card:last-child .rt-round-connector { display: none; }
.rt-round-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 2px;
  transition: border-color 0.15s;
  position: relative;
}
.rt-round-header:hover { border-color: var(--accent-dim); }
.rt-expanded .rt-round-header { border-color: var(--accent); }

.rt-round-badge {
  background: var(--accent-dim);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 2.5rem;
  text-align: center;
}
.rt-round-info { flex: 1; min-width: 0; }
.rt-round-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-round-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
}
.rt-round-severities {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.rt-sev {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}
.rt-sev-critical { background: rgba(220,38,38,0.2); color: #fca5a5; }
.rt-sev-high { background: var(--red-bg); color: var(--red); }
.rt-sev-medium { background: var(--yellow-bg); color: var(--yellow); }
.rt-sev-low { background: rgba(100,116,139,0.2); color: var(--text-dim); }

.rt-round-rate {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 80px;
}
.rt-rate-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.rt-rate-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}
.rt-rate-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  min-width: 2rem;
  text-align: right;
}

.rt-round-status {
  font-size: 1rem;
  width: 1.5rem;
  text-align: center;
}
.rt-status-fixed { color: var(--green); }
.rt-status-arch { color: var(--yellow); }

.rt-expand-arrow {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.rt-expanded .rt-expand-arrow { transform: rotate(180deg); }

/* Findings list */
.rt-round-findings {
  padding: 0.5rem 0 1rem 0;
}
.rt-round-findings.hidden { display: none; }

.rt-finding {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
  margin-bottom: 2px;
  transition: background 0.1s;
}
.rt-finding:hover { background: rgba(255,255,255,0.02); }
.rt-finding .rt-sev {
  min-width: 3rem;
  text-align: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.rt-finding-body { flex: 1; min-width: 0; }
.rt-finding-title {
  font-size: 0.85rem;
  font-weight: 500;
}
.rt-finding-fix {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.rt-finding-stage {
  font-size: 0.65rem;
  background: rgba(6,182,212,0.15);
  color: var(--accent);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.rt-finding-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.rt-finding-fixed { background: var(--green-bg); color: var(--green); }
.rt-finding-arch { background: var(--yellow-bg); color: var(--yellow); }

/* Scenario detail modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-section { margin-bottom: 1rem; }
.modal-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}
.modal-prompt {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
}
.modal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
@media (max-width: 600px) {
  .modal-columns { grid-template-columns: 1fr; }
}
.modal-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.modal-col-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.modal-col-body { padding: 0.75rem; }
.modal-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.modal-row:last-child { border-bottom: none; }
.modal-row .mr-label { color: var(--text-dim); }
.modal-row .mr-value { font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.modal-verdict {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.modal-flags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }

/* Clickable scenario rows */
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: rgba(6,182,212,0.06); }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Interpretation cards */
.interpret-area { margin-top: 1rem; }
.btn-interpret {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.3);
}
.btn-interpret:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5); }
.btn-interpret:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-interpret.loading { animation: interpretPulse 1.5s ease infinite; }
@keyframes interpretPulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(168, 85, 247, 0.3); }
  50% { box-shadow: 0 2px 25px rgba(168, 85, 247, 0.6); }
}

.interpret-card {
  background: var(--bg-card);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  animation: fadeIn 0.3s ease;
}
.interpret-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #a855f7;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}
.interpret-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.interpret-disclaimer {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  font-style: italic;
  opacity: 0.8;
}

/* Utility */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Mobile Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  header { padding: 1rem 0; }
  .header-content { padding: 0 1rem; }
  h1 { font-size: 1.25rem; }
  .subtitle { font-size: 0.75rem; }

  main { padding: 1rem 0.75rem 3rem; }

  /* Pipeline: vertical stack on mobile */
  .arch-flow {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
  }
  .arch-node { min-width: unset; width: 100%; padding: 0.5rem 0.75rem; }
  .arch-arrow { transform: rotate(90deg); font-size: 1rem; margin: -0.1rem 0; }
  .btn-reset {
    width: 36px; height: 36px; font-size: 1.1rem;
    align-self: flex-end; position: absolute; top: 0.5rem; right: 0.5rem;
  }
  .arch-section { position: relative; }

  /* Compact node layout: horizontal row with icon left, text right */
  .arch-node {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 0.5rem;
    text-align: left;
  }
  .node-icon { grid-row: 1 / 3; font-size: 1.2rem; }
  .node-label { font-size: 0.8rem; margin-top: 0; grid-column: 2; grid-row: 1; }
  .node-detail { font-size: 0.65rem; grid-column: 2; grid-row: 2; }
  .node-speed { font-size: 0.6rem; grid-column: 3; grid-row: 1 / 3; }

  /* Input controls stack */
  .input-controls { flex-direction: column; gap: 0.5rem; }
  .input-controls select { width: 100%; }
  textarea { font-size: 0.8rem; rows: 3; }

  /* Auto button */
  .btn-auto { width: 100%; padding: 0.6rem 1rem; font-size: 0.85rem; }

  /* Results cards */
  .verdict-display { font-size: 1.2rem; padding: 0.5rem; }

  /* Scenarios tab */
  .scenarios-controls { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .scenarios-controls .btn-primary { width: 100%; }

  /* Tables: horizontal scroll */
  .data-table { font-size: 0.7rem; }
  .data-table th, .data-table td { padding: 0.35rem 0.4rem; white-space: nowrap; }
  #scenario-results-area, #scorecard-area { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Metrics grid */
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .metric-value { font-size: 1.25rem; }
  .metric-label { font-size: 0.65rem; }
  .metric-card { padding: 0.6rem; }

  /* Modal full-screen on mobile */
  .modal-card { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; }
  .modal-overlay { align-items: flex-end; }
  .modal-columns { grid-template-columns: 1fr; }
  .modal-prompt { font-size: 0.7rem; max-height: 100px; }
  .modal-body { padding: 0.75rem; }
  .modal-title { font-size: 0.9rem; }

  /* Tabs */
  .tab { padding: 0.6rem 0.75rem; font-size: 0.75rem; }

  /* Red team responsive */
  .rt-round-header { flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0.6rem; }
  .rt-round-severities { display: none; }
  .rt-round-rate { min-width: 60px; }
  .rt-finding { flex-wrap: wrap; }
  .rt-finding-stage { margin-top: 0.25rem; }

  /* Progress */
  .progress-name { max-width: 50%; font-size: 0.7rem; }

  /* Footer */
  footer { padding: 1rem; font-size: 0.7rem; }
}

/* ── Gate / Cover Page ────────────────────────────────────── */
.gate-cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.gate-cover.hidden { display: none; }

.gate-content {
  max-width: 680px;
  padding: 3rem 2rem;
  text-align: center;
}

.gate-logo {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.gate-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.gate-pitch {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 2rem;
}
.gate-pitch strong { color: var(--accent); }

.gate-layers {
  text-align: left;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gate-layer {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.gate-layer-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.gate-layer strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.gate-layer-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.gate-auth {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.gate-input {
  width: 300px;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.gate-input:focus { border-color: var(--accent); }
.gate-input::placeholder { color: var(--text-dim); }

.gate-btn {
  width: 300px;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gate-btn:hover { opacity: 0.9; }
.gate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gate-error {
  color: var(--red);
  font-size: 0.85rem;
}

.gate-footer {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   LOAN WORKFLOW DEMO — isolated module (wf- namespace)
   ═══════════════════════════════════════════════════════════════ */

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

.wf-controls {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.wf-controls select {
  background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem 0.75rem; font-size: 0.85rem;
}
.wf-fire-btn {
  padding: 0.5rem 1.25rem; background: linear-gradient(135deg, var(--accent), #a855f7);
  border: none; border-radius: var(--radius); color: white; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; transition: opacity 0.2s;
}
.wf-fire-btn:hover { opacity: 0.9; }
.wf-fire-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wf-reset-btn {
  padding: 0.5rem 1rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 0.85rem; cursor: pointer;
}
.wf-reset-btn:hover { border-color: var(--accent); }
.wf-controls-label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.wf-status-text { color: var(--text-dim); font-size: 0.85rem; }

.wf-text-dim { color: var(--text-dim); font-size: 0.85rem; margin-left: 0.75rem; }

/* Pipeline */
.wf-pipeline {
  display: flex; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 1.5rem 0; flex-wrap: wrap;
}
.wf-node {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.75rem 1rem; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--bg-card); min-width: 100px; text-align: center;
  cursor: pointer; transition: all 0.3s ease; position: relative;
}
.wf-node-icon { font-size: 1.5rem; }
.wf-node-label { font-size: 0.8rem; font-weight: 600; }
.wf-node-detail { font-size: 0.65rem; color: var(--text-dim); }
.wf-arrow { font-size: 1.25rem; color: var(--text-dim); flex-shrink: 0; }

/* L0 badge — inlined into Loan Apply node (WP-ST-07 U1) */
.wf-l0-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--red, #e74c3c); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 6px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4); letter-spacing: 0.5px;
  pointer-events: none;
}

.wf-node--idle { border-color: var(--border); opacity: 0.6; }
.wf-node--active {
  border-color: var(--accent); opacity: 1;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5), 0 0 40px rgba(6, 182, 212, 0.2);
  animation: wf-pulse 1s ease-in-out infinite;
  transform: scale(1.08);
  z-index: 2;
}
.wf-node--active::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: wf-shimmer 1.2s linear infinite;
  border-radius: 0 0 6px 6px;
}
@keyframes wf-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.wf-node--done {
  border-color: var(--green); opacity: 1;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}
.wf-node--fail {
  border-color: var(--red); opacity: 1;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.wf-node--skip { border-color: var(--border); opacity: 0.3; }
.wf-node--selected { outline: 2px solid var(--accent); outline-offset: 2px; }

.wf-node--scenario { cursor: pointer; }
.wf-node--scenario.wf-node--active {
  border-color: var(--yellow); animation-name: wf-pulse-scenario;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.5), 0 0 40px rgba(234, 179, 8, 0.2);
}
.wf-node--scenario.wf-node--active::after {
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  background-size: 200% 100%;
}
@keyframes wf-pulse-scenario {
  0%, 100% { box-shadow: 0 0 20px rgba(234, 179, 8, 0.5), 0 0 40px rgba(234, 179, 8, 0.2); transform: scale(1.08); }
  50% { box-shadow: 0 0 35px rgba(234, 179, 8, 0.8), 0 0 60px rgba(234, 179, 8, 0.3); transform: scale(1.12); }
}
.wf-node--scenario.wf-node--done { border-color: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.2); }
.wf-pipeline-row2 { margin-top: -0.5rem; padding-left: 2rem; }
.wf-node--input.wf-node--done { border-color: var(--accent); box-shadow: 0 0 8px rgba(6, 182, 212, 0.2); }
.wf-node--lt.wf-node--active {
  border-color: var(--yellow); animation-name: wf-pulse-yellow;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.5), 0 0 40px rgba(234, 179, 8, 0.2);
}
.wf-node--lt.wf-node--active::after {
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  background-size: 200% 100%;
}
@keyframes wf-pulse-yellow {
  0%, 100% { box-shadow: 0 0 20px rgba(234, 179, 8, 0.5), 0 0 40px rgba(234, 179, 8, 0.2); transform: scale(1.08); }
  50% { box-shadow: 0 0 35px rgba(234, 179, 8, 0.8), 0 0 60px rgba(234, 179, 8, 0.3); transform: scale(1.12); }
}
.wf-node--lt.wf-node--done { border-color: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.2); }
.wf-node--lt.wf-node--fail { border-color: var(--red); box-shadow: 0 0 12px rgba(239, 68, 68, 0.3); }
.wf-node--fire.wf-node--done { border-color: var(--accent); box-shadow: 0 0 8px rgba(6, 182, 212, 0.2); }
.wf-node-speed { font-size: 0.6rem; color: var(--text-dim); }

.wf-lt-gate {
  margin: 0.5rem 0 1rem; padding: 0.75rem; border-radius: var(--radius);
  text-align: center;
}
.wf-lt-gate-card {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem 1.25rem; font-size: 0.85rem;
}
.wf-lt-gate-verdict { font-weight: 700; }
.wf-lt-gate-detail { font-size: 0.8rem; color: var(--text-dim); }

@keyframes wf-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.5), 0 0 40px rgba(6, 182, 212, 0.2); transform: scale(1.08); }
  50% { box-shadow: 0 0 35px rgba(6, 182, 212, 0.8), 0 0 60px rgba(6, 182, 212, 0.3); transform: scale(1.12); }
}

/* Pipeline progress bar */
.wf-progress {
  margin: 0.75rem 0; padding: 0 0.5rem;
}
.wf-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.35rem;
}
.wf-progress-label {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
}
.wf-progress-count {
  font-size: 0.8rem; font-weight: 700; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.wf-progress-track {
  height: 6px; background: var(--bg-input); border-radius: 3px;
  overflow: hidden; border: 1px solid var(--border);
}
.wf-progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim));
  background-size: 200% 100%;
  transition: width 0.5s ease;
  animation: wf-progress-shimmer 1.5s ease-in-out infinite;
}
@keyframes wf-progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.wf-progress-fill.wf-progress-done {
  background: linear-gradient(90deg, var(--green), #4ade80);
  animation: none;
}
.wf-progress-fill.wf-progress-fail {
  background: linear-gradient(90deg, var(--red), #f87171);
  animation: none;
}

.wf-arrow--active { color: var(--accent); }
.wf-arrow--done { color: var(--green); }

/* Results area */
.wf-results-area { margin-top: 1.5rem; }
.wf-section-title { font-size: 1rem; margin-bottom: 1rem; color: var(--text); }

.wf-results-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.wf-results-grid--2col { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .wf-results-grid, .wf-results-grid--2col { grid-template-columns: 1fr; } }

.wf-result-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.wf-card-header {
  padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600;
}
.wf-lt-header { background: rgba(234, 179, 8, 0.1); color: var(--yellow); }
.wf-gem2-header { background: rgba(6, 182, 212, 0.1); color: var(--accent); }
.wf-comp-header { background: rgba(16, 185, 129, 0.1); color: var(--compliance); }

.wf-card-body { padding: 0.75rem; }
.wf-layer-badge {
  background: rgba(255,255,255,0.1); padding: 0.1rem 0.4rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700;
}
.wf-layer-name { flex: 1; }
.wf-layer-speed { font-size: 0.7rem; color: var(--text-dim); }

.wf-verdict-display {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; text-align: center;
  padding: 0.25rem; border-radius: 4px;
}
.wf-verdict-allow { color: var(--green); background: var(--green-bg); }
.wf-verdict-deny { color: var(--red); background: var(--red-bg); }
.wf-verdict-log { color: var(--yellow); background: var(--yellow-bg); }
.wf-verdict-pass { color: var(--green); background: var(--green-bg); }
.wf-verdict-block { color: var(--red); background: var(--red-bg); }

.wf-score-row {
  display: flex; justify-content: space-between; padding: 0.2rem 0;
  font-size: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wf-label { color: var(--text-dim); }
.wf-value { font-weight: 600; }
.wf-flags-area { margin-top: 0.5rem; font-size: 0.75rem; }
.wf-compliance-regs { font-size: 0.8rem; margin-top: 0.5rem; color: var(--text-dim); }

/* Summary table */
.wf-summary-area { margin-top: 2rem; }
.wf-data-table {
  width: 100%; border-collapse: collapse; background: var(--bg-card);
  border-radius: var(--radius); overflow: hidden;
}
.wf-data-table th {
  background: rgba(255,255,255,0.05); padding: 0.6rem 0.75rem;
  text-align: left; font-size: 0.75rem; text-transform: uppercase;
  color: var(--text-dim); letter-spacing: 0.05em;
}
.wf-data-table td {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; cursor: pointer;
}
.wf-data-table tr:hover td { background: rgba(6, 182, 212, 0.05); }

.wf-final-status {
  margin-top: 1rem; padding: 1rem; border-radius: var(--radius);
  font-size: 1.1rem; font-weight: 700; text-align: center;
}
.wf-final-approved { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.wf-final-rejected { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* AI Interpretation */
.wf-interpret-stage, .wf-interpret-summary { margin-top: 1rem; }
.wf-btn-interpret {
  padding: 0.5rem 1rem; background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: none; border-radius: var(--radius); color: white; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.wf-btn-interpret:hover { opacity: 0.85; }
.wf-btn-interpret:disabled { opacity: 0.4; cursor: not-allowed; }
.wf-interpret-card {
  margin-top: 0.75rem; padding: 1rem; background: var(--bg-card);
  border: 1px solid #6d28d9; border-radius: var(--radius);
  font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap;
}

/* Modal */
.wf-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 2rem;
}
.wf-modal-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  max-width: 900px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.wf-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.wf-modal-title { font-size: 1.1rem; font-weight: 700; }
.wf-modal-close {
  background: none; border: none; color: var(--text-dim); font-size: 1.5rem;
  cursor: pointer; line-height: 1;
}
.wf-modal-close:hover { color: var(--text); }
.wf-modal-body { padding: 1.5rem; }
.wf-modal-section { margin-bottom: 1rem; }
.wf-modal-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.wf-modal-contract, .wf-modal-input {
  background: var(--bg-input); padding: 0.75rem; border-radius: 4px;
  font-size: 0.7rem; max-height: 200px; overflow-y: auto; white-space: pre-wrap;
}
.wf-modal-columns {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem;
}
.wf-modal-columns--2col { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .wf-modal-columns, .wf-modal-columns--2col { grid-template-columns: 1fr; } }
.wf-modal-col {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
}
.wf-modal-col-header {
  padding: 0.5rem 0.75rem; font-size: 0.8rem; font-weight: 600;
}

/* AI Interpretation modal */
.wf-interpret-modal-card { max-width: 800px; }
.wf-interpret-layers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.25rem;
}
@media (max-width: 700px) { .wf-interpret-layers { grid-template-columns: 1fr; } }
.wf-interpret-layer {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.wf-interpret-layer-header {
  padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; display: flex;
  align-items: center; justify-content: space-between;
}
.wf-interpret-layer-header.wf-verdict-allow { background: var(--green); color: #fff; }
.wf-interpret-layer-header.wf-verdict-block { background: var(--red); color: #fff; }
.wf-interpret-layer-header.wf-verdict-review { background: var(--yellow); color: #000; }
.wf-interpret-layer-header.wf-verdict-na { background: #374151; color: #9ca3af; }
.wf-interpret-layer-header.wf-verdict-error { background: var(--red); color: #fff; }
.wf-interpret-layer-verdict {
  font-size: 0.85rem; font-weight: 800; padding: 0.15rem 0.5rem;
  border-radius: 4px; background: rgba(0,0,0,0.2);
}
.wf-interpret-layer-body {
  padding: 0.6rem 0.75rem; font-size: 0.8rem; line-height: 1.5;
}
.wf-interpret-layer-body .wf-il-row {
  display: flex; justify-content: space-between; padding: 0.15rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wf-interpret-layer-body .wf-il-label { color: var(--text-dim); }
.wf-interpret-layer-body .wf-il-value { font-weight: 600; font-family: var(--font-mono); }
.wf-interpret-narrative {
  background: var(--bg-card); border: 1px solid #6d28d9; border-radius: var(--radius);
  padding: 1rem 1.25rem; font-size: 0.85rem; line-height: 1.65;
}
.wf-interpret-narrative h4 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #a78bfa; margin: 0 0 0.5rem 0;
}
.wf-interpret-narrative p {
  margin: 0 0 0.75rem 0; color: var(--text);
}
.wf-interpret-narrative p:last-child { margin-bottom: 0; }
.wf-interpret-footer {
  margin-top: 0.75rem; font-size: 0.75rem; color: var(--text-dim); line-height: 1.4;
}
.wf-interpret-footer .wf-if-meta { margin-bottom: 0.25rem; }
.wf-interpret-footer .wf-if-disclaimer { font-style: italic; opacity: 0.7; }

/* Scenario selection modal */
.wf-scenario-card { max-width: 700px; }
.wf-scenario-select {
  width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.9rem; margin-bottom: 0.5rem;
}
.wf-scenario-desc {
  font-size: 0.85rem; color: var(--text-dim); min-height: 1.2em; margin-top: 0.25rem;
}
.wf-scenario-input {
  width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem; font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; resize: vertical; outline: none;
}
.wf-scenario-input:focus { border-color: var(--accent); }
.wf-scenario-actions {
  margin-top: 1rem; display: flex; justify-content: flex-end;
}

/* === WP-ST-08: CORRECTION popup + Hybrid orchestration === */

.wf-correction-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.wf-correction-overlay.hidden { display: none; }

.wf-correction-card {
  background: var(--bg-panel, #1a1f2e); color: var(--text);
  border: 1px solid var(--border, #2a3142); border-radius: 10px;
  width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto;
  padding: 1.5rem; position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.wf-correction-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.4rem; cursor: pointer; padding: 0.25rem 0.5rem; line-height: 1;
}
.wf-correction-close:hover { color: var(--text); }

.wf-correction-title {
  font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem 0; color: var(--text);
}

.wf-correction-cards-row {
  display: flex; gap: 0.75rem; margin-bottom: 1rem;
}
.wf-correction-card-layer {
  flex: 1; background: var(--bg-input, #0e1320); border: 1px solid var(--border, #2a3142);
  border-radius: 8px; padding: 0.75rem; min-width: 0;
}
.wf-correction-card-layer .layer-name {
  font-size: 0.7rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase;
}
.wf-correction-card-layer .layer-verdict {
  font-size: 1rem; font-weight: 700; margin-top: 0.25rem;
}
.wf-correction-card-layer.deny  .layer-verdict, .wf-correction-card-layer.failure .layer-verdict { color: var(--red, #e74c3c); }
.wf-correction-card-layer.allow .layer-verdict, .wf-correction-card-layer.success .layer-verdict { color: var(--green, #4ade80); }
.wf-correction-card-layer.skipped .layer-verdict { color: var(--text-dim); }
.wf-correction-card-layer .layer-score {
  font-size: 0.75rem; color: var(--text-dim); margin-top: 0.15rem;
}
.wf-correction-card-layer .layer-rule {
  font-size: 0.7rem; color: var(--text-dim); margin-top: 0.4rem;
  word-break: break-word;
}

.wf-correction-toggle {
  width: 100%; background: var(--bg-input, #0e1320); color: var(--text);
  border: 1px solid var(--border, #2a3142); border-radius: 6px;
  padding: 0.5rem 0.75rem; cursor: pointer; text-align: left;
  font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center;
}
.wf-correction-toggle:hover { background: rgba(255,255,255,0.04); }

.wf-correction-detail {
  background: var(--bg-input, #0e1320); border: 1px solid var(--border, #2a3142);
  border-top: none; border-radius: 0 0 6px 6px;
  padding: 0.75rem; font-size: 0.78rem; color: var(--text-dim);
  max-height: 200px; overflow-y: auto;
}
.wf-correction-detail.hidden { display: none; }
.wf-correction-detail .reason-row {
  padding: 0.3rem 0; border-bottom: 1px dashed var(--border, #2a3142);
}
.wf-correction-detail .reason-row:last-child { border-bottom: none; }

.wf-correction-edit-area { margin-top: 1rem; }
.wf-correction-edit-area label {
  display: block; font-size: 0.78rem; color: var(--text-dim);
  letter-spacing: 0.5px; margin-bottom: 0.4rem; text-transform: uppercase;
}
.wf-correction-textarea {
  width: 100%; background: var(--bg-input, #0e1320); color: var(--text);
  border: 1px solid var(--border, #2a3142); border-radius: 6px;
  padding: 0.6rem; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem; resize: vertical; outline: none; min-height: 220px;
}
.wf-correction-textarea:focus { border-color: var(--accent, #3b82f6); }

.wf-correction-alert {
  margin-top: 0.75rem; padding: 0.6rem 0.75rem;
  background: rgba(231,76,60,0.14); border: 1px solid var(--red, #e74c3c);
  color: var(--red, #e74c3c); border-radius: 6px; font-size: 0.85rem;
}
.wf-correction-alert.hidden { display: none; }
.wf-correction-alert.success {
  background: rgba(74,222,128,0.14); border-color: var(--green, #4ade80);
  color: var(--green, #4ade80);
}

.wf-correction-actions {
  margin-top: 1rem; display: flex; justify-content: flex-end; gap: 0.5rem;
}
.wf-correction-retry-btn {
  background: var(--accent, #3b82f6); color: #fff; border: none;
  border-radius: 6px; padding: 0.6rem 1.4rem; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; letter-spacing: 0.5px;
}
.wf-correction-retry-btn:hover { filter: brightness(1.1); }
.wf-correction-retry-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.wf-correction-autofix-btn {
  background: #fbbf24; color: #1a1f2e; border: none;
  border-radius: 6px; padding: 0.6rem 1.1rem; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; letter-spacing: 0.5px;
}
.wf-correction-autofix-btn:hover { filter: brightness(1.08); }
.wf-correction-autofix-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.wf-correction-next-btn {
  background: var(--green, #4ade80); color: #0e1320; border: none;
  border-radius: 6px; padding: 0.6rem 1.1rem; font-weight: 700;
  font-size: 0.9rem; cursor: pointer; letter-spacing: 0.5px;
}
.wf-correction-next-btn:hover { filter: brightness(1.10); }
.wf-correction-next-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === WP-ST-17: Pipeline carousel + 3-column detail panel === */

.wf-pipeline-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 1.5rem 0;
  margin-bottom: 1rem;
}
.wf-pipeline-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.wf-pipeline-inner .wf-node { flex-shrink: 0; }
.wf-pipeline-inner .wf-arrow { flex-shrink: 0; }

.wf-stage-current {
  transform: scale(1.12);
  box-shadow: 0 0 24px rgba(59,130,246,0.45);
  border: 2px solid var(--accent, #3b82f6) !important;
  z-index: 2;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Detail panel — 3 columns (legacy) or 4 columns (WP-ST-28: + L3 Egress) */
.wf-detail-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.wf-detail-panel.wf-detail-panel-4col {
  grid-template-columns: repeat(4, 1fr);
}
.wf-detail-layer-l3 {
  background: rgba(34,197,94,0.18); color: var(--green, #4ade80);
}
.wf-detail-card {
  background: var(--bg-panel, #1a1f2e);
  border: 1px solid var(--border, #2a3142);
  border-radius: 8px;
  padding: 0;
  min-height: 240px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wf-detail-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border, #2a3142);
  background: rgba(255,255,255,0.02);
  font-size: 0.8rem;
}
.wf-detail-layer {
  background: rgba(255,255,255,0.10); color: var(--text-dim);
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
}
.wf-detail-layer-p { background: rgba(59,130,246,0.18); color: var(--accent, #3b82f6); }
.wf-detail-layer-o { background: rgba(168,85,247,0.18); color: #c084fc; }
.wf-detail-brand {
  flex: 1; color: var(--text); font-weight: 600;
}
.wf-detail-timing {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem; color: var(--text-dim);
  background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 3px;
}
.wf-detail-body {
  flex: 1; padding: 0.85rem;
  font-size: 0.82rem; color: var(--text);
  overflow-y: auto;
}
.wf-detail-placeholder { color: var(--text-dim); font-size: 0.78rem; font-style: italic; }

/* Waiting state — static gray (no animation), shown on a downstream gate
   while its upstream gate is still in flight. */
.wf-detail-waiting {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--border, #2a3142);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.5px;
}

/* Processing animation — orange pulsing bar */
.wf-detail-processing {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(251,191,36,0.10);
  border: 1px solid #fbbf24;
  border-radius: 6px;
  color: #fbbf24;
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.5px;
  animation: wf-detail-pulse 1.1s ease-in-out infinite;
}
@keyframes wf-detail-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.97); }
}

/* Verdict states for card body */
.wf-detail-verdict {
  font-size: 1.15rem; font-weight: 700; letter-spacing: 1px;
  padding: 0.35rem 0.75rem; border-radius: 4px; display: inline-block;
  margin-bottom: 0.5rem;
}
.wf-detail-verdict.allow, .wf-detail-verdict.success {
  background: rgba(74,222,128,0.14); color: var(--green, #4ade80);
}
.wf-detail-verdict.deny, .wf-detail-verdict.failure {
  background: rgba(231,76,60,0.14); color: var(--red, #e74c3c);
}
.wf-detail-verdict.skipped, .wf-detail-verdict.na {
  background: rgba(255,255,255,0.06); color: var(--text-dim);
}
.wf-detail-meta {
  font-size: 0.76rem; color: var(--text-dim); margin-top: 0.25rem;
  word-break: break-word;
}
.wf-detail-rule {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem; color: var(--text);
  background: rgba(0,0,0,0.25); padding: 0.4rem 0.55rem; border-radius: 4px;
  margin-top: 0.5rem; word-break: break-word;
}

.wf-detail-interpret-row {
  display: flex; justify-content: center;
  margin-top: 0.75rem;
}
.wf-interpret-btn {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff; border: none; border-radius: 6px;
  padding: 0.55rem 1.2rem; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(139,92,246,0.4);
}
.wf-interpret-btn:hover { filter: brightness(1.10); }
.wf-interpret-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Demo button cluster — small per-stage controls */
.wf-demo-button-cluster {
  display: flex; gap: 4px; margin-top: 6px;
  justify-content: center; flex-wrap: wrap;
}
.wf-demo-button {
  background: rgba(231,76,60,0.10); color: var(--red, #e74c3c);
  border: 1px solid rgba(231,76,60,0.4); border-radius: 4px;
  padding: 2px 6px; font-size: 0.62rem; cursor: pointer;
  letter-spacing: 0.3px; font-weight: 600; line-height: 1.2;
}
.wf-demo-button:hover { background: rgba(231,76,60,0.20); }
.wf-demo-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Run All Demos button — prominent header control */
.wf-run-all-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
  border: none; border-radius: 6px; padding: 0.5rem 1rem;
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  letter-spacing: 0.5px; box-shadow: 0 2px 6px rgba(59,130,246,0.4);
}
.wf-run-all-btn:hover { filter: brightness(1.1); }
.wf-run-all-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.wf-demo-controls {
  display: flex; gap: 0.75rem; align-items: center; margin: 0.5rem 0 1rem 0;
}
.wf-demo-autoclick-label {
  font-size: 0.78rem; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; gap: 0.3rem;
}
