/* Company Dossier — enterprise workspace (dark-mode compatible) */

.rs-shell { min-height: calc(100vh - var(--header-height)); background: var(--color-gray-50); }
body.rs-dark .rs-shell,
body.rs-dark .ws-page-content { background: #0f1419; color: #e7ecf3; }
/* Dark mode also themes the shared shell (sidebar + topbar + context bar), which
   otherwise stayed light — a half-dark app looked broken. */
body.rs-dark .ws-sidebar,
body.rs-dark .ws-topbar,
body.rs-dark .ws-context-bar { background: #141c28; border-color: #2a3544; color: #e7ecf3; }
body.rs-dark .ws-topbar-title { color: #e7ecf3; }
body.rs-dark .ws-topbar-subtitle,
body.rs-dark .ws-nav-group-toggle { color: #8b9cb3; }
body.rs-dark .ws-nav-item { color: #b8c4d4; }
body.rs-dark .ws-nav-item.active,
body.rs-dark .ws-nav-item:hover { background: #1a2332; color: #e7ecf3; }
body.rs-dark .ws-search-trigger { background: #1a2332; border-color: #2a3544; color: #8b9cb3; }
body.rs-dark .icon-btn { color: #b8c4d4; }
body.rs-dark .avatar { background: #1e3a5f; color: #93c5fd; }
body.rs-dark .agcc-logo-title { color: #e7ecf3; }

/* Destructive action (permanent delete) — was used on the delete button but never
   defined, so it looked identical to the benign Archive button beside it. */
.rs-danger { color: var(--color-danger-600, #dc2626); }
.rs-danger:hover {
  background: var(--color-danger-50, #fef2f2);
  border-color: var(--color-danger-600, #dc2626);
  color: var(--color-danger-600, #dc2626);
}
body.rs-dark .rs-danger { color: #f87171; }
body.rs-dark .rs-danger:hover { background: #7f1d1d33; border-color: #b91c1c; color: #fca5a5; }
body.rs-dark .rs-panel,
body.rs-dark .rs-card,
body.rs-dark .rs-kpi,
body.rs-dark .rs-active-card,
body.rs-dark .rs-report-card { background: #1a2332; border-color: #2a3544; }
body.rs-dark .rs-muted,
body.rs-dark .rs-hint,
body.rs-dark .text-muted { color: #8b9cb3 !important; }
body.rs-dark .rs-table th,
body.rs-dark .rs-table td { border-color: #2a3544; }
body.rs-dark .input { background: #141c28; border-color: #2a3544; color: #e7ecf3; }

.rs-page { max-width: 1180px; margin: 0 auto; padding: 0 4px 48px; }
.rs-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.rs-page-head h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.rs-lede { margin: 0; font-size: 14px; color: var(--color-text-muted); max-width: 56ch; line-height: 1.5; }

.rs-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.rs-kpi { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; background: var(--color-surface-raised); }
.rs-kpi-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.rs-kpi strong { display: block; font-size: 1.75rem; font-weight: 600; margin: 4px 0; }
.rs-kpi-sub { font-size: 12px; color: var(--color-text-muted); }

.rs-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .rs-split { grid-template-columns: 1fr; } }

.rs-panel { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; background: var(--color-surface-raised); margin-bottom: 16px; }
.rs-panel h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }

.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rs-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px;
  background: var(--color-surface-raised); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.rs-card:hover { border-color: var(--color-primary-500); box-shadow: var(--shadow-sm); }
.rs-card-static { cursor: default; }
.rs-card h3 { margin: 0 0 8px; font-size: 14px; }
.rs-card p { margin: 0 0 10px; font-size: 13px; color: var(--color-text-muted); line-height: 1.45; }

.rs-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.rs-table th, .rs-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.rs-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); font-weight: 600; }

.rs-status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.rs-status-queued { background: #f3f4f6; color: #4b5563; }
.rs-status-researching { background: #dbeafe; color: #1d4ed8; }
.rs-status-collecting_evidence { background: #e0e7ff; color: #4338ca; }
.rs-status-generating_report { background: #fef3c7; color: #b45309; }
.rs-status-ready { background: #d1fae5; color: #047857; }
.rs-status-archived { background: #f3f4f6; color: #4b5563; }
body.rs-dark .rs-status-queued { background: #2a3544; color: #cbd5e1; }
body.rs-dark .rs-status-researching { background: #1e3a5f; color: #93c5fd; }
body.rs-dark .rs-status-ready { background: #064e3b; color: #6ee7b7; }

.rs-empty { text-align: center; padding: 48px 24px; border: 1px dashed var(--color-border); border-radius: var(--radius-md); }
.rs-empty i { width: 32px; height: 32px; color: var(--color-text-muted); margin-bottom: 12px; }
.rs-empty h3 { margin: 0 0 8px; font-size: 16px; }
.rs-empty p { margin: 0 auto 16px; max-width: 40ch; font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }

.rs-muted { font-size: 13px; color: var(--color-text-muted); }
.rs-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 8px; }
.rs-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 6px; }
.rs-input-lg { font-size: 15px; padding: 12px 14px; }
.rs-textarea { min-height: 80px; resize: vertical; font-family: inherit; width: 100%; }
.rs-composer { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rs-composer input { flex: 1; min-width: 180px; }

/* Wizard */
.rs-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.rs-step { flex: 1; min-width: 120px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); text-align: center; opacity: 0.55; }
.rs-step.active { border-color: var(--color-primary-500); opacity: 1; box-shadow: 0 0 0 1px var(--color-primary-500); }
.rs-step.done { opacity: 0.85; }
.rs-step span { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: var(--color-primary-100); color: var(--color-primary-700); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.rs-step label { display: block; font-size: 12px; color: var(--color-text-muted); }
.rs-wizard-actions { display: flex; justify-content: space-between; margin-top: 16px; }

.rs-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rs-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent; font-size: 13px; cursor: pointer; }
.rs-chip.active { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); }
body.rs-dark .rs-chip.active { background: #1e3a5f; color: #93c5fd; }

.rs-depth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rs-depth-card { text-align: left; padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: transparent; cursor: pointer; }
.rs-depth-card.active { border-color: var(--color-primary-500); background: var(--color-primary-50); }
.rs-depth-card strong { display: block; font-size: 14px; }
.rs-depth-card span { font-size: 12px; color: var(--color-primary-600); }
.rs-depth-card p { margin: 8px 0 0; font-size: 12px; color: var(--color-text-muted); }

.rs-upload-zone { border: 2px dashed var(--color-border); border-radius: var(--radius-md); padding: 32px; text-align: center; }
.rs-upload-zone i { width: 28px; height: 28px; color: var(--color-text-muted); }

.rs-active-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--color-surface-raised); }
.rs-active-card-full { flex-direction: row; align-items: flex-start; }
.rs-active-main { flex: 1; min-width: 240px; }
.rs-active-card h3 { margin: 0; font-size: 14px; flex: 1; min-width: 200px; }
.rs-progress { height: 6px; background: var(--color-gray-100); border-radius: 999px; margin: 10px 0 6px; overflow: hidden; }
.rs-progress-bar { height: 100%; background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400)); border-radius: 999px; transition: width .4s ease; }
body.rs-dark .rs-progress { background: #2a3544; }

.rs-swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .rs-swot-grid { grid-template-columns: 1fr; } }
.rs-swot-cell { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.rs-swot-cell h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.rs-swot-cell ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.rs-swot-s { background: #ecfdf5; border-color: #a7f3d0; }
.rs-swot-w { background: #fef2f2; border-color: #fecaca; }
.rs-swot-o { background: #eff6ff; border-color: #bfdbfe; }
.rs-swot-r { background: #fffbeb; border-color: #fde68a; }
body.rs-dark .rs-swot-s { background: #064e3b33; border-color: #065f46; }
body.rs-dark .rs-swot-w { background: #7f1d1d33; border-color: #991b1b; }
body.rs-dark .rs-swot-o { background: #1e3a5f33; border-color: #1d4ed8; }
body.rs-dark .rs-swot-r { background: #78350f33; border-color: #b45309; }

.rs-impact { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.rs-impact-high { color: #047857; }
.rs-impact-medium { color: #b45309; }
body.rs-dark .rs-impact-high { color: #6ee7b7; }
body.rs-dark .rs-impact-medium { color: #fcd34d; }

.rs-action-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rs-phase { padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.rs-phase h4 { margin: 0 0 8px; font-size: 13px; }
.rs-phase ul { margin: 0; padding-left: 18px; font-size: 13px; }

.rs-charts { display: flex; flex-direction: column; gap: 12px; }
.rs-chart-row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.rs-chart-bar { height: 8px; background: var(--color-gray-100); border-radius: 999px; overflow: hidden; }
.rs-chart-bar > div { height: 100%; background: var(--color-primary-500); border-radius: 999px; }
body.rs-dark .rs-chart-bar { background: #2a3544; }

.rs-project-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }

.rs-report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rs-report-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; background: var(--color-surface-raised); }
.rs-report-snippet { font-size: 13px; color: var(--color-text-muted); line-height: 1.45; margin: 8px 0 12px; }
.rs-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.rs-timeline { margin-bottom: 20px; padding-left: 8px; border-left: 2px solid var(--color-border); }
.rs-tl-item { display: flex; gap: 12px; margin-bottom: 14px; position: relative; }
.rs-tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary-500); margin-top: 4px; flex-shrink: 0; margin-left: -13px; }
.rs-confidence { margin-top: 12px; font-size: 13px; padding: 8px 12px; background: var(--color-primary-50); border-radius: var(--radius-md); display: inline-block; }
body.rs-dark .rs-confidence { background: #1e3a5f; }

.rs-pill { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; background: var(--color-gray-100); margin-right: 6px; }

.rs-export-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.rs-export-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.rs-muted-block { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.rs-custom-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; max-width: 720px; }

.rs-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 12px 18px; border-radius: var(--radius-md); font-size: 14px;
  background: #111827; color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.rs-toast.show { opacity: 1; transform: translateY(0); }
.rs-toast-error { background: #991b1b; }

/* Workflows — automation engine UI */
.rs-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rs-panel-head h2 { margin: 0; }

.rs-wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rs-wf-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px;
  background: var(--color-surface-raised); transition: border-color .15s, box-shadow .15s;
}
.rs-wf-card:hover { border-color: var(--color-primary-400); box-shadow: var(--shadow-sm); }
.rs-wf-card-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.rs-wf-card-top i { width: 20px; height: 20px; color: var(--color-primary-600); flex-shrink: 0; margin-top: 2px; }
.rs-wf-card-top h3 { margin: 0 0 4px; font-size: 14px; }
.rs-wf-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }
.rs-wf-card-compact { padding: 12px; margin-bottom: 8px; }

.rs-wf-empty-hero {
  text-align: center; padding: 56px 28px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface-raised); margin-bottom: 20px;
}
.rs-wf-empty-hero i { width: 40px; height: 40px; color: var(--color-primary-500); margin-bottom: 16px; }
.rs-wf-empty-hero h2 { margin: 0 0 10px; font-size: 1.25rem; }
.rs-wf-empty-hero p { margin: 0 auto 20px; max-width: 52ch; color: var(--color-text-muted); line-height: 1.55; font-size: 14px; }
.rs-wf-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.rs-wf-cat-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.rs-wf-status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.rs-wf-status-draft { background: #f3f4f6; color: #4b5563; }
.rs-wf-status-ready { background: #dbeafe; color: #1d4ed8; }
.rs-wf-status-queued { background: #f3f4f6; color: #4b5563; }
.rs-wf-status-running { background: #e0e7ff; color: #4338ca; }
.rs-wf-status-waiting { background: #fef3c7; color: #b45309; }
.rs-wf-status-generating { background: #fce7f3; color: #be185d; }
.rs-wf-status-completed { background: #d1fae5; color: #047857; }
.rs-wf-status-failed { background: #fee2e2; color: #b91c1c; }
.rs-wf-status-archived { background: #f3f4f6; color: #4b5563; }
body.rs-dark .rs-wf-status-running { background: #1e3a5f; color: #93c5fd; }
body.rs-dark .rs-wf-status-waiting { background: #78350f; color: #fcd34d; }
body.rs-dark .rs-wf-status-completed { background: #064e3b; color: #6ee7b7; }

.rs-wf-block-list { display: flex; flex-direction: column; gap: 8px; }
.rs-wf-block { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.rs-wf-block-num { width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary-100); color: var(--color-primary-700); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rs-wf-block i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

.rs-wf-exec-trace { display: flex; flex-direction: column; gap: 8px; }
.rs-wf-exec-step { padding: 12px; border-left: 3px solid var(--color-border); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--color-gray-50); }
.rs-wf-exec-step-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.rs-wf-exec-completed { border-left-color: #10b981; }
.rs-wf-exec-waiting { border-left-color: #f59e0b; }
.rs-wf-exec-failed { border-left-color: #ef4444; }
.rs-wf-exec-running { border-left-color: #3b82f6; }
.rs-wf-error { color: #b91c1c; font-size: 13px; }
body.rs-dark .rs-wf-exec-step { background: #141c28; }

.rs-wf-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rs-wf-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.rs-wf-modal-body { position: relative; width: 100%; max-width: 480px; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-lg); }
.rs-wf-modal-body h2 { margin: 0 0 16px; font-size: 1.1rem; }
.rs-wf-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
body.rs-dark .rs-wf-modal-body { background: #1a2332; border-color: #2a3544; }

.rs-wf-docs-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.rs-wf-search-row { margin-bottom: 14px; max-width: 400px; }
.rs-wf-lib-card .rs-wf-stars { font-size: 12px; color: #f59e0b; letter-spacing: 2px; margin-bottom: 10px; display: block; }

/* Research-first UX */
.rs-dash-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.rs-dash-hero h1 { margin: 0; font-size: 1.75rem; letter-spacing: -0.03em; }
.rs-kpi-grid-6 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.rs-recent-list { display: flex; flex-direction: column; gap: 6px; }
.rs-recent-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: transparent; cursor: pointer; transition: border-color .15s; }
.rs-recent-row:hover { border-color: var(--color-primary-400); }
.rs-recent-title { flex: 1; font-weight: 600; font-size: 14px; }

.rs-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.rs-quick-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-raised); color: var(--color-text-primary); cursor: pointer; font-size: 13px; font-weight: 500; transition: border-color .15s, transform .1s; }
.rs-quick-card:hover { border-color: var(--color-primary-500); transform: translateY(-1px); }
.rs-quick-card i { width: 22px; height: 22px; color: var(--color-primary-600); }

.rs-hero-page { display: flex; justify-content: center; padding-top: 24px; }
.rs-hero-center { width: 100%; max-width: 720px; }
.rs-hero-center h1 { margin: 0 0 8px; font-size: 1.65rem; text-align: center; letter-spacing: -0.03em; }
.rs-hero-sub { text-align: center; color: var(--color-text-muted); font-size: 14px; margin: 0 0 24px; line-height: 1.5; }
.rs-hero-textarea { width: 100%; min-height: 100px; font-size: 15px; padding: 14px; border-radius: 12px; resize: vertical; }
.rs-type-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.rs-type-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent; font-size: 13px; cursor: pointer; }
.rs-type-chip.active { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); font-weight: 600; }
.rs-hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 600px) { .rs-hero-row { grid-template-columns: 1fr; } }
.rs-depth-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.rs-depth-pill { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--color-border); background: transparent; cursor: pointer; font-size: 13px; }
.rs-depth-pill.active { border-color: var(--color-primary-500); background: var(--color-primary-500); color: #fff; }
.rs-hero-run { width: 100%; justify-content: center; }

.rs-run-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 12px; background: var(--color-surface-raised); }
.rs-run-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.rs-run-head h3 { margin: 0; font-size: 15px; }
.rs-run-phase { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--color-primary-600); }
.rs-run-bar { height: 8px; background: var(--color-gray-100); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.rs-run-bar > div { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 999px; transition: width .5s ease; }
body.rs-dark .rs-run-bar { background: #2a3544; }
.rs-run-phases { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--color-text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.rs-run-phases .active { color: var(--color-primary-600); font-weight: 700; }
.rs-run-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; font-size: 13px; }
.rs-run-stats strong { display: block; font-size: 12px; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 2px; }

.rs-report-card-rich { border: 1px solid var(--color-border); border-radius: 12px; padding: 20px; background: var(--color-surface-raised); }
.rs-report-card-top { display: flex; gap: 12px; margin-bottom: 10px; }
.rs-report-card-top i { width: 24px; height: 24px; color: var(--color-primary-500); }
.rs-report-grid-rich { gap: 16px; }
.rs-export-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.rs-share-hint { font-size: 12px; margin-top: 8px; }

.rs-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rs-template-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; text-align: center; background: var(--color-surface-raised); }
.rs-template-card i { width: 28px; height: 28px; color: var(--color-primary-500); margin-bottom: 8px; }
.rs-template-card h3 { margin: 0 0 6px; font-size: 14px; }

.rs-persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rs-persona-card { text-align: left; padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: transparent; cursor: pointer; }
.rs-persona-card.active { border-color: var(--color-primary-500); background: var(--color-primary-50); }
.rs-persona-card strong { display: block; font-size: 13px; margin-bottom: 4px; }
.rs-persona-card span { font-size: 12px; color: var(--color-text-muted); }
.rs-source-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.rs-source-cat { padding: 10px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 13px; }
.rs-kb-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

/* Intelligence operation — project command center */
.rs-intel-project { max-width: 1180px; margin: 0 auto; }
.rs-intel-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.rs-intel-eyebrow { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary-600); font-weight: 700; margin-bottom: 4px; }
.rs-intel-title h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.rs-intel-actions { display: flex; gap: 8px; align-items: flex-start; }

.rs-lifecycle-rail { display: flex; gap: 2px; overflow-x: auto; padding: 12px 0 20px; margin-bottom: 8px; }
.rs-lc-step { flex: 1; min-width: 72px; text-align: center; font-size: 12px; color: var(--color-text-muted); position: relative; }
.rs-lc-dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); margin: 0 auto 6px; }
.rs-lc-step.done .rs-lc-dot { background: #10b981; }
.rs-lc-step.done label { color: #047857; }
.rs-lc-step.current .rs-lc-dot { background: var(--color-primary-500); box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
.rs-lc-step.current label { color: var(--color-primary-700); font-weight: 700; }
body.rs-dark .rs-lc-step.done label { color: #6ee7b7; }

.rs-exec-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.rs-exec-kpi-item { padding: 12px; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: 10px; }
.rs-exec-kpi-item span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.rs-exec-kpi-item strong { font-size: 14px; font-weight: 600; }

.rs-proj-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 16px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.rs-proj-tab { padding: 8px 14px; border: none; background: transparent; font-size: 13px; font-weight: 500; color: var(--color-text-muted); cursor: pointer; border-radius: 8px; white-space: nowrap; font-family: inherit; }
.rs-proj-tab:hover { color: var(--color-text-primary); background: var(--color-gray-50); }
.rs-proj-tab.active { color: var(--color-primary-700); background: var(--color-primary-50); font-weight: 600; }
body.rs-dark .rs-proj-tab.active { background: #1e3a5f; color: #93c5fd; }

.rs-proj-panel { animation: rsFadeIn .25s ease; }
@keyframes rsFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rs-proj-running { text-align: center; padding: 40px 24px; }

.rs-ev-detail { border: 1px solid var(--color-border); border-radius: 10px; margin-bottom: 8px; background: var(--color-surface-raised); }
.rs-ev-detail summary { padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
.rs-ev-conf { font-size: 12px; font-weight: 700; color: var(--color-primary-600); min-width: 40px; }
.rs-ev-impact { margin-left: auto; font-size: 12px; color: var(--color-text-muted); }
.rs-ev-body { padding: 0 14px 14px; font-size: 13px; }
.rs-ev-body dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 10px; margin: 10px 0; font-size: 12px; }
.rs-ev-body dt { color: var(--color-text-muted); }
.rs-ev-shot { max-width: 100%; border-radius: 8px; border: 1px solid var(--color-border); margin-bottom: 10px; }
.rs-ev-shot-slot { padding: 20px; background: var(--color-gray-50); border: 1px dashed var(--color-border); border-radius: 8px; font-size: 12px; color: var(--color-text-muted); text-align: center; margin-bottom: 10px; }
body.rs-dark .rs-ev-shot-slot { background: #141c28; }

.rs-charts-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .rs-charts-split { grid-template-columns: 1fr; } }
.rs-mini-chart svg { max-width: 160px; }

.rs-pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rs-pres-card { text-align: left; padding: 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-raised); cursor: pointer; font-family: inherit; }
.rs-pres-card strong { display: block; font-size: 13px; margin-bottom: 4px; }
.rs-pres-card span { font-size: 12px; color: var(--color-text-muted); }
.rs-pres-card:hover { border-color: var(--color-primary-400); }

.rs-download-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-deliverable-list { font-size: 14px; line-height: 1.7; }
.rs-proj-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border); }

.rs-exec-narrative { padding: 20px 22px; border-radius: 12px; border: 1px solid var(--color-border); background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-surface-raised) 65%); margin-bottom: 8px; }
body.rs-dark .rs-exec-narrative { background: linear-gradient(135deg, #1e3a5f33 0%, #1a2332 65%); }
.rs-narr-lead { margin: 8px 0 0; font-size: 15px; line-height: 1.75; max-width: 72ch; color: var(--color-text-primary); }
.rs-narr-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rs-narr-stat { padding: 10px 14px; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: 8px; min-width: 88px; }
.rs-narr-stat span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.rs-narr-stat strong { font-size: 1.1rem; font-weight: 600; }

/* Lifecycle banner + page transitions */
.rs-lifecycle-banner {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px 18px 8px;
  background: linear-gradient(135deg, var(--color-surface-raised) 0%, var(--color-gray-50) 100%);
  margin-bottom: 20px;
}
body.rs-dark .rs-lifecycle-banner { background: linear-gradient(135deg, #1a2332 0%, #141c28 100%); }
.rs-lifecycle-eyebrow { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary-600); font-weight: 700; margin-bottom: 8px; }
.rs-lifecycle-compact .rs-lc-step { min-width: 56px; }
.rs-lifecycle-compact label { font-size: 12px; line-height: 1.2; }

.rs-recent-main { flex: 1; min-width: 0; }
.rs-recent-progress { height: 4px; background: var(--color-gray-100); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.rs-recent-progress > div { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 999px; transition: width .5s ease; }
body.rs-dark .rs-recent-progress { background: #2a3544; }
.rs-recent-stage { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }

.rs-run-progress { margin-bottom: 16px; }
.rs-run-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--color-text-muted); margin-top: 8px; }
.rs-run-meta strong { color: var(--color-text-primary); }

.rs-report-kpis { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--color-text-muted); margin-bottom: 10px; }
.rs-report-kpis strong { color: var(--color-text-primary); font-size: 14px; }

.rs-shell.rs-page-enter,
#rs-inner.rs-page-enter { animation: rsPageEnter .3s ease; }
@keyframes rsPageEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Dark surfaces: these rules use the primary-600/700 PRIMITIVES, which cannot
   flip. On the dark panels they measured 2.76:1 and 3.58:1. */
body.rs-dark .rs-lifecycle-eyebrow,
body.rs-dark .rs-intel-eyebrow,
body.rs-dark .rs-depth-card span,
body.rs-dark .rs-run-phase,
body.rs-dark .rs-run-phases .active,
body.rs-dark .rs-lifecycle-node.active label,
body.rs-dark .rs-lifecycle-rail label,
body.rs-dark .rs-quick-card i,
body.rs-dark .rs-wf-card-top i {
  color: var(--color-text-accent);
}
