/* Dark mode (default) */
:root {
  --bg: #0a0b0d;
  --surface: #12141a;
  --surface2: #1a1d26;
  --surface3: #252a3a;
  --ink: #e8eaf2;
  --muted: #6b7280;
  --stroke: #252a3a;
  --shadow: rgba(0,0,0,0.5);

  /* Lens colors */
  --visibility: #3b82f6;
  --trust: #a855f7;
  --accountability: #f97316;
  --delegation: #eab308;
  --role: #ef4444;
  --financial: #14b8a6;
  --security: #64748b;

  /* Status */
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;

  /* Security scenarios */
  --synavia: #64b5f6;

  /* Systems */
  --fleetmatics: #fbbf24;
  --terralink: #60a5fa;
  --smartvault: #34d399;
  --motive: #f472b6;
  --quickbooks: #a78bfa;
  --custom: #3b82f6;
}

/* Light mode - OS preference (when no manual override) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface2: #f0f2f5;
    --surface3: #e4e7ec;
    --ink: #1a1d26;
    --muted: #5f6775;
    --stroke: #d1d5dc;
    --shadow: rgba(0,0,0,0.1);
  }
}

/* Light mode - manual override */
:root[data-theme="light"] {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --surface3: #e4e7ec;
  --ink: #1a1d26;
  --muted: #5f6775;
  --stroke: #d1d5dc;
  --shadow: rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.header-left p {
  font-size: 12px;
  color: var(--muted);
}

.step-badge {
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
}

.step-badge-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-badge-title {
  font-size: 14px;
  font-weight: 600;
}

/* View Tabs + Lens Legend Bar */
.control-bar {
  padding: 12px 32px;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 8px;
}

.view-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.view-tab:hover {
  color: var(--ink);
  background: var(--surface3);
}

.view-tab.active {
  color: var(--ink);
  background: var(--visibility);
}

.lens-legend {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lens-legend-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lens-legend-items {
  display: flex;
  gap: 12px;
}

.lens-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.lens-legend-item:hover {
  background: var(--surface2);
  color: var(--ink);
}

.lens-legend-item.active {
  background: var(--surface3);
  color: var(--ink);
}

.lens-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Transformation Cycle Graphic */
.cycle-graphic {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cycle-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cycle-items {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
}

.cycle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.cycle-item:hover {
  background: var(--surface3);
  color: var(--ink);
}

.cycle-item.active {
  background: var(--surface3);
  color: var(--ink);
}

.cycle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cycle-text {
  font-weight: 500;
}

.cycle-arrow {
  color: var(--stroke);
  font-size: 14px;
  margin-left: 4px;
}

/* Main Content */
.main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* View Container */
.view-container {
  display: none;
}

.view-container.active {
  display: block;
}

/* ============================================
   NARRATIVE VIEW
   ============================================ */
.narrative-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
}

.narrative-header {
  margin-bottom: 32px;
}

.narrative-step-num {
  font-size: 12px;
  color: var(--visibility);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.narrative-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.narrative-summary {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.narrative-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.narrative-body p {
  margin-bottom: 20px;
}

.narrative-body strong {
  color: var(--ink);
  font-weight: 600;
}

.narrative-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--stroke);
}

.narrative-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.lens-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.lens-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid var(--muted);
}

.lens-card[data-lens="visibility"] { border-left-color: var(--visibility); }
.lens-card[data-lens="trust"] { border-left-color: var(--trust); }
.lens-card[data-lens="accountability"] { border-left-color: var(--accountability); }
.lens-card[data-lens="delegation"] { border-left-color: var(--delegation); }
.lens-card[data-lens="role"] { border-left-color: var(--role); }
.lens-card[data-lens="financial"] { border-left-color: var(--financial); }

.lens-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lens-card-title {
  font-size: 13px;
  font-weight: 600;
}

.lens-card-content {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================
   DASHBOARD VIEW
   ============================================ */
.dashboard-view {
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
}

.dashboard-title {
  font-size: 16px;
  font-weight: 600;
}

.dashboard-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.live {
  background: var(--success);
  animation: pulse 2s infinite;
}

.status-indicator.stale { background: var(--warning); }
.status-indicator.unknown { background: var(--muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Summary Cards */
.summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 14px;
}

.summary-card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.summary-card-value {
  font-size: 24px;
  font-weight: 700;
}

.summary-card-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.summary-card.unknown .summary-card-value { color: var(--muted); }
.summary-card.warning .summary-card-value { color: var(--warning); }
.summary-card.danger .summary-card-value { color: var(--danger); }
.summary-card.success .summary-card-value { color: var(--success); }

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  margin-top: 8px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.financial-section {
  margin-bottom: 16px;
}

.financial-section .summary-row {
  grid-template-columns: repeat(4, 1fr);
}

/* Pipeline Section */
.pipeline-section {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.pipeline-title {
  font-size: 14px;
  font-weight: 600;
}

.pipeline-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.pipeline-column {
  background: var(--surface2);
  border-radius: 6px;
  min-height: 180px;
}

.pipeline-column-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-column-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.pipeline-column-count {
  font-size: 10px;
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--muted);
}

.pipeline-column-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manual-indicator {
  background: rgba(255,255,255,.02);
  border: 1px dashed var(--stroke);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.manual-indicator-icon {
  font-size: 16px;
  margin-bottom: 4px;
}

.manual-indicator-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.job-card {
  background: var(--surface3);
  border-radius: 6px;
  padding: 8px;
  border-left: 3px solid var(--visibility);
}

.job-card.warning { border-left-color: var(--warning); }

.job-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.job-card-id {
  font-size: 9px;
  font-weight: 600;
  color: #60a5fa;
}

.job-card-time {
  font-size: 8px;
  color: var(--muted);
}

.job-card-client {
  font-size: 10px;
  font-weight: 500;
}

/* Bottom Row */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.compliance-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface2);
  font-size: 12px;
}

.compliance-item:last-child { border-bottom: none; }
.compliance-label { color: var(--muted); }
.compliance-value { font-weight: 500; }
.compliance-value.good { color: var(--success); }
.compliance-value.warning { color: var(--warning); }
.compliance-value.danger { color: var(--danger); }
.compliance-value.unknown { color: var(--muted); font-style: italic; }

.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface2);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.activity-icon.complete { background: rgba(34, 197, 94, 0.2); }
.activity-icon.alert { background: rgba(239, 68, 68, 0.2); }

.activity-text {
  font-size: 12px;
}

.activity-time {
  font-size: 10px;
  color: var(--muted);
}

/* ============================================
   WORKFLOW VIEW
   ============================================ */
.workflow-view {
  padding: 24px 32px;
}

.workflow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.workflow-title {
  font-size: 16px;
  font-weight: 600;
}

.workflow-legend {
  display: flex;
  gap: 16px;
}

.workflow-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.workflow-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Swim Lanes */
.swim-lanes {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
}

.swim-lane {
  display: flex;
  min-height: 90px;
  border-bottom: 1px solid var(--stroke);
}

.swim-lane:last-child { border-bottom: none; }

.swim-lane-label {
  width: 100px;
  flex-shrink: 0;
  padding: 12px;
  background: var(--surface);
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.swim-lane-role {
  font-size: 12px;
  font-weight: 600;
}

.swim-lane-who {
  font-size: 9px;
  color: var(--muted);
}

.swim-lane-content {
  flex: 1;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  background: var(--bg);
}

.wf-step {
  flex-shrink: 0;
  width: 120px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  position: relative;
}

.wf-step.fleetmatics { border-color: var(--fleetmatics); background: rgba(251, 191, 36, 0.1); }
.wf-step.terralink { border-color: var(--terralink); background: rgba(96, 165, 250, 0.1); }
.wf-step.smartvault { border-color: var(--smartvault); background: rgba(52, 211, 153, 0.1); }
.wf-step.motive { border-color: var(--motive); background: rgba(244, 114, 182, 0.1); }
.wf-step.quickbooks { border-color: var(--quickbooks); background: rgba(167, 139, 250, 0.1); }
.wf-step.custom { border-color: var(--custom); background: rgba(59, 130, 246, 0.1); box-shadow: 0 0 15px rgba(59, 130, 246, 0.1); }
.wf-step.manual { border-color: var(--muted); border-style: dashed; background: rgba(107, 114, 128, 0.1); }

.wf-step-title {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
}

.wf-step-system {
  font-size: 8px;
  color: var(--muted);
}

.wf-connector {
  flex-shrink: 0;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stroke);
  font-size: 14px;
}

.wf-connector.solid { color: var(--success); }

.wf-gap {
  flex-shrink: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.wf-gap-icon { font-size: 14px; }
.wf-gap-label {
  font-size: 7px;
  color: var(--danger);
  text-align: center;
  line-height: 1.1;
}

.auto-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--success);
  color: var(--bg);
  font-size: 7px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Workflow Stats */
.workflow-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.workflow-stat {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.workflow-stat-value {
  font-size: 24px;
  font-weight: 700;
}

.workflow-stat.bad .workflow-stat-value { color: var(--danger); }
.workflow-stat.good .workflow-stat-value { color: var(--success); }

.workflow-stat-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* Issues/Benefits Grid */
.workflow-issues {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.issue-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px;
}

.issue-card.danger { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }
.issue-card.success { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.05); }

.issue-icon { font-size: 20px; margin-bottom: 8px; }
.issue-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.issue-title.danger { color: var(--danger); }
.issue-title.success { color: var(--success); }
.issue-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* ============================================
   SECURITY VIEW
   ============================================ */
.security-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px;
}

