/* ═══════════════════════════════════════════════════════
   Wopee Live Cockpit V3 — Stylesheet
   Organized in clearly separated sections.
   ═══════════════════════════════════════════════════════ */

/* ─── Design tokens ─────────────────────────────────── */
:root {
  --bg: #0a0612;
  --bg-grid: rgba(255, 255, 255, 0.02);
  --surface: #14101e;
  --surface-elevated: #1d172b;
  --surface-deep: #0f0a18;
  --border: #2a2240;
  --border-soft: #1f1932;
  --text: #f5f3ff;
  --text-muted: #a8a3b8;
  --text-dim: #6b6878;
  --brand: #FFD60A;
  --execution: #FF8C42;
  --info: #4f9fff;
  --success: #4ade80;
  --error: #f87171;
  --neutral: #6b7280;
  --brand-glow: rgba(255, 214, 10, 0.35);
  --execution-glow: rgba(255, 140, 66, 0.35);
  --info-glow: rgba(79, 159, 255, 0.35);
  --success-glow: rgba(74, 222, 128, 0.35);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  font-size: 14px;
  line-height: 1.4;
}
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* ─── Topbar ─────────────────────────────────────────── */
.topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 6, 18, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.session-info {
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.session-info .url {
  color: var(--text);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
}
.analysis-id {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text-muted);
}
.btn-icon {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ─── Cockpit 3-column grid ──────────────────────────── */
.cockpit {
  display: grid;
  grid-template-columns: 320px minmax(0, 960px) 320px;
  justify-content: center;
  height: calc(100vh - 56px);
  position: relative;
}
.left-zone, .right-zone {
  width: 320px;
  height: 100%;
  position: relative;
}
.center-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 20px 12px 16px;
  position: relative;
}
.right-zone-placeholder {
  padding: 20px 12px;
  color: var(--text-dim);
  font-size: 10px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

/* ─── Sidebar (left) ─────────────────────────────────── */
.sidebar {
  height: 100%;
  background: var(--surface-deep);
  border-right: 1px solid var(--border-soft);
  overflow-y: auto;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  pointer-events: none;
}
.sidebar.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.sidebar-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}
.section-label {
  padding: 14px 18px 6px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label .count {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.scenario-card {
  margin: 4px 12px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.scenario-card:hover {
  border-color: var(--text-dim);
  transform: translateX(2px);
}
.scenario-card.materialize {
  animation: card-materialize 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes card-materialize {
  0% { opacity: 0; transform: translateY(-6px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.scenario-card.selected {
  border-color: var(--brand);
  background: linear-gradient(90deg, rgba(255, 214, 10, 0.08), var(--surface));
  box-shadow: 0 0 0 1px var(--brand), -3px 0 0 0 var(--brand);
}
.scenario-card.running {
  border-color: var(--execution);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.08), var(--surface));
}
.scenario-card.running.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), -3px 0 0 0 var(--brand);
}
.scenario-card.queued { opacity: 0.92; }
.scenario-card.passed { border-color: rgba(74, 222, 128, 0.35); }
.scenario-card.failed { border-color: rgba(248, 113, 113, 0.35); }
.scenario-card.interactive.running {
  border-color: var(--info);
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.1), var(--surface));
}
.scenario-card.interactive.passed {
  border-color: rgba(79, 159, 255, 0.3);
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.05), var(--surface));
}
.scenario-card.interactive.running.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), -3px 0 0 0 var(--brand);
}
.scenario-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.scenario-flow {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
  padding-left: 17px;
}
.scenario-status {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 17px;
}
.scenario-progress {
  height: 3px;
  background: var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 0 17px;
}
.scenario-progress-fill {
  height: 100%;
  background: var(--execution);
  transition: width 0.6s ease;
}

