@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:           #141413;
  --surface:      #1c1c1a;
  --surface-alt:  #232320;
  --border:       #2e2e2a;
  --border-hover: rgba(232, 221, 208, 0.25);
  --text:         #e8ddd0;
  --text-muted:   #7a7a6e;
  --text-dim:     #4a4a40;
  --accent:       #c9a96e;
  --accent-cool:  #6b9fc7;
  --glow-warm:    rgba(201, 169, 110, 0.08);
  --success: #48bb78;
  --warning: #ed8936;
  --error: #f56565;
  --critical: #e53e3e;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

header h1 { font-size: 16px; font-weight: 600; color: var(--text); }
header .badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: white; }
.sse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--error); transition: background 0.3s; }
.sse-dot.connected { background: var(--success); }

.panels {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  flex: 1;
  overflow: hidden;
}

.panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel:last-child { border-right: none; }

.panel-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Pipeline stages */
.stage-list { display: flex; flex-direction: column; gap: 2px; }

.stage-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  transition: background 0.2s;
}
.stage-item.active { background: rgba(201,169,110,0.12); }
.stage-item.complete { color: var(--success); }
.stage-item.error { color: var(--error); }
.stage-item.pending { color: var(--text-muted); }
.stage-item.gate { background: rgba(237,137,54,0.08); }
.stage-item.gate.active { background: rgba(237,137,54,0.2); color: var(--warning); }

.stage-icon { width: 16px; text-align: center; flex-shrink: 0; }
.stage-name { flex: 1; }
.stage-meta { font-size: 10px; color: var(--text-muted); }

.spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* HITL Panel */
.hitl-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  gap: 8px;
}

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.gate-card.critical { border-color: var(--critical); background: rgba(229,62,62,0.06); }
.gate-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.gate-title .critical-badge {
  background: var(--critical);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}
.gate-warning { color: var(--warning); font-size: 12px; margin-bottom: 10px; }
.gate-warning.critical { color: var(--critical); font-weight: 600; }

.artifact-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  font-size: 11px;
  font-family: monospace;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 10px;
}

.hitl-actions { display: flex; gap: 10px; align-items: flex-start; flex-direction: column; padding-top: 4px; }

/* Reviewer credentials */
.reviewer-credentials-row { width: 100%; }
.reviewer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.reviewer-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #4a5568; margin-left: 4px; }
.reviewer-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
}
.reviewer-input:focus { outline: none; border-color: var(--accent); }
.reviewer-input::placeholder { color: #4a5568; }

/* Rejection section (shown after toggle) */
.rejection-section {
  display: none;
  width: 100%;
  background: rgba(245,101,101,0.05);
  border: 1px solid rgba(245,101,101,0.2);
  border-radius: 6px;
  padding: 12px;
  gap: 8px;
  flex-direction: column;
}
.rejection-section.visible, .rejection-section[style*="display: block"] { display: flex; }

.rejection-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 8px;
  font-size: 12px;
  resize: vertical;
  min-height: 80px;
}
.rejection-input:focus { outline: none; border-color: var(--error); }
.rejection-input::placeholder { color: #4a5568; }
.btn-row { display: flex; gap: 8px; width: 100%; }

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.2s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-approve { background: var(--success); color: white; flex: 1; }
.btn-reject { background: var(--error); color: white; flex: 1; }
.btn-reject-toggle { background: rgba(245,101,101,0.15); color: var(--error); border: 1px solid rgba(245,101,101,0.3); flex: 1; }
.btn-reject-toggle:hover { background: rgba(245,101,101,0.25); }
.btn-cancel-reject { background: transparent; color: var(--text-muted); border: 1px solid var(--border); flex: 0; padding: 8px 14px; }
.btn-primary { background: var(--accent); color: white; }

/* Gate 4 three-panel layout */
.review-trio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.review-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}
.review-panel h4 { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--accent); }
.review-panel.missing { opacity: 0.5; border-style: dashed; }
.review-panel.missing h4 { color: var(--error); }

