/* KeenSec Reporter AI Analysis: Aligned with Main Index Page Design System */

.ra-page {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

.ra-page .brand-hero {
  padding-bottom: clamp(40px, 5vw, 64px);
}

/* ==========================================================================
   1. Showcase Console (Inside .dashboard-preview)
   ========================================================================== */
.ra-signal-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ra-stab {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  text-align: center;
}

.ra-stab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.03);
}

.ra-stab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.ra-spanel {
  padding: 20px;
}

.ra-spanel[hidden] {
  display: none;
}

.ra-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.ra-metric-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.ra-met-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.ra-met-val {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ra-met-val.green { color: #10b981; }
.ra-met-val.purple { color: #a855f7; }
.ra-met-val.red { color: #ef4444; }
.ra-met-val.amber { color: #f59e0b; }
.ra-met-val.cyan { color: #38bdf8; }

.ra-met-sub {
  font-size: 11px;
  color: #94a3b8;
}

.ra-code-block {
  background: #070d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ra-code-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ra-code-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.ra-code-block pre {
  margin: 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #cbd5e1;
  overflow-x: auto;
}

.ra-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #94a3b8;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ra-ft-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.ra-ft-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   2. Triage Workbench in Story Band
   ========================================================================== */
.ra-preset-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  background: rgba(12, 21, 39, 0.8);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ra-preset-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  font-family: var(--font-mono);
  margin-right: 6px;
}

.ra-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ra-preset-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 113, 255, 0.4);
}

.ra-preset-btn.active {
  background: rgba(51, 113, 255, 0.18);
  border-color: var(--blue);
  box-shadow: 0 0 14px rgba(51, 113, 255, 0.25);
}

.ra-pdot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ra-pdot.red { background: #f87171; box-shadow: 0 0 6px #f87171; }
.ra-pdot.amber { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.ra-pdot.purple { background: #c084fc; box-shadow: 0 0 6px #c084fc; }
.ra-pdot.green { background: #4ade80; box-shadow: 0 0 6px #4ade80; }

.ra-pbtn-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.ra-pbtn-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

/* Dual Pane Workbench */
.ra-workbench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ra-wb-pane {
  background: #0c1527;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.ra-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ra-pane-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7aa2ff;
}

.ra-pane-reporter {
  font-size: 12px;
  color: #94a3b8;
}

.ra-message-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}

.ra-msg-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 13px;
}

.ra-msg-row:last-child {
  margin-bottom: 0;
}

.ra-msg-label {
  width: 95px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}

.ra-msg-val {
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.ra-msg-val.strong {
  font-weight: 600;
  color: #ffffff;
}

.ra-msg-val.italic {
  font-style: italic;
  color: #94a3b8;
}

.ra-subhead {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 12px;
}

.ra-signals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ra-sig-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 12px;
}

.ra-sig-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.ra-sig-status {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ra-sig-status.pass { color: #34d399; }
.ra-sig-status.fail { color: #f87171; }
.ra-sig-status.warn { color: #fbbf24; }

.ra-sig-sub {
  font-size: 10.5px;
  color: #94a3b8;
  display: block;
  line-height: 1.35;
}

/* Right Pane: Verdict */
.ra-verdict-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.ra-verdict-chip.critical { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.ra-verdict-chip.high { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.ra-verdict-chip.sim { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.ra-verdict-chip.clean { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

.ra-confidence-meter {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.ra-conf-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.ra-conf-header strong {
  color: #ffffff;
}

.ra-conf-bar-outer {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.ra-conf-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ra-conf-bar-fill.critical { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.ra-conf-bar-fill.high { background: linear-gradient(90deg, #38bdf8, #f59e0b); }
.ra-conf-bar-fill.sim { background: linear-gradient(90deg, #818cf8, #c084fc); }
.ra-conf-bar-fill.clean { background: linear-gradient(90deg, #38bdf8, #10b981); }

.ra-narrative-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.ra-narrative-card h4, .ra-actions-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
}

.ra-narrative-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ra-point {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #38bdf8;
}

.ra-point.red { border-left-color: #ef4444; }
.ra-point.amber { border-left-color: #f59e0b; }
.ra-point.blue { border-left-color: #38bdf8; }
.ra-point.purple { border-left-color: #a855f7; }

.ra-point strong {
  color: #ffffff;
}

.ra-actions-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px;
}

.ra-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.ra-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #cbd5e1;
}

.ra-authorize-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  font-size: 13.5px;
}

.ra-authorize-btn.authorized {
  background: #059669 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
}

/* ==========================================================================
   3. Pipeline Grid (Light Cards Matching Homepage .path-card)
   ========================================================================== */
.ra-pipeline-section {
  padding-top: clamp(60px, 7vw, 90px);
  padding-bottom: clamp(60px, 7vw, 90px);
}

.ra-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.ra-pcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ra-pcard h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.ra-pcard p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.ra-pcard-specs {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.ra-pcard-specs li {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ra-pcard-specs li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ==========================================================================
   4. Telemetry Dimensions Grid (Light Cards)
   ========================================================================== */
.ra-dimensions-section {
  padding-top: clamp(50px, 6vw, 80px);
  padding-bottom: clamp(60px, 7vw, 90px);
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ra-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.ra-dim-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ra-dim-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.ra-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.ra-dim-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
}

.ra-dim-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.35;
  margin: 0 0 10px;
}

.ra-dim-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 16px;
  flex: 1;
}

.ra-dim-proof {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12px;
}

.ra-proof-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}

.ra-proof-val {
  color: var(--text);
  line-height: 1.45;
}

/* ==========================================================================
   5. Facts Grid (Light Cards)
   ========================================================================== */
.ra-facts-section {
  padding-top: clamp(60px, 7vw, 90px);
  padding-bottom: clamp(60px, 7vw, 90px);
}

.ra-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.ra-fact-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.ra-fact-card:hover {
  border-color: var(--accent);
}

.ra-fact-card .mono {
  color: var(--accent-ink);
  display: block;
  margin-bottom: 8px;
}

.ra-fact-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 10px;
  line-height: 1.4;
}

.ra-fact-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .ra-workbench-grid {
    grid-template-columns: 1fr;
  }
  .ra-pipeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ra-dimensions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ra-facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .ra-signals-grid {
    grid-template-columns: 1fr;
  }
  .ra-pipeline-grid {
    grid-template-columns: 1fr;
  }
  .ra-dimensions-grid {
    grid-template-columns: 1fr;
  }
  .ra-facts-grid {
    grid-template-columns: 1fr;
  }
}

/* Preset switch: panes dip briefly while the new report loads */
.ra-workbench-grid .ra-wb-pane { transition: opacity .16s ease; }
.ra-workbench-grid.is-switching .ra-wb-pane { opacity: .35; }
.ra-conf-bar-fill { transition: width .6s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion: reduce) { .ra-workbench-grid .ra-wb-pane, .ra-conf-bar-fill { transition: none; } }
/* Next-step checklist: compact checkboxes (the global form rule makes inputs full width) */
.ra-check-item { align-items: flex-start; line-height: 1.5; font-size: 13px; }
.ra-check-item input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; padding: 0; border-radius: 4px; border: 1px solid rgba(96, 165, 250, .6); background: rgba(51, 113, 255, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; box-shadow: none; opacity: 1; }
.ra-check-item span { flex: 1; min-width: 0; }