.ico {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ico.running {
  background: var(--execution);
  animation: dot-pulse 1.2s infinite ease-out;
  color: var(--execution);
}
.ico.queued { background: var(--text-dim); }
.ico.passed { background: var(--success); }
.ico.failed { background: var(--error); }
.scenario-card.interactive.running .ico {
  background: var(--info);
  color: var(--info);
}

.scenario-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(79, 159, 255, 0.14);
  color: var(--info);
  border: 1px solid rgba(79, 159, 255, 0.3);
  margin-left: 6px;
}

@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 0.6; }
  50% { box-shadow: 0 0 0 6px transparent; opacity: 1; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 0.6; }
}

/* ─── Status shell (unified header — adapts to selected item) ── */
.status-shell {
  width: 100%;
  position: relative;
  flex-shrink: 0;
}
.status-bar {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.35s ease, border-color 0.35s ease;
  width: 100%;
}
/* Brand state — hard checkpoint or voluntary user control */
.status-bar.brand-state {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.1), rgba(255, 214, 10, 0.02));
  border-color: rgba(255, 214, 10, 0.4);
}
/* Scenario state tints — match sidebar card colors */
.status-bar.scenario-running {
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.1), rgba(255, 140, 66, 0.02));
  border-color: rgba(255, 140, 66, 0.4);
}
.status-bar.scenario-passed {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), rgba(74, 222, 128, 0.02));
  border-color: rgba(74, 222, 128, 0.4);
}
.status-bar.scenario-failed {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.08), rgba(248, 113, 113, 0.02));
  border-color: rgba(248, 113, 113, 0.4);
}
.status-bar.scenario-running .status-text .main,
.status-bar.scenario-passed .status-text .main,
.status-bar.scenario-failed .status-text .main,
.status-bar.scenario-queued .status-text .main {
  color: var(--text);
  font-weight: 600;
}
.status-bar.brand-state .status-text .main {
  color: var(--brand);
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.blue { background: var(--info); animation: dot-pulse 1.5s infinite ease-out; }
.status-dot.orange { background: var(--execution); animation: dot-pulse 1.2s infinite ease-out; }
.status-dot.brand { background: var(--brand); animation: dot-pulse 1.4s infinite ease-out; }
.status-dot.brand-steady { background: var(--brand); }
.status-dot.green { background: var(--success); }
.status-dot.grey { background: var(--neutral); }
.status-dot.red { background: var(--error); }
.status-dot.text-dim { background: var(--text-dim); }

.status-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px 0;
  border-radius: 6px;
  transition: background 0.15s;
  min-width: 0;
}
.status-trigger:hover { background: var(--surface-elevated); }
.status-text { flex: 1; min-width: 0; }
.status-text .main {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-text .sub {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-chevron {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.status-trigger.open .status-chevron { transform: rotate(180deg); color: var(--text); }

.takeover-pill {
  background: var(--brand);
  color: #0a0612;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: none;
  flex-shrink: 0;
}
.status-bar.brand-state .takeover-pill { display: inline-flex; }

.header-kebab {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  flex-shrink: 0;
}
.header-kebab:hover { background: var(--surface-elevated); color: var(--text); }

/* Header action buttons (Run / Schedule next to kebab) */
.header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-action-sm {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-action-sm:hover {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--text-dim);
}
.btn-action-sm.primary {
  background: var(--brand);
  color: #0a0612;
  border-color: var(--brand);
  font-weight: 700;
}
.btn-action-sm.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-glow);
  background: var(--brand);
  color: #0a0612;
}

/* In scenario mode, no activity log expand */
.status-bar.no-log .status-chevron { display: none; }
.status-bar.no-log .status-trigger { cursor: default; }
.status-bar.no-log .status-trigger:hover { background: transparent; }

/* ─── Activity log dropdown ──────────────────────────── */
.activity-log {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 10px 10px;
  z-index: 10;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  pointer-events: none;
}
.activity-log.open {
  max-height: 340px;
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.log-header {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: 12px 16px 6px;
  font-weight: 700;
}
.log-entry {
  padding: 7px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  border-top: 1px solid var(--border-soft);
}
.log-entry:first-of-type { border-top: none; }
.log-time {
  color: var(--text-dim);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 11px;
  flex-shrink: 0;
  width: 60px;
}
.log-text { color: var(--text); flex: 1; line-height: 1.5; }
.log-status { flex-shrink: 0; font-size: 11px; width: 14px; text-align: center; }
.log-entry.active .log-text { font-weight: 500; }
.log-entry.active .log-status { color: var(--info); animation: dot-pulse 1.4s infinite; }
.log-entry.done .log-text { color: var(--text-muted); }
.log-entry.done .log-status { color: var(--success); opacity: 0.6; }
.log-entry.upcoming { opacity: 0.45; }
.log-entry.upcoming .log-text { font-style: italic; color: var(--text-muted); }
.log-entry.upcoming .log-status,
.log-entry.upcoming .log-time { color: var(--text-dim); }

/* ─── Detail view ────────────────────────────────────── */
.detail-view {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
}
.detail-view.rim-blue {
  border-color: var(--info);
  animation: glow-blue 1.6s infinite ease-in-out;
}
.detail-view.rim-orange {
  border-color: var(--execution);
  animation: glow-orange 1.6s infinite ease-in-out;
}
.detail-view.rim-brand-steady {
  border-color: var(--brand);
  box-shadow: 0 0 24px var(--brand-glow);
}
.detail-view.rim-green {
  border-color: var(--success);
  box-shadow: 0 0 20px var(--success-glow);
}
/* Scenario mode: detail view has neutral rim (state is in unified header) */
.detail-view.detail-mode-scenario {
  border-color: var(--border) !important;
  animation: none !important;
  box-shadow: none !important;
}
@keyframes glow-blue {
  0%, 100% { box-shadow: 0 0 16px rgba(79, 159, 255, 0.2); }
  50% { box-shadow: 0 0 32px rgba(79, 159, 255, 0.5); }
}
@keyframes glow-orange {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 140, 66, 0.2); }
  50% { box-shadow: 0 0 32px rgba(255, 140, 66, 0.45); }
}