/* KSA table */
.ksa-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.ksa-table th, .ksa-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.ksa-table th { color: var(--text-muted); background: var(--surface); position: sticky; top: 0; }
.type-k { color: #6b9fc7; }
.type-s { color: #5a9e6f; }
.type-a { color: #c4884a; }
.mode-mcq { background: rgba(107,159,199,0.15); border-radius: 3px; padding: 1px 5px; }
.mode-lab { background: rgba(90,158,111,0.15); border-radius: 3px; padding: 1px 5px; }

/* Defensibility report */
.verdict-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}
.verdict-defensible { background: var(--success); color: white; }
.verdict-notes { background: var(--warning); color: white; }
.verdict-not-defensible { background: var(--critical); color: white; }

.standards-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 10px; }
.standards-table th, .standards-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.standards-table th { color: var(--text-muted); background: var(--surface); }
.status-satisfied { color: var(--success); }
.status-partial { color: var(--warning); }
.status-gap { color: var(--error); }

/* Audit trail */
.audit-filter { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.audit-filter input, .audit-filter select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  flex: 1;
}
.audit-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.audit-table th { color: var(--text-muted); background: var(--surface); padding: 5px 8px; text-align: left; position: sticky; top: 0; border-bottom: 1px solid var(--border); }
.audit-table td { padding: 4px 8px; border-bottom: 1px solid rgba(42,45,58,0.5); vertical-align: top; }
.audit-table tr:hover td { background: rgba(255,255,255,0.02); cursor: pointer; }
.audit-row-expanded { background: var(--surface) !important; }
.audit-json { font-family: monospace; font-size: 10px; white-space: pre-wrap; word-break: break-all; padding: 8px; background: var(--bg); border-radius: 4px; max-height: 200px; overflow-y: auto; }
.audit-expand-inner { padding: 8px 4px; }
.audit-meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.audit-meta-pill { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: var(--border); color: var(--text-muted); border: 1px solid var(--border); }
.audit-decision-approved { color: var(--success); border-color: var(--success); }
.audit-decision-rejected { color: var(--error); border-color: var(--error); }
.audit-message { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.audit-output-label { font-size: 10px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin: 8px 0 4px; }
.audit-output-pre { font-family: monospace; font-size: 10px; white-space: pre-wrap; word-break: break-all; padding: 10px; background: var(--bg); border-radius: 4px; max-height: 300px; overflow-y: auto; margin: 0; border: 1px solid var(--border); line-height: 1.5; }
.event-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.ev-agent_run { background: rgba(201,169,110,0.2); color: #c9a96e; }
.ev-hitl_decision { background: rgba(104,211,145,0.2); color: #68d391; }
.ev-gate_opened { background: rgba(246,173,85,0.2); color: #f6ad55; }
.ev-gate_closed { background: rgba(237,137,54,0.2); color: #ed8936; }
.ev-pipeline_start { background: rgba(153,102,255,0.2); color: #b794f4; }
.ev-pipeline_complete { background: rgba(104,211,145,0.3); color: #48bb78; }
.ev-pipeline_error { background: rgba(245,101,101,0.2); color: #f56565; }
.ev-validation_warning { background: rgba(246,173,85,0.15); color: #ed8936; }
.ev-stage_error { background: rgba(245,101,101,0.15); color: #f56565; }

/* Start panel */
.start-form { display: flex; flex-direction: column; gap: 10px; }
.start-form textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.start-form textarea:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 11px; color: var(--text-muted); }
.pipeline-id-display { font-family: monospace; font-size: 11px; color: var(--accent); background: var(--surface); padding: 6px 10px; border-radius: 4px; word-break: break-all; }

/* ── Info Cards (human-readable gate output) ── */
.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(42,45,58,0.5);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Stats row */
.stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.stat-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
}
.stat-value { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.ksa-k .stat-value { color: #63b3ed; }
.ksa-s .stat-value { color: #68d391; }
.ksa-a .stat-value { color: #f6ad55; }

/* Section labels */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 8px 0 4px;
}

/* Compact lists */
.compact-list {
  font-size: 11px;
  padding-left: 16px;
  margin-bottom: 6px;
}
.compact-list li { margin-bottom: 2px; line-height: 1.4; }
.gap-list li { color: var(--warning); }

/* Narrative text */
.narrative {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  font-style: italic;
}

/* Source rows */
.source-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
}
.priority-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.priority-dot.high { background: var(--error); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--text-muted); }
.source-type {
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Confidence bar */
.confidence-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 10px;
}
.confidence-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s;
}

/* Domain cards */
.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 6px;
}
.domain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.domain-name { font-size: 12px; font-weight: 600; }
.domain-weight { font-size: 13px; font-weight: 700; color: var(--accent); }
.weight-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 4px;
}
.weight-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.domain-meta { font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* Review panels (Gate 4) */
.review-panel h4 { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--accent); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-summary { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; }

/* Rating badges */
.rating-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}
.rating-strong { background: rgba(72,187,120,0.2); color: var(--success); }
.rating-acceptable { background: rgba(237,137,54,0.2); color: var(--warning); }
.rating-weak { background: rgba(245,101,101,0.2); color: var(--error); }
.rating-info { background: rgba(201,169,110,0.2); color: var(--accent); }

/* Challenge/flag items */
.challenge-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
}
.sev-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.sev-high { background: rgba(245,101,101,0.2); color: var(--error); }
.sev-medium { background: rgba(237,137,54,0.2); color: var(--warning); }
.sev-low { background: rgba(104,211,145,0.15); color: var(--success); }

/* Pill badges */
.badge-pill {
  display: inline-block;
  background: rgba(201,169,110,0.15);
  color: var(--accent);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 3px;
}

/* Blueprint table */
.bp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bp-table th, .bp-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.bp-table th { color: var(--text-muted); background: var(--surface); }

/* MCQ Item cards */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.item-meta { margin-bottom: 6px; }
.item-stem { font-size: 12px; margin-bottom: 6px; line-height: 1.4; }
.item-options {
  list-style: none;
  font-size: 11px;
  padding: 0;
}
.item-options li { padding: 2px 0 2px 4px; color: var(--text-muted); }
.correct-option { color: var(--success) !important; font-weight: 600; }
.diff-easy { background: rgba(72,187,120,0.2); color: var(--success); }
.diff-medium { background: rgba(237,137,54,0.2); color: var(--warning); }
.diff-hard { background: rgba(245,101,101,0.2); color: var(--error); }

/* Report button */
.btn-report {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}
.btn-report:hover { background: rgba(201,169,110,0.1); }

.btn-start-over {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.2s;
}
.btn-start-over:hover { background: rgba(248,113,113,0.1); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Demo controls (question count + model select) ── */
.demo-controls {
  display: flex;
  gap: 8px;
}
.demo-control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.demo-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.demo-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.demo-select:focus { outline: none; border-color: var(--accent); }

/* Disabled/skipped stages (lab tasks in demo mode) */
.stage-item.skipped {
  opacity: 0.35;
  pointer-events: none;
}
.stage-item.skipped .stage-name {
  text-decoration: line-through;
}

/* ── Load Example links ── */
.example-links {
  font-size: 11px;
  color: var(--text-muted);
}
.example-links a { color: var(--accent); text-decoration: none; }
.example-links a:hover { text-decoration: underline; }

/* ── Recent Pipelines history ── */
.history-section {
  margin-bottom: 10px;
}
.history-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 0 4px;
}
.history-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.history-empty { font-size: 11px; color: var(--text-muted); padding: 4px 0; }
.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.hist-id { font-family: monospace; color: var(--accent); flex-shrink: 0; }
.hist-stage { flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-ts { color: var(--text-muted); flex-shrink: 0; }
.hist-complete .hist-id { color: var(--success); }
.hist-error .hist-id { color: var(--error); }
.hist-running .hist-id { color: var(--accent); }

/* ── Catalogue panel (middle panel idle state) ── */
.catalogue-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.catalogue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.catalogue-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.catalogue-view-all {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.catalogue-view-all:hover { text-decoration: underline; }

.catalogue-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalogue-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.catalogue-card:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
}

.catalogue-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.35;
}

.catalogue-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.catalogue-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(201,169,110,0.12);
  border: 1px solid rgba(201,169,110,0.25);
  color: var(--accent);
  white-space: nowrap;
}

.catalogue-date {
  font-size: 11px;
  color: var(--text-muted);
}

.catalogue-stats {
  font-size: 11px;
  color: var(--text-muted);
}

.catalogue-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.catalogue-loading {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Completion banner ── */
.completion-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  text-align: center;
  padding: 24px;
}
.completion-icon {
  font-size: 48px;
  color: var(--success);
  line-height: 1;
}
.completion-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}
.completion-sub {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 260px;
}

/* ── Report button pulse ── */
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,110,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(201,169,110,0); }
}
.btn-report.pulse { animation: pulse-border 1.5s ease-in-out 3; }

/* ── Pipeline progress notice ── */
.pipeline-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.pipeline-notice svg { color: var(--accent); }
.pipeline-notice strong { color: var(--accent); font-weight: 600; }

/* ── Stage hint text (shown below active stage name) ── */
.stage-hint-text {
  display: none;
  width: 100%;
  padding-left: 24px; /* indent to align under stage-name */
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
}
.stage-hint-text:not(:empty) { display: block; }

/* ── Mobile tab bar (hidden on desktop) ── */
.mobile-tab-bar { display: none; }

@media (max-width: 768px) {
  body { height: auto; overflow: auto; }

  .panels {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .panel {
    display: none;
    height: calc(100svh - 48px - 48px);
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .panel.mobile-active { display: flex; }

  /* Mobile tab bar */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 48px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
  }
  .mobile-tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-top: 2px solid transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: color 0.15s;
    position: relative;
  }
  .mobile-tab-btn.active {
    color: var(--accent);
    border-top-color: var(--accent);
  }
  .mobile-tab-btn[data-tab="review"].has-gate::after {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--warning);
    position: absolute;
    top: 6px; right: calc(50% - 14px);
  }

  /* Scrollable tables */
  .audit-table, .ksa-table, .bp-table, .standards-table {
    display: block;
    overflow-x: auto;
  }

  /* Compact header */
  header { flex-wrap: wrap; gap: 8px; }
  header h1 { font-size: 13px; }
}