.security-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
}

.security-title {
  font-size: 18px;
  font-weight: 600;
}

.security-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-badge {
  background: var(--security);
  color: white;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.security-badge.foundation { background: var(--security); }
.security-badge.emerging { background: var(--warning); color: var(--bg); }
.security-badge.establishing { background: var(--visibility); }
.security-badge.maturing { background: var(--trust); }
.security-badge.ambient { background: var(--success); }

/* Legacy visual styles - keeping for compatibility */
.security-visual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.security-visual-panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 20px;
}

.security-visual-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  text-align: center;
}

/* Doors Visualization */
.security-doors {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 80px;
  align-items: flex-end;
  padding: 0 10px;
}

.security-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
}

.security-door-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.security-door.open .security-door-icon {
  filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.4));
}

.security-door.locked .security-door-icon {
  filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.4));
}

.security-door.archived .security-door-icon {
  opacity: 0.3;
  font-size: 24px;
}

.security-door-label {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}

.security-door.open .security-door-label {
  color: var(--danger);
}

.security-door.locked .security-door-label {
  color: var(--success);
}

.security-door.archived .security-door-label {
  opacity: 0.5;
  text-decoration: line-through;
}

.security-doors-count {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
  font-weight: 500;
}

/* Credential Flow Visualization */
.security-flow {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.security-flow-chaos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.security-flow-item {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
}

.security-flow-item.bad {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px dashed var(--danger);
}

.security-flow-item.mixed {
  background: rgba(234, 179, 8, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.security-flow-item.good {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.security-flow-structured {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.security-flow-hub {
  background: var(--visibility);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.security-flow-arrow {
  color: var(--success);
  font-size: 16px;
}

.security-flow-roles {
  display: flex;
  gap: 8px;
}

.security-flow-role {
  background: var(--surface2);
  border: 1px solid var(--success);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--success);
}

/* Ownership Spectrum */
.security-ownership {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.security-ownership-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  text-align: center;
}

.security-ownership-bar {
  position: relative;
  height: 24px;
  background: linear-gradient(to right, var(--danger), var(--warning), var(--success));
  border-radius: 12px;
  margin: 0 60px 24px;
}

.security-ownership-fill {
  position: absolute;
  top: -4px;
  width: 32px;
  height: 32px;
  background: white;
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.5s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.security-ownership-marker {
  position: absolute;
  top: 32px;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.security-ownership-status {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.security-metrics {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 20px;
}

.security-metrics-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.security-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.security-metric {
  background: var(--surface2);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid var(--security);
}

.security-metric.good { border-left-color: var(--success); }
.security-metric.warning { border-left-color: var(--warning); }
.security-metric.danger { border-left-color: var(--danger); }
.security-metric.neutral { border-left-color: var(--muted); }

.security-metric-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.security-metric-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.security-metric.good .security-metric-value { color: var(--success); }
.security-metric.warning .security-metric-value { color: var(--warning); }
.security-metric.danger .security-metric-value { color: var(--danger); }

.security-metric-note {
  font-size: 11px;
  color: var(--muted);
}

/* ============================================
   SECURITY SCENARIOS
   ============================================ */

/* Section Labels */
.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Scenario Selector (3x2 grid) */
.scenario-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.scenario-btn {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.scenario-btn:hover {
  background: var(--surface2);
  border-color: var(--muted);
}

.scenario-btn.active {
  border-color: var(--synavia);
  background: var(--surface2);
  box-shadow: 0 0 20px rgba(100, 181, 246, 0.1);
}

.scenario-btn-icon {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.scenario-btn-moment {
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 6px;
}

.scenario-btn-question {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--synavia);
}

/* Stage Tabs */
.stages {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stage {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 1;
  min-width: 180px;
}

.stage:hover {
  background: var(--surface2);
  border-color: var(--muted);
}

.stage.active {
  border-color: var(--synavia);
  background: var(--surface2);
}

.stage[data-stage="0"].active { border-color: var(--muted); }
.stage[data-stage="1"].active { border-color: var(--synavia); }
.stage[data-stage="2"].active { border-color: var(--success); }

.stage-number {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stage-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* Scene Container */
.scene-container {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  transition: all 0.4s ease;
}

.scene-container.examining {
  border-color: var(--synavia);
  box-shadow: 0 0 40px rgba(100, 181, 246, 0.08);
}

.scene-container.resolved {
  border-color: var(--success);
  box-shadow: 0 0 40px rgba(102, 187, 106, 0.08);
}

.scene-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 24px;
  transition: color 0.3s ease;
}

.scene-label.examining {
  color: var(--synavia);
}

/* Scene Elements - Base Transition */
.scene-element {
  position: absolute;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.scene-element.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Status Badges */
.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  top: 20px;
  left: 20px;
  z-index: 10;
}

.status-badge.exposed {
  background: rgba(239, 83, 80, 0.2);
  color: var(--danger);
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.status-badge.examining {
  background: rgba(100, 181, 246, 0.2);
  color: var(--synavia);
  border: 1px solid rgba(100, 181, 246, 0.3);
}

.status-badge.resolved {
  background: rgba(102, 187, 106, 0.2);
  color: var(--success);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

/* Question Bubbles - Core Style */
.question-bubble {
  position: absolute;
  background: var(--synavia);
  color: var(--bg);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.question-bubble::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
}

/* Question bubble arrow variants */
.question-bubble.above::after {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-top: 5px solid var(--synavia);
}

.question-bubble.below::after {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom: 5px solid var(--synavia);
}

.question-bubble.q-left::after {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid var(--synavia);
}

.question-bubble.q-right::after {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-right: 5px solid var(--synavia);
}

.question-bubble.q-top::after {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-top: 5px solid var(--synavia);
}

.question-bubble.q-bottom::after {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom: 5px solid var(--synavia);
}

/* State visibility for questions */
.state-awareness .question-bubble {
  opacity: 1;
  visibility: visible;
}

/* Consequence/Narrative Section */
.consequence {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 3px solid var(--stroke);
  transition: border-color 0.3s ease;
}

.consequence[data-stage="0"] { border-left-color: var(--danger); }
.consequence[data-stage="1"] { border-left-color: var(--synavia); }
.consequence[data-stage="2"] { border-left-color: var(--success); }

.consequence-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.consequence-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
}

/* Verification element (Applied state) */
.verification {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  color: var(--success);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.verification::before {
  content: '✓';
  display: inline-block;
}

.state-applied .verification {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   BOOKKEEPER SCENE (Desk)
   ============================================ */
.desk {
  position: relative;
  width: 100%;
  height: 300px;
  background: linear-gradient(180deg, #1e2128 0%, #15171c 100%);
  border-radius: 12px;
  overflow: visible;
}

/* Desk surface */
.desk::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, #2a2f38 0%, #23272e 100%);
  border-top: 2px solid #3a3f4a;
}

/* Examination overlay - subtle scan effect */
.desk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(100, 181, 246, 0) 0%,
    rgba(100, 181, 246, 0.03) 50%,
    rgba(100, 181, 246, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 5;
  border-radius: 12px;
}

.desk.examining::before {
  opacity: 1;
  animation: scanPulse 3s ease-in-out infinite;
}

@keyframes scanPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Laptop */
.laptop {
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 180px;
  height: 120px;
  z-index: 2;
}

.laptop.visible {
  transform: translateX(-50%) translateY(0);
}

.laptop-screen {
  width: 180px;
  height: 110px;
  background: #1a1d23;
  border: 3px solid #4a5568;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
}

.laptop-screen.active {
  background: #1a3a1a;
  border-color: var(--success);
}

.laptop-screen.off {
  background: #2a2f38;
  border-color: #3a4150;
}

.laptop-base {
  width: 200px;
  height: 10px;
  background: linear-gradient(180deg, #4a5568, #2d3748);
  border-radius: 0 0 4px 4px;
  margin-left: -10px;
}

.screen-content {
  color: var(--ink);
  font-size: 0.7rem;
  text-align: center;
  padding: 8px;
}

.login-name {
  color: var(--synavia);
  font-weight: 500;
}

/* Sticky Note */
.sticky-note {
  width: 85px;
  height: 85px;
  background: #f4e04d;
  border-radius: 2px;
  padding: 10px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  transform: rotate(-3deg);
  right: 12%;
  top: 35px;
  z-index: 3;
  transition: all 0.5s ease;
}

.sticky-note.visible {
  transform: rotate(-3deg) translateY(0);
}

.sticky-note.faded {
  opacity: 0;
  transform: rotate(-3deg) scale(0.8);
}

.sticky-text {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  font-size: 0.6rem;
  color: #92400e;
  line-height: 1.4;
}

/* Phone (bookkeeper) */
.phone-small {
  width: 45px;
  height: 75px;
  background: #1a1d23;
  border: 2px solid #4a5568;
  border-radius: 6px;
  left: 15%;
  bottom: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  z-index: 2;
}

.phone-screen-small {
  width: 36px;
  height: 54px;
  background: #2d3748;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
}

.notification {
  width: 100%;
  height: 10px;
  background: var(--danger);
  border-radius: 2px;
  opacity: 0.8;
}

/* Drawer */
.drawer {
  width: 65px;
  height: 50px;
  background: #3a4150;
  border: 2px solid #4a5568;
  border-radius: 4px;
  right: 10%;
  bottom: 95px;
  z-index: 2;
}

.drawer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 6px;
  background: #5a6578;
  border-radius: 2px;
}

.drawer.open {
  transform: translateY(0) translateX(12px);
}

.drawer.open::before {
  content: '';
  position: absolute;
  top: -18px;
  left: -6px;
  width: 55px;
  height: 22px;
  background: #2d3748;
  border: 2px solid #4a5568;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.drawer.closed {
  transform: translateY(0);
}

/* Bookkeeper question bubble positions */
.question-bubble.q-laptop {
  left: 50%;
  top: 20px;
  transform: translateX(-50%) translateY(8px);
}

.question-bubble.q-laptop.visible {
  transform: translateX(-50%) translateY(0);
}

.question-bubble.q-sticky {
  right: 8%;
  top: 10px;
  transform: translateY(8px);
}

.question-bubble.q-sticky::after {
  left: 70%;
}

.question-bubble.q-phone {
  left: 8%;
  top: 50px;
  transform: translateY(8px);
}

.question-bubble.q-phone::after {
  left: 30%;
}

.question-bubble.q-drawer {
  right: 5%;
  top: 85px;
  transform: translateY(8px);
}

.question-bubble.q-drawer::after {
  left: 60%;
}

/* Audit Log Hero (State 2) */
.audit-log-hero {
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) translateY(15px);
  width: 220px;
  background: var(--surface2);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 0 35px rgba(102, 187, 106, 0.2);
  z-index: 15;
}

.audit-log-hero.visible {
  transform: translate(-50%, -50%) translateY(0);
}

.audit-hero-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.audit-hero-icon {
  width: 22px;
  height: 22px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #0f1114;
  font-weight: 700;
}

.audit-hero-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-hero-item {
  font-size: 0.7rem;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
}

.audit-hero-item.checked::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 600;
  font-size: 0.65rem;
}

.audit-hero-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.audit-timestamp {
  font-size: 0.6rem;
  color: var(--muted);
}

.audit-duration {
  font-size: 0.6rem;
  color: var(--success);
  font-weight: 500;
}

/* Secured Note */
.secured-note {
  right: 4%;
  top: 85px;
  text-align: center;
  background: rgba(102, 187, 106, 0.1);
  border: 1px dashed rgba(102, 187, 106, 0.4);
  border-radius: 6px;
  padding: 10px 14px;
  z-index: 3;
}

.secured-icon {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.secured-text {
  font-size: 0.6rem;
  color: var(--success);
  line-height: 1.4;
  font-weight: 500;
}

/* Clean desk label */
.clean-desk-label {
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(102, 187, 106, 0.12);
  border: 1px solid rgba(102, 187, 106, 0.25);
  padding: 8px 18px;
  border-radius: 16px;
  z-index: 20;
}

/* ============================================
   PHONE SCENE (Device Stolen)
   ============================================ */
.phone-scene {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
  min-height: 280px;
}

/* Data Lists */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-list.right {
  align-items: flex-end;
}

.data-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  position: relative;
}

.data-list.right .data-item {
  flex-direction: row-reverse;
}

.data-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.data-label {
  color: var(--ink);
}

.data-status {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.data-list.right .data-status {
  margin-left: 0;
  margin-right: auto;
}

/* Data item states */
.data-item.exposed {
  border-color: rgba(239, 83, 80, 0.4);
  background: rgba(239, 83, 80, 0.08);
}

.data-item.exposed .data-status {
  background: rgba(239, 83, 80, 0.2);
  color: var(--danger);
}

.data-item.wiped {
  border-color: var(--stroke);
  background: var(--surface);
  opacity: 0.5;
}

.data-item.wiped .data-status {
  background: rgba(102, 187, 106, 0.15);
  color: var(--success);
}

.data-item.wiped .data-icon {
  opacity: 0.4;
}

.data-item.protected {
  border-color: rgba(102, 187, 106, 0.4);
  background: rgba(102, 187, 106, 0.08);
}

.data-item.protected .data-status {
  background: rgba(102, 187, 106, 0.2);
  color: var(--success);
}

/* Phone (stolen device) */
.phone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.phone-question {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--synavia);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10;
}

.phone-question::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--synavia);
}

.state-awareness .phone-question {
  opacity: 1;
  visibility: visible;
}

.phone {
  width: 90px;
  height: 180px;
  background: linear-gradient(145deg, #2d3340 0%, #1a1e24 100%);
  border: 3px solid #3d4450;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  position: relative;
  transform: rotate(8deg);
}

.phone-screen {
  position: absolute;
  top: 12px;
  left: 7px;
  right: 7px;
  bottom: 12px;
  background: #0a0c0f;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Crack overlay */
.crack {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}

.crack::before {
  content: '';
  position: absolute;
  top: 18%;
  left: 20%;
  width: 60%;
  height: 2px;
  background: rgba(255,255,255,0.3);
  transform: rotate(-18deg);
  box-shadow:
    -10px 5px 0 rgba(255,255,255,0.2),
    -18px 14px 0 rgba(255,255,255,0.12);
}

/* Screen States */
.screen-unlocked {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a237e 0%, #283593 100%);
  padding: 10px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;
}

.app-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
}

.app-icon.email { background: #ef5350; }
.app-icon.contacts { background: #42a5f5; }
.app-icon.photos { background: #66bb6a; }
.app-icon.messages { background: #26c6da; }
.app-icon.maps { background: #ffa726; }
.app-icon.files { background: #ab47bc; }

.screen-wiped {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wipe-indicator {
  text-align: center;
}

.wipe-icon {
  width: 32px;
  height: 32px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-size: 1rem;
  color: white;
}

.wipe-text {
  font-size: 0.5rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Phone Status Label */
.phone-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 6px;
}

.phone-status.exposed {
  background: rgba(239, 83, 80, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.phone-status.contained {
  background: rgba(102, 187, 106, 0.15);
  color: var(--success);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

/* Phone verification */
.phone-verification {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--success);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.phone-verification::before {
  content: '✓';
  display: inline-block;
}

.state-applied .phone-verification {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   BEC SCENE (Email/Payment Fraud)
   ============================================ */
.bec-scene {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Email Container */
.email-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.email {
  width: 100%;
  max-width: 400px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.email.compromised {
  border-color: rgba(239, 83, 80, 0.5);
}

.email.blocked {
  border-color: rgba(102, 187, 106, 0.5);
  opacity: 0.6;
}

.email-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.email-from {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-avatar {
  width: 32px;
  height: 32px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.email-sender {
  font-size: 0.85rem;
  color: var(--ink);
}

.email-address {
  font-size: 0.7rem;
  color: var(--muted);
  position: relative;
}

.email-address.spoofed {
  color: var(--danger);
}

.email-flag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 4px;
}

.email-flag.none {
  display: none;
}

.email-flag.blocked {
  background: rgba(102, 187, 106, 0.2);
  color: var(--success);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.email-body {
  padding: 16px;
  position: relative;
}

.email-subject {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.email-content {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.email-content .highlight {
  color: var(--ink);
  background: rgba(239, 83, 80, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  position: relative;
}

/* BEC question positions */
.q-domain {
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
}

.q-banking {
  right: -120px;
  top: 50%;
  transform: translateY(-50%);
}

.q-verify {
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
}

/* Journey Steps */
.journey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.journey-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  min-width: 100px;
  transition: all 0.3s ease;
}

.journey-step .step-icon {
  font-size: 1.4rem;
}

.journey-step .step-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.journey-arrow {
  font-size: 1.2rem;
  color: var(--muted);
}

/* Step states */
.journey-step.danger {
  border-color: rgba(239, 83, 80, 0.4);
  background: rgba(239, 83, 80, 0.08);
}

.journey-step.danger .step-icon {
  color: var(--danger);
}

.journey-step.success {
  border-color: rgba(102, 187, 106, 0.4);
  background: rgba(102, 187, 106, 0.08);
}

.journey-step.success .step-icon {
  color: var(--success);
}

.journey-step.neutral {
  opacity: 0.4;
}

/* Outcome Box */
.outcome {
  display: flex;
  justify-content: center;
}

.outcome-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.outcome-box.danger {
  border-color: rgba(239, 83, 80, 0.4);
  background: rgba(239, 83, 80, 0.08);
}

.outcome-box.success {
  border-color: rgba(102, 187, 106, 0.4);
  background: rgba(102, 187, 106, 0.08);
}

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

.outcome-text {
  font-size: 0.85rem;
  color: var(--ink);
}

.outcome-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================
   LOGIN SCENE (Suspicious Login)
   ============================================ */
.login-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 260px;
  position: relative;
}

/* Attacker Side */
.attacker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.attacker-icon {
  width: 70px;
  height: 70px;
  background: var(--surface2);
  border: 2px solid var(--stroke);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: all 0.3s ease;
}

.attacker-icon.danger {
  border-color: rgba(239, 83, 80, 0.5);
  background: rgba(239, 83, 80, 0.1);
}

.attacker-icon.blocked {
  border-color: var(--stroke);
  opacity: 0.4;
}

.attacker-info {
  text-align: center;
}

.attacker-location {
  font-size: 0.75rem;
  color: var(--muted);
}

.attacker-time {
  font-size: 0.7rem;
  color: var(--danger);
  margin-top: 2px;
}

/* Connection Lines */
.connections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.connection-line {
  width: 60px;
  height: 2px;
  background: var(--danger);
  position: relative;
  transition: all 0.3s ease;
}

.connection-line::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 6px solid var(--danger);
}

.connection-line.blocked {
  background: var(--stroke);
  opacity: 0.3;
}

.connection-line.blocked::after {
  border-left-color: var(--stroke);
}

.single-connection {
  width: 80px;
  height: 3px;
  background: var(--success);
}

.single-connection::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  border: 6px solid transparent;
  border-left: 8px solid var(--success);
}

/* Multiple Doors */
.doors-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.door-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.door {
  width: 40px;
  height: 60px;
  background: var(--surface2);
  border: 2px solid var(--stroke);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: all 0.3s ease;
}

.door::before {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
}

.door.open {
  transform: perspective(150px) rotateY(-20deg);
  border-color: var(--danger);
}

.door.open::before {
  background: var(--danger);
}

.door-label {
  font-size: 0.65rem;
  color: var(--muted);
}

/* Single Identity Door */
.identity-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.big-door {
  width: 70px;
  height: 100px;
  background: var(--surface2);
  border: 3px solid var(--success);
  border-radius: 4px 4px 0 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-door::before {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.big-door .door-icon {
  font-size: 1.5rem;
}

.identity-label {
  font-size: 0.7rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.identity-sublabel {
  font-size: 0.6rem;
  color: var(--muted);
}

/* Resources behind door */
.resources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  position: relative;
}

.resources.exposed {
  border-color: rgba(239, 83, 80, 0.3);
}

.resources.protected {
  border-color: rgba(102, 187, 106, 0.3);
}

.resource-item {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.resource-icon {
  font-size: 0.9rem;
}

/* Alert indicator */
.alert-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--success);
  color: white;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.state-applied .alert-indicator {
  opacity: 1;
  visibility: visible;
}

/* Hide elements based on state */
.multi-doors { display: flex; }
.single-door { display: none; }

.state-applied .multi-doors { display: none; }
.state-applied .single-door { display: flex; }

.state-applied .connections { display: none; }
.state-applied .single-connection-wrap { display: flex; }
.single-connection-wrap { display: none; align-items: center; }

/* ============================================
   ROLES SCENE (Access Chaos)
   ============================================ */
.access-scene {
  position: relative;
  min-height: 300px;
}

/* SVG for connection lines */
.connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.svg-connection-line {
  stroke: var(--danger);
  stroke-width: 2;
  fill: none;
  opacity: 0.6;
}

.svg-connection-line.warning {
  stroke: var(--warning);
  stroke-dasharray: 4 4;
}

.svg-connection-line.clean {
  stroke: var(--success);
  opacity: 0.8;
}

/* Layout */
.access-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

/* People Column */
.people-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 140px;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  position: relative;
  transition: all 0.3s ease;
}

.person-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--surface);
}

.person-info {
  display: flex;
  flex-direction: column;
}

.person-name {
  font-size: 0.75rem;
  color: var(--ink);
}

.person-role {
  font-size: 0.6rem;
  color: var(--muted);
}

.person.problem {
  border-color: rgba(239, 83, 80, 0.4);
}

.person.missing {
  border-color: rgba(255, 183, 77, 0.4);
}

/* Systems Column */
.systems-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 120px;
}

.system {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.system-icon {
  font-size: 1.1rem;
}

.system-name {
  font-size: 0.7rem;
  color: var(--ink);
}

.system.exposed {
  border-color: rgba(239, 83, 80, 0.4);
  background: rgba(239, 83, 80, 0.05);
}

.system.blocked {
  border-color: rgba(255, 183, 77, 0.4);
  opacity: 0.6;
}

/* Roles question positions */
.q-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.q-center::after {
  display: none;
}

.q-top-left {
  top: -8px;
  left: 150px;
}

.q-top-right {
  top: -8px;
  right: 130px;
}

/* Roles View (Applied State) */
.roles-view {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.state-applied .messy-view { display: none; }
.state-applied .roles-view { display: flex; }

.role-group {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid rgba(102, 187, 106, 0.3);
  border-radius: 10px;
}

.role-badge {
  padding: 6px 12px;
  background: rgba(102, 187, 106, 0.15);
  border: 1px solid rgba(102, 187, 106, 0.3);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

.role-arrow {
  color: var(--muted);
  font-size: 1.2rem;
}

.role-access {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.access-tag {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-people {
  margin-left: auto;
  display: flex;
  gap: -8px;
}

.role-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-left: -8px;
}

.role-avatar:first-child {
  margin-left: 0;
}

/* Roles verification badge */
.roles-verification {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  color: var(--success);
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.state-applied .roles-verification {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   CONDITIONAL SCENE (MFA Gaps / Wall)
   ============================================ */
.wall-scene {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

/* Wall Attacker */
.wall-attacker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wall-attacker-icon {
  font-size: 2.5rem;
}

.wall-attacker-label {
  font-size: 0.65rem;
  color: var(--muted);
}

/* The Wall */
.wall {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.wall-section {
  display: flex;
  align-items: center;
  height: 50px;
  position: relative;
}

/* Gate (protected path) */
.gate {
  width: 100px;
  height: 100%;
  background: var(--surface2);
  border: 2px solid var(--success);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.6rem;
  color: var(--success);
  position: relative;
}

.gate-icon {
  font-size: 1rem;
}

.gate-label {
  font-size: 0.55rem;
  color: var(--muted);
}

/* Hole (unprotected path) */
.hole {
  width: 100px;
  height: 100%;
  background: transparent;
  border: 2px dashed rgba(239, 83, 80, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hole-label {
  font-size: 0.55rem;
  color: var(--danger);
  text-align: center;
  padding: 4px;
}

/* Attacker path through hole */
.breach-arrow {
  position: absolute;
  left: -30px;
  width: 25px;
  height: 2px;
  background: var(--danger);
}

.breach-arrow::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 6px solid var(--danger);
}

/* Target */
.target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.target-icon {
  width: 70px;
  height: 70px;
  background: var(--surface2);
  border: 2px solid var(--stroke);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all 0.3s ease;
}

.target-icon.breached {
  border-color: rgba(239, 83, 80, 0.5);
  background: rgba(239, 83, 80, 0.1);
}

.target-icon.protected {
  border-color: rgba(102, 187, 106, 0.4);
}

.target-label {
  font-size: 0.65rem;
  color: var(--muted);
}

/* Applied State - Complete Wall */
.complete-wall {
  display: none;
  flex-direction: column;
  gap: 0;
}

.state-applied .partial-wall { display: none; }
.state-applied .complete-wall { display: flex; }
.state-applied .breach-arrow { display: none; }
.state-applied .wall-attacker-icon { opacity: 0.4; }

.complete-gate {
  width: 100px;
  height: 45px;
  background: rgba(102, 187, 106, 0.1);
  border: 2px solid var(--success);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.complete-gate-icon {
  font-size: 0.9rem;
}

.complete-gate-label {
  font-size: 0.5rem;
  color: var(--success);
}

/* Wall Verification */
.wall-verification {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  color: var(--success);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.state-applied .wall-verification {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   LIGHT THEME - SECURITY SCENARIOS
   ============================================ */
:root[data-theme="light"] .desk {
  background: linear-gradient(180deg, #e8eaed 0%, #d1d5dc 100%);
}

:root[data-theme="light"] .desk::after {
  background: linear-gradient(180deg, #c9cdd4 0%, #b8bcc5 100%);
  border-top-color: #a0a5af;
}

:root[data-theme="light"] .laptop-screen {
  background: #f5f7fa;
  border-color: #9ca3af;
}

:root[data-theme="light"] .laptop-screen.active {
  background: #d1fae5;
}

:root[data-theme="light"] .laptop-screen.off {
  background: #e5e7eb;
  border-color: #9ca3af;
}

:root[data-theme="light"] .laptop-base {
  background: linear-gradient(180deg, #9ca3af, #6b7280);
}

:root[data-theme="light"] .phone-small {
  background: #f5f7fa;
  border-color: #9ca3af;
}

:root[data-theme="light"] .phone-screen-small {
  background: #e5e7eb;
}

:root[data-theme="light"] .drawer {
  background: #d1d5dc;
  border-color: #9ca3af;
}

:root[data-theme="light"] .drawer::after {
  background: #9ca3af;
}

:root[data-theme="light"] .audit-log-hero {
  background: var(--surface);
  border-color: var(--success);
}

:root[data-theme="light"] .secured-note {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

/* ============================================
   RESPONSIVE - SECURITY SCENARIOS
   ============================================ */
@media (max-width: 768px) {
  .scenario-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .stages {
    flex-direction: column;
  }

  .stage {
    min-width: 100%;
  }

  .phone-scene {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px;
  }

  .data-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .data-list.right {
    align-items: center;
  }

  .data-list.right .data-item {
    flex-direction: row;
  }

  .data-list.right .data-status {
    margin-left: auto;
    margin-right: 0;
  }

  .phone-wrapper {
    order: -1;
  }

  .phone {
    transform: rotate(0deg);
  }

  .login-scene {
    flex-direction: column;
    gap: 20px;
  }

  .connections {
    transform: rotate(90deg);
  }

  .door-row {
    flex-direction: row-reverse;
  }

  .access-layout {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }

  .people-column, .systems-column {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .connections-svg {
    display: none;
  }

  .role-group {
    flex-direction: column;
    text-align: center;
  }

  .role-people {
    margin-left: 0;
    margin-top: 8px;
  }

  .wall-scene {
    flex-direction: column;
    gap: 24px;
  }

  .wall {
    transform: rotate(90deg);
  }

  .journey {
    flex-wrap: wrap;
  }

  .journey-step {
    min-width: 80px;
    padding: 10px 12px;
  }

  .journey-arrow {
    display: none;
  }

  .email {
    max-width: 100%;
  }

  .q-banking {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: -28px;
  }

  .desk {
    height: 260px;
  }

  .laptop {
    width: 140px;
  }

  .laptop-screen {
    width: 140px;
    height: 85px;
  }

  .laptop-base {
    width: 160px;
  }

  .sticky-note {
    width: 70px;
    height: 70px;
    right: 8%;
  }

  .secured-note {
    right: 2%;
    top: 75px;
    padding: 8px 10px;
  }

  .phone-small {
    left: 8%;
  }

  .drawer {
    right: 5%;
  }

  .question-bubble {
    font-size: 0.5rem;
    padding: 3px 6px;
  }

  .audit-log-hero {
    width: 180px;
    padding: 14px;
  }
}

/* Lens Tooltip */
.lens-panel {
  position: fixed;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 32px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 100;
  pointer-events: none;
}

.lens-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lens-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
}

.lens-panel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.lens-panel-title {
  font-size: 14px;
  font-weight: 600;
}

.lens-panel-content {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.lens-panel-content strong { color: var(--ink); }

/* Stepper */
.stepper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--stroke);
  padding: 14px 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 50;
}

.stepper-btn {
  background: var(--surface2);
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--surface3);
}

.stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.step-indicators {
  display: flex;
  gap: 6px;
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.step-indicator:hover {
  background: var(--surface3);
  border-color: var(--muted);
}

.step-indicator.active {
  background: var(--visibility);
  border-color: var(--visibility);
  color: white;
}

.step-indicator.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-indicator.prequel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.step-indicator.prequel.active {
  background: var(--trust);
  border-color: var(--trust);
}

.step-indicator.prequel.completed {
  background: var(--trust);
  border-color: var(--trust);
  opacity: 0.7;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--stroke);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--surface3);
  transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* Show moon in dark mode (click to go light) */
:root:not([data-theme="light"]) .theme-toggle .icon-moon {
  display: block;
}

/* Show sun in light mode (click to go dark) */
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

/* Auto-detect: show moon in dark, sun in light */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    display: none;
  }
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: block;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-dashboard-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--visibility);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s, transform 0.1s;
}

.live-dashboard-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.live-dashboard-btn:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1200px) {
  .summary-row { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .workflow-stats { grid-template-columns: repeat(3, 1fr); }
  .workflow-issues { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .control-bar { flex-direction: column; gap: 12px; }
  .main { padding: 16px; }
  .summary-row { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .lens-panel { left: 16px; right: 16px; width: auto; }
}