.detail-mode-live { background: #fff; }
.detail-mode-live .browser-content { width: 100%; height: 100%; overflow: hidden; }
.detail-mode-scenario {
  background: var(--surface-deep);
  display: flex;
  flex-direction: column;
}

/* ─── Top tabs (Plan + Runs) ────────────────────────── */
.top-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface-deep);
  overflow-x: auto;
}
.top-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 11px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: color 0.15s;
  white-space: nowrap;
}
.top-tab:hover { color: var(--text); }
.top-tab.active { color: var(--text); }
.top-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
}
.top-tab.tab-failed.active::after { background: var(--error); }
.top-tab.tab-passed.active::after { background: var(--success); }
.top-tab.tab-live.active::after { background: var(--execution); }

/* Live tab dot — ORANGE (running scenario), not blue */
.live-dot {
  color: var(--execution);
  animation: dot-pulse 1.2s infinite ease-out;
  display: inline-block;
  margin-right: 4px;
}

.tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}
.tab-content.no-padding { padding: 0; }

/* ─── Run meta strip (sticky inside run tabs) ──────── */
.run-meta-strip {
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}
.run-meta-strip strong { color: var(--text); }
.run-meta-strip .meta-sep { color: var(--text-dim); }
/* Live meta strip — orange tint (matches running scenario) */
.run-meta-strip.live-strip {
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.1), var(--surface));
  border-color: rgba(255, 140, 66, 0.3);
}
.live-pulse {
  color: var(--execution);
  animation: dot-pulse 1.2s infinite ease-out;
  display: inline-block;
}
.run-status-passed { color: var(--success); font-weight: 600; }
.run-status-failed { color: var(--error); font-weight: 600; }

/* ─── Plan tab content ───────────────────────────────── */
.plan-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.plan-edit-btn {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.plan-edit-btn:hover {
  background: rgba(255, 214, 10, 0.1);
  box-shadow: 0 2px 8px var(--brand-glow);
}
.plan-section { margin-bottom: 22px; }
.plan-section-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 6px;
}
.plan-value {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.plan-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.15);
}
textarea.plan-input { resize: vertical; min-height: 56px; }

.planned-steps { list-style: none; }
.planned-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  margin-bottom: 6px;
}
.planned-step-num {
  width: 24px;
  height: 24px;
  background: var(--surface-elevated);
  color: var(--text-muted);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.planned-step-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.planned-step-icon {
  flex-shrink: 0;
  color: var(--brand);
  font-size: 13px;
  width: 16px;
  text-align: center;
}
.planned-step-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planned-step-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.planned-step.editing {
  display: grid;
  grid-template-columns: 28px auto 1fr auto;
  gap: 8px;
  padding: 8px 10px;
}
.planned-step.editing select,
.planned-step.editing input {
  background: var(--surface-deep);
  border: 1px solid var(--border-soft);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
}
.planned-step.editing input:focus,
.planned-step.editing select:focus {
  outline: none;
  border-color: var(--brand);
}
.planned-step.editing input { width: 100%; }
.planned-step-delete {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
}
.planned-step-delete:hover {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
}
.add-step-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
  margin-top: 6px;
  transition: all 0.15s;
}
.add-step-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* ─── Run tab content ────────────────────────────────── */
.run-sections { padding: 0; }
.run-section { border-bottom: 1px solid var(--border-soft); }
.run-section:last-child { border-bottom: none; }
.run-section-header {
  padding: 16px 20px 8px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.run-section-header.primary {
  color: var(--text-muted);
  font-size: 12px;
  padding: 18px 20px 4px;
}

/* Test Report — primary section (top of run tab) */
.report-content {
  padding: 6px 24px 24px;
  line-height: 1.6;
}
.report-content h4 {
  font-size: 13px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.report-content h4:first-child { margin-top: 0; }
.report-content ul {
  list-style: none;
  margin-bottom: 8px;
}
.report-content li {
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
}
.report-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
.report-content p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.report-content strong { color: var(--text); }
.report-content code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--error);
}
.report-status-passed {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  display: inline-block;
  margin-left: 6px;
}
.report-status-failed {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--error);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  display: inline-block;
  margin-left: 6px;
}

/* Combined run meta bar (info + quick-jump pills in ONE row) */
.run-meta-bar {
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.run-meta-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.run-meta-info strong { color: var(--text); }
.run-meta-info .meta-sep { color: var(--text-dim); }

/* Quick-jump pills (now inline in run-meta-bar) */
.run-quickjump {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.quickjump-pill {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s;
}
.quickjump-pill:hover {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--text-dim);
}

/* Scroll-spy active state: subtle filled background per category color */
.quickjump-pill.active {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--text-dim);
}
.quickjump-pill.passed {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.4);
}
.quickjump-pill.passed.active {
  background: rgba(74, 222, 128, 0.16);
  color: var(--success);
  border-color: var(--success);
}
.quickjump-pill.failed {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.4);
}
.quickjump-pill.failed.active {
  background: rgba(248, 113, 113, 0.16);
  color: var(--error);
  border-color: var(--error);
}
.quickjump-pill.passed:hover,
.quickjump-pill.failed:hover {
  filter: brightness(1.15);
}

/* Full-width steps in run tab (separate section, not side-by-side) */
.full-steps {
  list-style: none;
  padding: 10px 20px 20px;
}
.full-step {
  display: grid;
  grid-template-columns: 96px 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.full-step:hover { background: var(--surface); }
.full-step:last-child { border-bottom: none; }
.full-step-thumb {
  width: 88px;
  height: 56px;
  background: linear-gradient(135deg, #e0e0eb, #c8c8d6);
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.full-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.full-step-num.passed { background: var(--success); color: #0a0612; }
.full-step-num.failed { background: var(--error); color: white; }
.full-step-info { min-width: 0; }
.full-step-name {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.full-step-action { font-size: 11px; color: var(--text-muted); }
.full-step-duration {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'SF Mono', Monaco, monospace;
  flex-shrink: 0;
}

/* Recording section — full-width video */
.recording-wrap {
  padding: 8px 20px 24px;
  position: relative;
}
.recording-video {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  min-height: 380px;
  border: 1px solid var(--border-soft);
}

/* Tab overflow dropdown */
.tab-overflow-wrapper {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.tab-overflow-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 11px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
}
.tab-overflow-btn:hover { color: var(--text); background: var(--surface-elevated); }
.tab-overflow-menu {
  position: fixed;             /* escapes .detail-view overflow:hidden clipping */
  top: 0;
  right: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 240px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
  overflow: hidden;
}
.tab-overflow-menu.open { display: block; }
.tab-overflow-item {
  padding: 9px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.tab-overflow-item:last-child { border-bottom: none; }
.tab-overflow-item:hover { background: var(--surface); }
.tab-overflow-item .item-icon { font-size: 11px; }
.tab-overflow-item.item-passed .item-icon { color: var(--success); }
.tab-overflow-item.item-failed .item-icon { color: var(--error); }

/* Live stream content (simple full-bleed) */
.live-stream-content {
  background: #fff;
  overflow: hidden;
}
.live-stream-content > * { width: 100%; height: 100%; }

/* Video replay controls */
.video-replay-controls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: rgba(20, 16, 30, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
}
.play-btn {
  background: var(--brand);
  color: #0a0612;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scrubber-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}
.scrubber-fill {
  height: 100%;
  width: 35%;
  background: var(--brand);
  border-radius: 2px;
}
.scrubber-thumb {
  position: absolute;
  left: 35%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.3);
}
.scrubber-time {
  color: var(--text);
  font-size: 11px;
  font-family: 'SF Mono', Monaco, monospace;
  flex-shrink: 0;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── Bottom action bar ─────────────────────────────── */
.bottom-strip {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-shrink: 0;
  transition: background 0.35s;
}
.bottom-strip.brand-state {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.1), rgba(255, 214, 10, 0.02));
  border-color: rgba(255, 214, 10, 0.4);
}
.bottom-strip.edit-state {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.08), rgba(255, 214, 10, 0.02));
  border-color: rgba(255, 214, 10, 0.3);
}
.strip-context {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  min-width: 0;
}
.strip-context .strip-icon { font-size: 16px; }
.strip-context .strip-title { color: var(--text); font-weight: 500; }
.strip-context .strip-divider { color: var(--text-dim); }

.user-message-input {
  flex: 1;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  min-width: 0;
}
.user-message-input::placeholder { color: var(--text-dim); }
.user-message-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.15);
}

.strip-button-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
}
.btn-action:hover {
  border-color: var(--text-dim);
  color: var(--text);
  background: var(--surface-elevated);
}
.btn-action.primary {
  background: var(--brand);
  color: #0a0612;
  border-color: var(--brand);
  font-weight: 700;
}
.btn-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--brand-glow);
  background: var(--brand);
  color: #0a0612;
}
.btn-action.secondary { background: transparent; }

/* ─── Question overlay (slide-up) ────────────────────── */
.question-overlay {
  position: absolute;
  bottom: 16px;
  left: 28px;
  right: 28px;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 12px;
  box-shadow:
    0 -16px 40px rgba(0, 0, 0, 0.5),
    0 0 0 6px rgba(255, 214, 10, 0.05),
    0 0 32px rgba(255, 214, 10, 0.18);
  max-height: 420px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: max-height 0.4s, opacity 0.3s, transform 0.4s;
  z-index: 6;
  pointer-events: none;
}
.question-overlay.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.question-overlay.minimized { max-height: 48px; }
.overlay-inner { padding: 20px 22px 14px; }
.overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.overlay-titles { flex: 1; }
.question-prompt { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.question-title { font-size: 17px; color: var(--text); font-weight: 500; }
.overlay-minimize {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  font-family: inherit;
}
.overlay-minimize:hover { background: var(--surface-elevated); color: var(--text); }

.question-options { display: flex; flex-direction: column; margin: 0 -8px; }
.q-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 10px;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
}
.q-option:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--border-soft);
}
.q-option:hover { background: rgba(255, 255, 255, 0.025); }
.q-option.highlighted { background: rgba(255, 214, 10, 0.07); }
.q-num {
  width: 30px;
  height: 30px;
  background: var(--surface-elevated);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}
.q-option.highlighted .q-num { background: rgba(255, 214, 10, 0.16); color: var(--brand); }
.q-label { flex: 1; font-size: 14px; color: var(--text); }
.q-rec-badge {
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 3px 9px;
  background: rgba(255, 214, 10, 0.1);
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 10, 0.25);
}
.q-shortcut { color: var(--text-muted); font-family: 'SF Mono', monospace; font-size: 14px; }
.q-skip {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.q-option.freetext .q-num { color: var(--text-dim); }
.q-option.freetext .q-label { color: var(--text-muted); }
.q-option.highlighted.freetext .q-label { color: var(--text); }
.question-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 11px;
}
.question-footer kbd {
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'SF Mono', monospace;
  margin: 0 2px;
}
.overlay-inner-minimized {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  height: 48px;
}
.mini-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
}
.mini-title { color: var(--text); font-weight: 500; }
.mini-divider { color: var(--text-dim); }
.mini-star { color: var(--brand); }
.overlay-expand-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
}
.overlay-expand-btn:hover { background: var(--surface-elevated); color: var(--text); }

/* ─── Slack offer card ──────────────────────────────── */
.slack-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--surface-elevated);
  border: 1px solid var(--brand);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}
.slack-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.slack-emoji { font-size: 26px; margin-bottom: 6px; }
.slack-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.slack-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.slack-actions { display: flex; gap: 8px; }
.slack-actions button {
  flex: 1;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-primary {
  background: var(--brand);
  color: #0a0612;
  font-weight: 700;
}

/* ─── Keyboard hint ─────────────────────────────────── */
.kbd-hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 16, 30, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.kbd-hint.visible { opacity: 1; }
.kbd-hint kbd {
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'SF Mono', monospace;
  color: var(--text);
  margin-right: 3px;
}
.kbd-hint .dim-dot { opacity: 0.4; }

/* ─── Demo content (Swag Labs mock) ─────────────────── */
.demo-header {
  background: #132A47;
  color: white;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.demo-logo { font-weight: 800; font-size: 16px; }
.demo-logo .labs { color: #FFD60A; }
.demo-products-wrap { height: 100%; overflow-y: auto; background: #f4f4f8; padding: 16px 22px; }
.demo-products-title { font-size: 16px; font-weight: 800; color: #132A47; margin-bottom: 12px; }
.demo-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.demo-product {
  background: white;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #eaeaef;
}
.demo-product-image {
  width: 100%;
  height: 70px;
  background: linear-gradient(135deg, #e0e0eb, #c8c8d6);
  border-radius: 6px;
  margin-bottom: 8px;
}
.demo-product h4 { font-size: 12px; color: #132A47; margin-bottom: 3px; }
.demo-product .price { font-weight: 800; color: #132A47; font-size: 13px; }

.browser-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  font-size: 14px;
  background: linear-gradient(135deg, #f4f4f8 0%, #e8e8f0 100%);
  gap: 14px;
}
.spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(180deg, #f8f8fc, #e8e8f0);
  padding: 20px;
}
.demo-login {
  width: 100%;
  max-width: 320px;
  background: white;
  padding: 28px 24px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.demo-login h2 { font-size: 22px; color: #132A47; font-weight: 800; margin-bottom: 18px; }
.demo-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5e8;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  background: #fafafc;
}
.demo-btn {
  width: 100%;
  padding: 11px;
  background: #132A47;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
