@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: oklch(0.97 0.015 80);
  --bg-strong: oklch(0.93 0.03 78);
  --panel: oklch(0.995 0.004 75 / 0.94);
  --panel-border: oklch(0.82 0.03 70 / 0.65);
  --text: oklch(0.24 0.03 52);
  --muted: oklch(0.48 0.03 65);
  --accent: oklch(0.58 0.14 40);
  --accent-deep: oklch(0.41 0.11 32);
  --olive: oklch(0.55 0.08 115);
  --danger: oklch(0.56 0.18 28);
  --warning: oklch(0.72 0.15 74);
  --highlight: oklch(0.76 0.16 70);
  --highlight-bg: oklch(0.96 0.04 85);
  --highlight-text: oklch(0.55 0.14 60);
  --node-session: oklch(0.55 0.16 250);
  --node-llm: oklch(0.58 0.2 300);
  --node-tool: oklch(0.65 0.18 145);
  --node-decision: oklch(0.68 0.18 60);
  --node-risk: oklch(0.58 0.22 25);
  --node-checkpoint: oklch(0.55 0.1 195);
  --node-default: oklch(0.55 0.03 260);
  --node-stroke: oklch(0.35 0.03 260);
  --node-selected: oklch(0.78 0.14 85);
  --link-stroke: oklch(0.5 0.03 260 / 0.6);
  --shadow: 0 24px 80px oklch(0.52 0.04 60 / 0.12);
  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  /* Animation timing */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-entrance: 400ms;
  /* Easing curves — natural deceleration, no bounce/elastic */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-material: cubic-bezier(0.4, 0, 0.2, 1);
  /* Border radius tokens */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  /* Shadow tokens */
  --shadow-sm: 0 1px 3px oklch(0.52 0.04 60 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.52 0.04 60 / 0.08);
  --shadow-lg: 0 24px 80px oklch(0.52 0.04 60 / 0.12);
  --shadow-hover: 0 8px 32px oklch(0.52 0.04 60 / 0.14);
}

* {
  box-sizing: border-box;
}

body {
  text-rendering: optimizeLegibility;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--muted), transparent 40%) transparent;
  margin: 0;
  min-width: 320px;
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, oklch(0.93 0.06 72), transparent 28%),
    radial-gradient(circle at top right, oklch(0.9 0.05 30 / 0.5), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, oklch(0.95 0.015 82) 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}


/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in oklch, var(--muted), transparent 40%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklch, var(--muted), transparent 25%);
}

/* Text selection styling */
::selection {
  background: color-mix(in oklch, var(--accent), transparent 75%);
  color: var(--text);
}

/* Focus visible styling for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button {
  border: 0;
}

#root {
  min-height: 100vh;
}

.app-shell {
  padding: clamp(1rem, 2vw, 2rem);
}

/* Premium hero section with enhanced visual hierarchy */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
  gap: var(--space-lg);
  align-items: center;
  padding: 1rem 1.7rem;
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--panel) 0%, color-mix(in oklch, var(--panel), var(--bg-strong) 8%) 100%);
  border-top: 3px solid var(--accent);
  box-shadow: 0 4px 20px color-mix(in oklch, var(--muted), transparent 80%), inset 0 1px 2px color-mix(in oklch, white, transparent 40%);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.panel h2,
.event-detail h2 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1;
}

.hero-copy {
  max-width: 56ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.hero-metrics > div,
.session-stats > div,
.detail-grid > div {
  padding: 0.85rem var(--space-sm);
  border-radius: 1.1rem;
  background: linear-gradient(135deg, color-mix(in oklch, var(--panel), var(--accent) 10%) 0%, color-mix(in oklch, var(--panel), var(--accent) 4%) 100%);
  border: 1px solid color-mix(in oklch, var(--panel-border), var(--accent) 25%);
  min-width: 0;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 4px color-mix(in oklch, var(--accent), transparent 20%), inset 0 1px 2px color-mix(in oklch, white, transparent 30%);
}

.hero-metrics > div:hover {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent), white 40%), 0 8px 28px color-mix(in oklch, var(--accent), transparent 55%);
  background: linear-gradient(135deg, color-mix(in oklch, var(--panel), var(--accent) 10%) 0%, color-mix(in oklch, var(--panel), var(--accent) 5%) 100%);
  transform: translateY(-2px);
}

.metric-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-metrics strong,
.session-stats strong,
.detail-grid strong {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Connection health indicator */
.connection-health-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem var(--space-sm);
  border-radius: 1.1rem;
  background: linear-gradient(135deg, color-mix(in oklch, var(--panel), var(--accent) 10%) 0%, color-mix(in oklch, var(--panel), var(--accent) 4%) 100%);
  border: 1px solid color-mix(in oklch, var(--panel-border), var(--accent) 25%);
  min-width: 0;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 4px color-mix(in oklch, var(--accent), transparent 20%), inset 0 1px 2px color-mix(in oklch, white, transparent 30%);
}

.connection-health-indicator:hover {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent), white 40%), 0 8px 28px color-mix(in oklch, var(--accent), transparent 55%);
  background: linear-gradient(135deg, color-mix(in oklch, var(--panel), var(--accent) 10%) 0%, color-mix(in oklch, var(--panel), var(--accent) 5%) 100%);
  transform: translateY(-2px);
}

.connection-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.connection-dot.healthy {
  background: var(--olive);
  animation: pulse 2s ease-in-out infinite;
}

.connection-dot.degraded {
  background: var(--warning);
}

.connection-dot.disconnected {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.error-banner {
  position: relative;
  margin-top: 1rem;
  padding: 1rem 3rem 1rem 1.2rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--danger), white 85%);
  border-left: 4px solid var(--danger);
  color: var(--danger);
  animation: slideDown 200ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-banner::after {
  content: "×";
  position: absolute;
  top: 50%;
  right: 1.2rem;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 180ms ease;
}

.error-banner:hover::after {
  opacity: 1;
}

.error-banner .retry-link {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--danger);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.error-banner .retry-link:hover {
  background: color-mix(in oklch, var(--danger), black 15%);
}

/* Error Boundary Component Styles */
.error-boundary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
}

.error-boundary-content {
  text-align: center;
  max-width: 400px;
}

.error-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.error-boundary h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--danger);
}

.error-boundary p {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.error-details {
  margin: 1rem 0;
  text-align: left;
}

.error-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.error-details pre {
  margin: 0.5rem 0 0 0;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  overflow-x: auto;
  color: var(--muted);
}

.retry-button {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.retry-button:hover {
  background: color-mix(in oklch, var(--primary), black 15%);
}

.error-fallback {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

/* Why Button on Session Cards */
.session-card {
  position: relative;
  display: grid;
  gap: 0.25rem;
}

.session-card-main {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.why-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
  z-index: 1;
}

.why-button:hover {
  transform: translateY(-1px);
  background: color-mix(in oklch, var(--danger), white 88%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(15rem, 17rem) minmax(0, 1fr) minmax(20rem, 25rem);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.workspace:not(:has(> .session-rail)),
.workspace:has(> .main-stage:only-child) {
  grid-template-columns: 1fr;
}

.inspect-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  animation: fadeInUp 200ms ease;
}

.inspect-grid > *:nth-child(1) { animation-delay: 0ms; }
.inspect-grid > *:nth-child(2) { animation-delay: 50ms; }
.inspect-grid > *:nth-child(3) { animation-delay: 100ms; }
.inspect-grid > *:nth-child(4) { animation-delay: 150ms; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Inspect tab: full-width workspace with proper panel layout */
.workspace--inspect {
  grid-template-columns: 1fr;
  max-height: none;
  overflow-y: visible;
}

.workspace--inspect .main-stage {
  overflow-y: visible;
}

/* Inspect grid: responsive multi-column layout for panels */
.workspace--inspect .inspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr));
  gap: 1.2rem;
}

/* Primary panel spans full width */
.workspace--inspect .inspect-grid > .panel--primary {
  grid-column: 1 / -1;
}

/* Secondary panels flow naturally */
.workspace--inspect .inspect-grid > .panel--secondary {
  min-width: 0;
  max-height: 420px;
  overflow-y: auto;
}

/* Inspect tab: DecisionTree spans full width and auto-sizes */
.workspace--inspect .trace-layout {
  grid-template-columns: 1fr;
}

.workspace--inspect .timeline-panel {
  max-height: none;
  overflow: visible;
  min-height: min(500px, 55vh);
}

/* Panel hierarchy: subtle (default) < secondary < primary - Premium polish */
.panel {
  border-radius: 1.5rem;
  background: var(--panel);
  padding: var(--space-md);
  border: 1px solid var(--panel-border);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--muted), transparent 92%);
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px oklch(0.52 0.04 60 / 0.12);
  border-color: color-mix(in oklch, var(--panel-border), transparent 20%);
}

.panel--primary {
  position: relative;
  border: 1.5px solid color-mix(in oklch, var(--accent), white 45%);
  border-radius: 1.7rem;
  background: var(--panel);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklch, var(--accent), transparent 8%);
}

.panel--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, color-mix(in oklch, var(--accent), white 20%) 100%);
  border-radius: 1.7rem 1.7rem 0 0;
}

.panel--secondary {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: 0 8px 24px oklch(0.52 0.04 60 / 0.06);
}

.panel--secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--panel-border) 50%, transparent 100%);
  border-radius: 1.5rem 1.5rem 0 0;
}

/* Panel accent modifier for important panels */
.panel--accent {
  position: relative;
  border-left: 3px solid var(--accent);
}

.panel--accent.coordination-panel {
  border-left-color: var(--node-llm);
}

.panel--accent.failure-cluster-panel {
  border-left-color: var(--danger);
}

/* Enhanced panel head with premium polish */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.3rem 1.5rem 1rem;
  border-bottom: 1px solid color-mix(in oklch, var(--panel-border), transparent 40%);
  margin-bottom: 1rem;
  background: linear-gradient(180deg, color-mix(in oklch, var(--panel), var(--bg-strong) 8%) 0%, transparent 100%);
  border-radius: 1.3rem 1.3rem 0 0;
}

.panel-head .eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Panel head with colored indicator dot */
.panel-head--with-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-head-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-head-indicator--llm {
  background: var(--node-llm);
}

.panel-head-indicator--danger {
  background: var(--danger);
}

.panel-head-indicator--olive {
  background: var(--olive);
}

/* Section dividers for inspect grid groups with color coding */
.inspect-section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.2rem 0.5rem 0.5rem 0.8rem;
  margin: 0.5rem 0 0;
  border-left: 3px solid transparent;
  border-radius: 0.2rem;
}

/* Analysis section: blue accent */
.inspect-section-divider:nth-of-type(1),
.inspect-grid > .inspect-section-divider:has(+ .panel--primary),
.inspect-grid > .panel--primary + * + .inspect-section-divider {
  border-left-color: oklch(0.58 0.14 200);
  background: oklch(0.58 0.14 200 / 0.03);
}

/* Monitoring section: green accent */
.inspect-section-divider:nth-of-type(2),
.inspect-grid > .inspect-section-divider:has(+ .panel--secondary):has(+ .panel--secondary .live-dashboard) {
  border-left-color: oklch(0.55 0.12 145);
  background: oklch(0.55 0.12 145 / 0.03);
}

/* Intelligence section: purple accent */
.inspect-section-divider:nth-of-type(3) {
  border-left-color: oklch(0.58 0.18 285);
  background: oklch(0.58 0.18 285 / 0.03);
}

.inspect-section-divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--panel-border), transparent 60%);
  border-radius: 1px;
}

.inspect-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.5rem;
  white-space: nowrap;
}

.inspect-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--panel-border), transparent 60%);
  border-radius: 1px;
}

/* Collapsible section behavior */
.inspect-section-divider {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.inspect-section-divider:hover {
  opacity: 0.8;
}

.inspect-section-label::after {
  content: ' ▾';
}

.inspect-section-divider.collapsed .inspect-section-label::after {
  content: ' ▸';
}

[data-section-hidden="true"] {
  display: none;
}

/* Inspectors grid with labels */
.inspectors-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.2rem;
}

.inspector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 350px;
  overflow-y: auto;
}

.inspector-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.25rem;
}

.inspector-separator {
  grid-column: 1 / -1;
  height: 1px;
  background: color-mix(in oklch, var(--panel-border), transparent 40%);
  margin: 0.3rem 0;
}

/* DecisionTree panel polish */
.workspace--inspect .timeline-panel.panel {
  position: relative;
  padding-bottom: 0.5rem;
}

.workspace--inspect .timeline-panel.panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.2rem;
  right: 1.2rem;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklch, var(--panel-border), transparent 40%) 15%,
    color-mix(in oklch, var(--panel-border), transparent 40%) 85%,
    transparent 100%
  );
}

.workspace--inspect .timeline-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.2rem 0.8rem;
}

.workspace--inspect .timeline-panel .panel-head .eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace--inspect .timeline-panel .panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.workspace--inspect .timeline-panel .panel-head .session-context {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Enhanced coordination panel styles */
.coordination-panel.panel--accent .panel-head {
  padding-left: 1rem;
}

.coordination-panel .turn-timeline {
  padding: 1rem 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--node-llm) 3%);
  border-radius: 0.8rem;
  margin: 0.8rem 0;
}

.coordination-panel .speaker-topology {
  padding: 1rem 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
  border-radius: 0.8rem;
  margin: 0.8rem 0;
}

.coordination-panel .coordination-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--node-llm) 2%);
  border-radius: 1rem;
  margin-bottom: 0.8rem;
}

/* Enhanced failure cluster panel styles */
.failure-cluster-panel.panel--accent .panel-head {
  padding-left: 1rem;
}

.failure-cluster-panel .cluster-bar-chart {
  display: flex;
  gap: 2px;
  height: 6px;
  padding: 0.8rem 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 30%);
  border-radius: 0.8rem;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.failure-cluster-panel .cluster-list-detailed {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0 0.2rem;
}

.failure-cluster-panel .cluster-card {
  padding: 1rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  border: 1px solid transparent;
  transition: all 180ms ease;
}

.failure-cluster-panel .cluster-card:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 45%);
  border-color: color-mix(in oklch, var(--panel-border), transparent 30%);
  transform: translateY(-1px);
}

.failure-cluster-panel .cluster-card.active {
  border-color: var(--danger);
  background: color-mix(in oklch, var(--panel), var(--danger) 5%);
}
.session-rail,
.detail-rail,
.main-stage {
  display: grid;
  gap: 1rem;
  min-width: 0;
  overflow: hidden;
}

/* Detail rail sticky header */
.detail-rail > *:first-child {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1.4rem 1.4rem 0 0;
}

.session-rail,
.control-bar,
.analysis-ribbon,
.event-detail,
.alerts-panel,
.search-panel {
  padding: 1.2rem;
}

.rail-head h2,
.control-bar h2,
.analysis-ribbon h2,
.alerts-panel h2,
.search-panel h2 {
  font-size: 1.45rem;
  position: relative;
}

/* Alert badge in panel header */
.alerts-panel h2 .alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.5rem;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: oklch(0.56 0.18 28);
  color: white;
}

.session-list,
.alert-list,
.cluster-list {
  display: grid;
  gap: 0.5rem;
}

/* Enhanced skeleton loading with shimmer effect */
.session-skeleton {
  display: flex;
  gap: 0.8rem;
  padding: 0.5rem 0;
}

.session-skeleton span {
  flex: 1;
  height: 3.5rem;
  border-radius: 1.2rem;
  background: linear-gradient(90deg, color-mix(in oklch, var(--panel), var(--bg-strong) 38%) 25%, color-mix(in oklch, var(--panel), var(--bg-strong) 55%) 50%, color-mix(in oklch, var(--panel), var(--bg-strong) 38%) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 85%);
}

.session-skeleton span:nth-child(2) {
  animation-delay: 0.25s;
}

.session-skeleton span:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.session-card,
.cluster-pill,
.alert-row,
.search-result,
.mode-switches button,
.tree-controls button,
.replay-controls button {
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-material), background-color var(--duration-normal) var(--ease-material), border-color var(--duration-normal) var(--ease-material), box-shadow var(--duration-normal) var(--ease-material);
}

.session-card {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  width: 100%;
  padding: 1.1rem 1.2rem;
  padding-left: calc(1.2rem - 4px);
  border-radius: 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 38%);
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 30%);
  border-left: 4px solid transparent;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 90%);
}

.session-card:hover {
  transform: translateY(-3px) translateX(1px);
  box-shadow: 0 6px 20px color-mix(in oklch, var(--muted), transparent 65%);
  border-color: color-mix(in oklch, var(--panel-border), transparent 50%);
}

.cluster-pill:hover,
.alert-row:hover,
.search-result:hover,
.mode-switches button:hover,
.checkpoint-card:hover,
.checkpoint-actions button:hover {
  transform: translateY(-1px);
}

.session-card.active {
  border-left-color: var(--accent);
  border-color: color-mix(in oklch, var(--accent), white 45%);
  background: color-mix(in oklch, var(--panel), var(--accent) 10%);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--accent), transparent 55%);
}

.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.session-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--muted);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--muted), white 70%);
}

.session-status-dot.success {
  background: var(--node-tool);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--node-tool), white 70%);
}

.session-status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--danger), white 70%);
}

.replay-value-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--highlight-bg);
  color: var(--highlight-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.mode-switches button.active {
  border-color: color-mix(in oklch, var(--accent), white 55%);
  background: color-mix(in oklch, var(--panel), var(--accent) 16%);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--accent), transparent 45%), inset 0 1px 2px color-mix(in oklch, white, transparent 70%);
}

.session-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.session-framework,
.session-status {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-stats,
.detail-grid,
.inspectors-grid {
  display: grid;
  gap: 0.8rem;
}

.session-stats,
.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-bar,
.analysis-ribbon {
  display: grid;
  gap: 1rem;
}

.mode-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Enhanced mode switches with premium feel */
.mode-switches button {
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 40%);
  min-height: 44px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 85%);
  transition: all var(--duration-normal) var(--ease-material);
}

.mode-switches button:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
  border-color: color-mix(in oklch, var(--panel-border), transparent 60%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in oklch, var(--muted), transparent 75%);
}

.session-sort-switches {
  margin-bottom: 0.2rem;
}

.retention-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: white;
  background: var(--muted);
  text-shadow: 0 1px 2px color-mix(in oklch, black, transparent 65%);
  transition: all 180ms ease;
}

.retention-pill.full {
  background: var(--danger);
}

.retention-pill.summarized {
  background: var(--warning);
  color: var(--text);
}

.retention-pill.downsampled {
  background: var(--olive);
}

.breakpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.breakpoint-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.breakpoint-grid input {
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 55%);
  color: var(--text);
}

.cluster-pill,
.alert-row {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  padding-left: 1.3rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--olive) 10%);
  text-align: left;
}

.alert-row::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.alert-row[data-severity="warning"]::before {
  background: #f59e0b;
}

.alert-row[data-severity="critical"]::before {
  background: oklch(0.56 0.18 28);
}

.search-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
}

.search-submit {
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent), white 22%);
  color: white;
  min-height: 44px;
}

.search-submit:disabled {
  cursor: progress;
  opacity: 0.72;
}

.search-controls {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.search-controls label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.search-controls input,
.search-controls select {
  padding: 0.8rem 0.95rem;
  border-radius: 0.95rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 55%);
  color: var(--text);
}

.search-scope-switches {
  margin-top: 1rem;
}

.search-status,
.search-empty {
  margin: 0.9rem 0 0;
  color: var(--muted);
}

.search-status.error {
  color: var(--danger);
}

.search-results {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

/* Enhanced search results with premium polish */
.search-result {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 85%);
}

.search-result:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 10%);
  border-color: color-mix(in oklch, var(--panel-border), var(--accent) 30%);
  transform: translateX(2px);
  box-shadow: 0 4px 12px color-mix(in oklch, var(--accent), transparent 25%);
}

.search-result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.search-result-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.checkpoint-card,
.checkpoint-actions button {
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.trace-layout,
.replay-layout {
  display: grid;
  gap: 1rem;
}

.trace-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.timeline-panel,
.tree-panel,
.replay-panel,
.inspectors {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.replay-panel {
  border-bottom: 1px solid var(--border-subtle, oklch(0.90 0.02 260));
  padding-bottom: 0.75rem;
}

.trace-timeline,
.decision-tree,
.tool-inspector,
.llm-viewer,
.session-replay,
.conversation-panel {
  height: 100%;
  padding: 1.1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.decision-tree {
  background: var(--bg-canvas, oklch(0.97 0.005 260 / 0.5));
  border-radius: 8px;
  position: relative;
}

.timeline-header,
.llm-header,
.tool-header,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.conversation-metrics,
.speaker-strip,
.policy-inline,
.compare-header,
.live-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.conversation-metrics,
.conversation-time,
.policy-inline,
.speaker-pill.muted,
.compare-loading {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Comparison loading state with spinner */
.comparison-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  text-align: center;
}

.loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid color-mix(in oklch, var(--panel-border), var(--accent) 30%);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.comparison-loading-state p {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.comparison-loading-state small {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.speaker-strip {
  margin-bottom: 1rem;
}

.speaker-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 38%);
  border: 1px solid var(--panel-border);
  font-size: 0.78rem;
}

.conversation-list {
  scroll-behavior: smooth;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

/* Premium conversation panel styling */
.conversation-row {
  display: grid;
  gap: 0.5rem;
  padding: 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 85%);
}

.conversation-row.agent_turn {
  border-left: 4px solid var(--node-llm);
  background: linear-gradient(90deg, color-mix(in oklch, var(--panel), var(--node-llm) 8%) 0%, color-mix(in oklch, var(--panel), var(--bg-strong) 34%) 30%);
}

.conversation-row.prompt_policy {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, color-mix(in oklch, var(--panel), var(--accent) 8%) 0%, color-mix(in oklch, var(--panel), var(--bg-strong) 34%) 30%);
}

.conversation-row:hover {
  transform: translateY(-2px) translateX(1px);
  box-shadow: 0 4px 12px color-mix(in oklch, var(--muted), transparent 70%);
}

.conversation-row.active {
  border-color: color-mix(in oklch, var(--accent), white 52%);
  background: color-mix(in oklch, var(--panel), var(--accent) 14%);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--accent), transparent 40%);
}

.conversation-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.conversation-row p,
.conversation-row pre {
  margin: 0;
  color: var(--muted);
}

.conversation-row pre {
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: color-mix(in oklch, var(--panel), white 24%);
}

.conversation-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  color: white;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-deep);
}

.conversation-chip.prompt_policy {
  background: var(--accent);
}

.conversation-chip.agent_turn {
  background: #0369a1;
}

.compare-select {
  min-width: min(15rem, 100%);
  max-width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 50%);
  color: var(--text);
}

.compare-header,
.compare-metric-grid,
.compare-token-grid {
  display: grid;
  gap: 0.85rem;
}

.compare-header,
.compare-token-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-session-card,
.compare-metric {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
}

.compare-session-card.primary {
  background: color-mix(in oklch, var(--panel), var(--accent) 10%);
}

.compare-session-card.secondary {
  background: color-mix(in oklch, var(--panel), var(--olive) 10%);
}

.compare-session-card small,
.compare-metric small {
  color: var(--muted);
}

.compare-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.live-badge {
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
}

.live-badge.connected {
  background: color-mix(in oklch, var(--panel), var(--olive) 18%);
}

.live-badge.offline {
  background: color-mix(in oklch, var(--panel), var(--danger) 14%);
}

.live-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--olive);
}

.live-badge.offline .live-dot {
  background: var(--danger);
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.live-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
  color: var(--text);
}

.live-card.static {
  cursor: default;
}

.live-card:disabled {
  opacity: 0.7;
}

.live-rolling {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 28%);
}

.live-rolling h3,
.compare-token-grid h3 {
  margin: 0 0 0.5rem;
}

.live-rolling p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.live-alerts {
  margin-top: 1rem;
}

.live-alerts h3 {
  margin: 0 0 0.75rem;
}

.live-alert-list {
  display: grid;
  gap: 0.75rem;
}

.live-alert-row {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  text-align: left;
  color: var(--text);
}

.live-alert-row.medium {
  border-color: color-mix(in oklch, var(--warning), white 45%);
}

.live-alert-row.high {
  border-color: color-mix(in oklch, var(--danger), white 45%);
  background: color-mix(in oklch, var(--panel), var(--danger) 8%);
}

.live-alert-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.live-alert-head small,
.live-alert-empty {
  color: var(--muted);
}

/* Timeline events - Enhanced with premium polish */
.timeline-events {
  display: grid;
  gap: 0.5rem;
  flex: 1;
  min-height: 20rem;
  overflow-y: auto;
  min-width: 0;
  padding-right: 0.25rem;
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 1.1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 12%);
  border: 1px solid transparent;
  transition: all var(--duration-normal) var(--ease-material);
  cursor: pointer;
}

.timeline-event:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  border-color: color-mix(in oklch, var(--panel-border), transparent 20%);
  transform: translateX(2px);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--muted), transparent 85%);
}

.timeline-event.selected {
  background: color-mix(in oklch, var(--panel), var(--accent) 14%);
  border-color: color-mix(in oklch, var(--accent), white 35%);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--accent), transparent 50%);
}

/* Highlight markers */
.timeline-event.highlight {
  border-left: 3px solid var(--highlight);
}

.highlight-marker {
  position: absolute;
  right: 4px;
  top: 4px;
  color: var(--highlight);
  font-weight: bold;
  font-size: 1rem;
}

.highlight-reason {
  display: block;
  font-size: 11px;
  color: var(--highlight-text);
  background: var(--highlight-bg);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  font-style: italic;
}

/* Highlight info card */
.highlight-info-card {
  background: var(--highlight-bg);
  border: 1px solid var(--highlight);
  border-left: 3px solid var(--highlight);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.highlight-info-card h4 {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: var(--highlight-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.highlight-info-card p {
  margin: 0;
  font-size: 13px;
  color: var(--highlight-text);
}

/* Highlight navigation */
.highlight-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: color-mix(in oklch, var(--panel), var(--warning) 12%);
  border-radius: 8px;
}

.highlight-nav button {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--warning) 25%);
  border: 1px solid color-mix(in oklch, var(--warning), white 50%);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.highlight-nav button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: color-mix(in oklch, var(--panel), var(--warning) 35%);
}

.highlight-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.highlight-position {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  text-align: center;
}

/* Enhanced event markers with glow effects */
.event-marker {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent), white 75%);
  transition: all 180ms ease;
}

.timeline-event:hover .event-marker {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), white 65%);
  transform: scale(1.1);
}

.timeline-event.error .event-marker,
.event-chip.error,
.event-chip.policy_violation,
.event-chip.refusal {
  background: var(--danger);
}

.timeline-event.tool_call .event-marker,
.timeline-event.tool_result .event-marker {
  background: var(--olive);
}

.timeline-event.decision .event-marker,
.timeline-event.safety_check .event-marker,
.event-chip.decision,
.event-chip.safety_check {
  background: var(--warning);
}

.timeline-event.llm_request .event-marker,
.timeline-event.llm_response .event-marker,
.event-chip.prompt_policy {
  background: var(--accent);
}

.event-info {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  overflow: hidden;
}

.event-type {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.event-summary {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-time,
.event-count,
.model-name {
  color: var(--muted);
  font-size: 0.84rem;
}

.tree-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tree-controls button {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 42%);
  min-height: 44px;
}

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.tree-tooltip {
  position: fixed;
  z-index: 20;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 18%);
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* Premium replay controls */
.replay-controls {
  display: grid;
  grid-template-columns: repeat(5, auto) minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-radius: 1.3rem;
  background: linear-gradient(135deg, color-mix(in oklch, var(--panel), var(--bg-strong) 28%), color-mix(in oklch, var(--panel), var(--bg-strong) 18%));
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 35%);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--muted), transparent 88%), inset 0 1px 2px color-mix(in oklch, white, transparent 40%);
}

.step-tree-controls {
  display: flex;
  gap: 2px;
}

.step-tree-controls .replay-btn {
  font-size: 0.65rem;
  padding: 2px 6px;
  min-width: 36px;
  text-align: center;
}

.replay-controls button,
.speed-select {
  padding: 0.9rem 1.1rem;
  border-radius: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--duration-normal) var(--ease-material);
  box-shadow: 0 1px 3px color-mix(in oklch, var(--muted), transparent 85%);
}

.replay-controls button:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 10%);
  border-color: color-mix(in oklch, var(--accent), white 48%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in oklch, var(--accent), transparent 35%);
}

.replay-controls button:active {
  transform: translateY(0);
}

.timeline-container {
  position: relative;
  min-width: 0;
}

.timeline-slider {
  width: 100%;
}

.event-counter,
.replay-summary,
.usage {
  color: var(--muted);
  font-size: 0.85rem;
}

.timeline-markers {
  position: absolute;
  inset: 0.2rem 0 0 0;
  pointer-events: auto;
}

.timeline-marker {
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: -0.275rem;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-marker.high-importance {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent), white 75%);
}

.timeline-marker.checkpoint {
  cursor: pointer;
}

.timeline-marker.breakpoint {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--danger), white 78%);
  cursor: pointer;
}

.timeline-marker.blocked {
  background: color-mix(in oklch, var(--muted), white 20%);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--muted), white 82%);
}

.replay-summary,
.analysis-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 20%);
}

.replay-summary span {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 45%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.replay-summary--inline {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.checkpoint-list,
.checkpoint-compare-grid,
.checkpoint-actions {
  display: grid;
  gap: 0.75rem;
}

.checkpoint-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  margin-top: 1rem;
}

.checkpoint-card {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  padding-left: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  border-left-width: 4px;
  border-left-color: var(--muted);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
}

/* Tier-based left border colors */
.checkpoint-card[data-tier="1"] {
  border-left-color: #f59e0b;
}

.checkpoint-card[data-tier="2"] {
  border-left-color: #94a3b8;
}

.checkpoint-card[data-tier="3"] {
  border-left-color: #78716c;
}

.checkpoint-card.active {
  border-color: color-mix(in oklch, var(--accent), white 48%);
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
}

.checkpoint-card small {
  color: var(--muted);
}

.checkpoint-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.checkpoint-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 38%);
  color: var(--text);
  transition: all 160ms ease;
}

.checkpoint-actions button:hover {
  background: color-mix(in oklch, var(--accent), white 75%);
  border-color: color-mix(in oklch, var(--accent), white 40%);
}

.checkpoint-compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.detail-actions,
.reference-list,
.checkpoint-grid {
  display: grid;
  gap: 0.75rem;
}

.detail-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0;
}

.breakpoint-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  transition: all 0.15s ease;
}

.breakpoint-toggle-btn:hover {
  border-color: var(--accent-color, #3b82f6);
  color: var(--accent-color, #3b82f6);
}

.breakpoint-toggle-btn.has-breakpoint {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.detail-actions button,
.reference-chip {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 38%);
  color: var(--text);
  text-align: left;
}

.reference-chip {
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
}

.reference-chip span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.reference-chip strong {
  font-size: 0.95rem;
}

.reference-chip.missing {
  cursor: default;
  color: var(--muted);
}

.checkpoint-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--olive) 7%);
  border: 1px solid color-mix(in oklch, var(--panel-border), var(--olive) 16%);
  border-left: 3px solid var(--node-checkpoint);
}

.checkpoint-copy h3,
.checkpoint-grid h4 {
  margin: 0;
}

.checkpoint-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.checkpoint-grid pre {
  margin: 0.5rem 0 0;
  padding: 0.85rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), white 28%);
}

.inspectors-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.messages,
.detail-sections {
  display: grid;
  gap: 0.85rem;
}

.diagnosis-overview-grid,
.candidate-list {
  display: grid;
  gap: 0.75rem;
}

.diagnosis-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.diagnosis-overview-card,
.candidate-card,
.diagnosis-card {
  border: 1px solid var(--panel-border);
  border-radius: 1.1rem;
}

.diagnosis-overview-card,
.candidate-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 36%);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.diagnosis-overview-card:hover,
.candidate-card:hover {
  transform: translateY(-1px);
}

.diagnosis-overview-card small,
.candidate-card p {
  color: var(--muted);
}

.diagnosis-card {
  padding: 1rem;
  background: color-mix(in oklch, var(--panel), var(--accent) 6%);
  border-left: 3px solid var(--danger);
}

.diagnosis-head,
.candidate-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.diagnosis-head span,
.candidate-head span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.diagnosis-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--danger), white 82%);
  color: var(--danger);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
 }

.message,
.tool-call,
.code-block,
.detail-sections pre,
.detail-sections p {
  margin: 0;
}

.message,
.tool-call,
.detail-sections pre {
  padding: 0.9rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 42%);
  font-family: 'Manrope', monospace;
  font-size: 0.8rem;
}

.detail-sections > div:last-child > pre {
  background: color-mix(in oklch, var(--bg-strong), black 4%);
}

.content,
pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.tool-inspector .tool-section h4,
.llm-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}

.llm-section:last-child {
  border-bottom: none;
}


.llm-section h4,
.detail-sections h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.event-detail h2 {
  font-size: 2rem;
  line-height: 1;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.event-chip {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: white;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-deep);
}

.detail-sections {
  margin-top: 1rem;
}

.detail-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-top: 1rem;
  border-top: 1px solid color-mix(in oklch, var(--panel-border), transparent 40%);
}

.detail-section-header:first-child {
  margin-top: 0;
  border-top: none;
}

.detail-section-header .eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-section-header::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

/* Search panel improvements */
.search-panel input:focus,
.search-panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), transparent 80%);
}

.search-result:hover {
  border-color: color-mix(in oklch, var(--accent), white 45%);
  background: color-mix(in oklch, var(--panel), var(--accent) 8%);
}

.detail-sections p,
.detail-sections pre {
  color: var(--muted);
  line-height: 1.6;
}

.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  gap: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.empty-panel .empty-icon {
  font-size: 2rem;
  opacity: 0.5;
}

.empty-panel p {
  margin: 0;
}

.alerts-panel p:last-child {
  color: var(--muted);
}

/* Empty state styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 0.75rem;
  min-height: 200px;
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 280px;
}

.empty-state small {
  color: color-mix(in oklch, var(--muted), transparent 30%);
  font-size: 0.8rem;
}

/* Search suggestions */
.search-suggestions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.suggestion-chips span {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
  color: var(--muted);
  font-size: 0.75rem;
  border: 1px solid var(--panel-border);
}

/* Conversation list responsive grid */
.conversation-list--single {
  grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  /* Inspect grid: 2 columns on tablet */
  .workspace--inspect .inspect-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trace-layout,
  .inspectors-grid,
  .conversation-list,
  .compare-header,
  .compare-token-grid,
  .live-grid,
  .diagnosis-overview-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

/* Intermediate breakpoint for checkpoint-list: 3-column layout */
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(14rem, 1fr) minmax(0, 1.5fr);
    gap: 0.875rem;
  }

  /* Stack detail rail below main content on tablets */
  .detail-rail {
    grid-column: 1 / -1;
  }

  .trace-layout {
    grid-template-columns: 1fr;
  }

  .checkpoint-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Intermediate breakpoint for tablets: 2-column grid layouts */
@media (max-width: 1000px) {
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkpoint-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* Ensure workspace is single column on mobile */
  .workspace {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Inspect grid: single column on mobile */
  .workspace--inspect .inspect-grid {
    grid-template-columns: 1fr;
  }

  /* Ensure all rails stack vertically */
  .session-rail,
  .detail-rail,
  .main-stage {
    width: 100%;
    max-width: 100%;
  }

  .hero-metrics,
  .breakpoint-grid,
  .session-stats,
  .detail-grid,
  .detail-actions,
  .checkpoint-grid,
  .checkpoint-actions,
  .checkpoint-compare-grid,
  .checkpoint-list,
  .compare-metric-grid,
  .live-grid {
    grid-template-columns: 1fr;
  }

  /* Flex-based replay controls for small tablets */
  .replay-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .replay-controls button {
    flex: 0 0 auto;
  }

  .timeline-container {
    flex: 1 1 100%;
    order: -1;
    margin-bottom: 0.25rem;
  }

  .event-counter,
  .speed-select {
    flex: 1 1 auto;
    min-width: 6rem;
  }
}

/* Mobile touch targets: minimum 44x44px for accessibility */
@media (max-width: 480px) {
  button,
  .session-card,
  .conversation-row,
  .live-card,
  .checkpoint-card,
  .search-result,
  .cluster-pill,
  .alert-row {
    min-height: 44px;
  }
}

/* Intermediate breakpoint for small tablets (600px) - 2-column grids */
@media (max-width: 600px) {
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-stats,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .breakpoint-grid {
    grid-template-columns: 1fr;
  }

  .compare-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkpoint-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .diagnosis-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    border-radius: 1.2rem;
  }

  .session-rail,
  .detail-rail,
  .main-stage,
  .control-bar,
  .analysis-ribbon,
  .event-detail,
  .alerts-panel,
  .search-panel {
    padding: 1rem;
  }

  .hero {
    padding: 1rem;
    border-radius: 1.2rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }
}

/* Mobile breakpoint for phones (480px) - single column */
@media (max-width: 480px) {
  .app-shell {
    padding: 0.75rem;
  }

  .hero {
    padding: 1rem;
    border-radius: 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-copy {
    font-size: 0.9rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .session-stats {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .breakpoint-grid {
    grid-template-columns: 1fr;
  }

  .checkpoint-list {
    grid-template-columns: 1fr;
  }

  .compare-metric-grid {
    grid-template-columns: 1fr;
  }

  .live-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-overview-grid {
    grid-template-columns: 1fr;
  }

  .replay-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .replay-controls button {
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
  }

  .replay-controls .speed-select {
    min-width: 0;
    flex: 1;
  }

  .timeline-container {
    order: 10;
    width: 100%;
    flex-basis: 100%;
  }

  .panel {
    border-radius: 1rem;
  }

  .session-rail,
  .detail-rail,
  .main-stage,
  .control-bar,
  .analysis-ribbon,
  .event-detail,
  .alerts-panel,
  .search-panel {
    padding: 0.85rem;
  }

  .rail-head h2,
  .control-bar h2,
  .analysis-ribbon h2,
  .alerts-panel h2,
  .search-panel h2 {
    font-size: 1.2rem;
  }

  .mode-switches button {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .session-card {
    padding: 0.85rem;
    border-radius: 0.9rem;
  }

  .hero-metrics > div,
  .session-stats > div,
  .detail-grid > div {
    padding: 0.85rem;
    border-radius: 1rem;
  }

  .hero-metrics strong,
  .session-stats strong,
  .detail-grid strong {
    font-size: 1.1rem;
  }

  .conversation-list {
    grid-template-columns: 1fr;
  }

  .inspectors-grid {
    grid-template-columns: 1fr;
  }

  .trace-layout {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .checkpoint-actions {
    grid-template-columns: 1fr;
  }

  .checkpoint-compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-header,
  .compare-token-grid {
    grid-template-columns: 1fr;
  }

  .checkpoint-grid {
    grid-template-columns: 1fr;
  }

  /* Hide less critical elements on very small screens */
  .tree-legend {
    display: none;
  }

  .event-counter {
    display: none;
  }

  .replay-summary {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Drift panel */
.drift-panel {
  margin-top: 16px;
}

.baseline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.current-summary {
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
  margin-top: 4px;
}

.drift-message {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.5rem 0;
}

.drift-error {
  color: var(--danger);
  font-size: 0.85rem;
}

.drift-alerts h3 {
  margin: 12px 0 8px;
  font-size: 0.9rem;
}

.drift-alert {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
  border-radius: 0.75rem;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--muted);
}

.drift-alert.warning {
  border-left-color: var(--warning);
  background: color-mix(in oklch, var(--panel), var(--warning) 12%);
}

.drift-alert.critical {
  border-left-color: var(--danger);
  background: color-mix(in oklch, var(--panel), var(--danger) 10%);
}

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

.alert-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.alert-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alert-badge.warning {
  background: var(--warning);
  color: var(--text);
}

.alert-badge.critical {
  background: var(--danger);
  color: white;
}

.alert-description {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--text);
}

.alert-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.alert-cause {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.no-drift {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Failure Cluster Panel */
.failure-cluster-panel {
  margin-top: 1rem;
}

.cluster-list-detailed {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cluster-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cluster-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px oklch(0.52 0.04 60 / 0.1);
}

.cluster-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, oklch(0.99 0.005 75 / 0.92), oklch(0.96 0.02 84 / 0.92));
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.cluster-fingerprint {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.cluster-severity {
  font-size: 0.78rem;
  color: var(--warning);
}

.cluster-metrics {
  display: flex;
  gap: 1rem;
}

.cluster-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cluster-symptom {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.cluster-link {
  font-size: 0.75rem;
  color: var(--accent);
}

/* Rolling Summary Enhancements */
.rolling-metrics {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: var(--bg-strong);
}

.rolling-metrics h3 {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  font-size: 0.78rem;
}

.badge-label {
  color: var(--muted);
}

.badge-value {
  color: var(--text);
}

.rolling-window-info {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Checkpoint Delta */
.checkpoint-delta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

.delta-positive {
  color: var(--olive);
}

.delta-negative {
  color: var(--danger);
}

/* Breakpoint Panel */
.breakpoint-panel {
  background: var(--bg-elevated, oklch(0.98 0.005 260));
  border: 1px solid var(--border-subtle, oklch(0.90 0.02 260));
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.breakpoint-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.breakpoint-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle, oklch(0.90 0.02 260));
  font-size: 0.85rem;
}

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

.breakpoint-reached-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, oklch(0.70 0.15 200));
  flex-shrink: 0;
}

.current-breakpoint {
  font-weight: 600;
  color: var(--accent, oklch(0.70 0.15 200));
}

/* Breakpoint Stop Indicator */
.breakpoint-stop-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--warning), white 85%);
  border: 1px solid color-mix(in oklch, var(--warning), white 50%);
  color: var(--warning);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px color-mix(in oklch, var(--warning), transparent 60%);
  animation: pulse-breakpoint 2s ease-in-out infinite;
}

@keyframes pulse-breakpoint {
  0%, 100% {
    box-shadow: 0 2px 8px color-mix(in oklch, var(--warning), transparent 60%);
  }
  50% {
    box-shadow: 0 2px 16px color-mix(in oklch, var(--warning), transparent 40%);
  }
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* Empty Message */
.empty-message {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ============================================
   Enhanced Reasoning Graph Panel Styles
   ============================================ */

/* Import component-specific styles */
@import url('./components/ReasoningGraphPanel.css');

/* Additional integration styles if needed */
.reasoning-graph-panel.panel--primary {
  min-height: 500px;
}

/* ============================================
   Failure Cluster Panel Styles
   ============================================ */

.failure-cluster-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cluster-list-detailed {
  display: grid;
  gap: 0.75rem;
}

.cluster-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  min-height: 44px;
}

.cluster-card:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 8%);
  border-color: color-mix(in oklch, var(--accent), white 40%);
}

.cluster-card:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), white 50%);
}

.cluster-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), white 50%);
}

.cluster-card:active {
  transform: scale(0.995);
}

.cluster-card.active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.cluster-fingerprint {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.cluster-severity {
  color: var(--muted);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.cluster-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.cluster-metric {
  display: grid;
  gap: 0.15rem;
}

.cluster-symptom {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-link {
  display: block;
  margin-top: 0.25rem;
  color: var(--accent);
  font-size: 0.82rem;
}

/* ============================================
   Policy Diff View Styles
   ============================================ */

.policy-diff-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.policy-shift-list {
  display: grid;
  gap: 0.75rem;
}

.policy-shift-card {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  min-height: 44px;
}

.policy-shift-card:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 8%);
  border-color: color-mix(in oklch, var(--accent), white 40%);
}

.policy-shift-card:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), white 50%);
}

.policy-shift-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), white 50%);
}

.policy-shift-card:active {
  transform: scale(0.995);
}

.policy-shift-card.magnitude-major {
  border-left: 3px solid var(--danger);
}

.policy-shift-card.magnitude-moderate {
  border-left: 3px solid var(--warning);
}

.policy-shift-card.magnitude-minor {
  border-left: 3px solid var(--accent);
}

.policy-shift-card.magnitude-subtle {
  border-left: 3px solid var(--muted);
}

.shift-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.shift-turn {
  font-size: 0.82rem;
  color: var(--muted);
}

.shift-magnitude {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shift-magnitude.magnitude-major {
  background: color-mix(in oklch, var(--panel), var(--danger) 18%);
  color: var(--danger);
}

.shift-magnitude.magnitude-moderate {
  background: color-mix(in oklch, var(--panel), var(--warning) 18%);
  color: var(--warning);
}

.shift-magnitude.magnitude-minor {
  background: color-mix(in oklch, var(--panel), var(--accent) 18%);
  color: var(--accent);
}

.shift-magnitude.magnitude-subtle {
  background: color-mix(in oklch, var(--panel), var(--muted) 18%);
  color: var(--muted);
}

.shift-templates {
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
}

.template-change,
.template-initial {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.template-previous {
  color: var(--muted);
  text-decoration: line-through;
}

.template-arrow {
  color: var(--muted);
  font-size: 0.8rem;
}

.template-new {
  font-weight: 600;
  color: var(--text);
}

.template-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--olive) 18%);
  color: var(--olive);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shift-score {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.magnitude-bar-container {
  height: 0.5rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg-strong), var(--muted) 20%);
  overflow: hidden;
}

.magnitude-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--warning) 50%, var(--danger) 100%);
  transition: width 200ms ease;
}

/* ============================================
   Analytics Panel Styles
   ============================================ */

.analytics-panel {
  padding: 1.4rem;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.analytics-header h2 {
  margin: 0;
  font-size: 1.45rem;
}

.time-range-selector {
  display: flex;
  gap: 0.5rem;
}

.time-range-btn {
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  border: 1px solid transparent;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
  min-height: 38px;
}

.time-range-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
}

.time-range-btn.active {
  border-color: color-mix(in oklch, var(--accent), white 50%);
  background: color-mix(in oklch, var(--panel), var(--accent) 16%);
}

.analytics-period {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.analytics-loading,
.analytics-error {
  color: var(--muted);
  font-size: 0.95rem;
}

.analytics-error {
  color: var(--danger);
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem;
  border-radius: 1.2rem;
  background: color-mix(in oklch, var(--panel), var(--accent) 4%);
  border: 1px solid color-mix(in oklch, var(--panel-border), var(--accent) 22%);
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.analytics-section {
  margin-bottom: 1.5rem;
}

.analytics-section:last-child {
  margin-bottom: 0;
}

.analytics-section h3 {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.adoption-bars {
  display: grid;
  gap: 0.85rem;
}

.adoption-bar-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}

.adoption-bar-track {
  height: 0.75rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg-strong), var(--muted) 15%);
  overflow: hidden;
}

.adoption-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--olive) 100%);
  transition: width 300ms ease;
}

.adoption-bar-label {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

.adoption-bar-percent {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 3rem;
  text-align: right;
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 4rem;
  padding: 0.5rem 0;
}

.sparkline-bar {
  flex: 1;
  min-width: 4px;
  max-width: 12px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent) 0%, color-mix(in oklch, var(--accent), var(--bg) 30%) 100%);
  transition: height 200ms ease;
}

.sparkline-bar:hover {
  background: var(--olive);
}

.sparkline-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Tab Navigation */
.app-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
  border-radius: 1.2rem;
  border: 1px solid var(--panel-border);
  position: relative;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  min-height: 44px;
  position: relative;
  color: var(--muted);
}

.tab-btn:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: color-mix(in oklch, var(--panel), var(--accent) 6%);
}

.tab-btn.active {
  border-color: transparent;
  border-bottom-color: var(--accent);
  background: var(--panel);
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--accent), transparent 55%);
}

/* Analytics full-page layout */
.analytics-view {
  padding: 0 1rem;
}

.analytics-view .analytics-panel {
  max-width: 60rem;
}

/* ============================================
   Rolling Summary Styles
   ============================================ */

.rolling-summary-card {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), white 28%);
}

.rolling-summary-text {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.rolling-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rolling-metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
  font-size: 0.8rem;
}

.rolling-metric-badge strong {
  font-weight: 600;
  color: var(--text);
}

.rolling-metric-badge span {
  color: var(--muted);
}

/* ============================================
   Reduced Motion Preference
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .cluster-card,
  .policy-shift-card,
  .magnitude-bar-fill,
  .highlight-nav button,
  .empty-state-icon,
  .session-skeleton span,
  .timeline-event,
  .stat-card,
  .session-card,
  .hero-metrics > div,
  .session-stats > div,
  .detail-grid > div,
  .filter-chip,
  .latency-bar {
    transition: none;
  }

  .cluster-card:hover,
  .policy-shift-card:hover {
    transform: none;
  }
}

/* ============================================
   Cost Summary & Panel
   ============================================ */

.search-container {
  margin: 1.5rem 0;
}

.cost-summary {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cost-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cost-stat {
  padding: 1rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
}

.cost-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cost-value {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.cost-by-framework {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--panel-border);
}

.cost-by-framework h3 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--text);
}

.cost-by-framework table {
  width: 100%;
  border-collapse: collapse;
}

.cost-by-framework th,
.cost-by-framework td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.cost-by-framework th {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cost-by-framework td {
  font-size: 0.95rem;
}

.cost-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
}

.cost-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.cost-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.cost-row:last-child {
  padding-bottom: 0;
}

.cost-amount {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--accent-deep);
}

/* Cost panel skeleton loading */
.cost-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--bg-strong) 25%, var(--muted) 50%, var(--bg-strong) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cost-efficiency-hint {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--panel-border);
  color: var(--warning);
}

.cost-error,
.cost-empty {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.cost-error {
  color: var(--danger);
}

/* ============================================
   Fix Annotation
   ============================================ */

.fix-annotation {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
}

.fix-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.fix-text {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in oklch, var(--warning), transparent 90%);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.fix-input {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.5rem;
  background: var(--panel);
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.fix-input:focus {
  outline: none;
  border-color: var(--accent);
}

.fix-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.fix-save-btn,
.fix-edit-btn,
.fix-cancel-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fix-save-btn {
  background: var(--accent);
  color: white;
}

.fix-save-btn:hover {
  background: var(--accent-deep);
}

.fix-edit-btn {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
  color: var(--text);
}

.fix-edit-btn:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 60%);
}

.fix-cancel-btn {
  background: color-mix(in oklch, var(--danger), transparent 85%);
  color: var(--danger);
}

.fix-cancel-btn:hover {
  background: color-mix(in oklch, var(--danger), transparent 75%);
}

.fix-error {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: color-mix(in oklch, var(--danger), transparent 85%);
  color: var(--danger);
  font-size: 0.8rem;
}

/* ── Phase 1: Why Button ──────────────────────────────────────── */

.why-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--danger), white 82%);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid color-mix(in oklch, var(--danger), white 50%);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.why-btn:hover:not(:disabled) {
  background: color-mix(in oklch, var(--danger), white 70%);
  transform: translateY(-1px);
}

.why-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.why-btn.active {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.why-btn .spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in oklch, var(--danger), white 60%);
  border-top-color: var(--danger);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Phase 1: Highlight Chip ─────────────────────────────────── */

.highlight-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  border: 1px dashed color-mix(in oklch, var(--panel-border), var(--muted) 30%);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 20%);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.highlight-chip:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 30%);
  border-color: var(--panel-border);
}

.highlight-chip-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 160ms ease;
}

.highlight-chip-summary {
  font-weight: 500;
  color: var(--text);
}

.highlight-chip-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.highlight-chip-duration {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.highlight-chip-events {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem 0;
}

.highlight-chip-type {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg-strong), var(--muted) 20%);
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.highlight-chip-expanded {
  border-style: solid;
  border-color: var(--panel-border);
  background: transparent;
  cursor: default;
  padding: 0;
  flex-direction: column;
  align-items: stretch;
}

.highlight-chip-expanded:hover {
  background: transparent;
}

.highlight-chip-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  margin-top: 0.5rem;
}

.highlight-chip-toggle:hover {
  color: var(--text);
}

/* ── Phase 1: Highlights Threshold Presets ────────────────────── */

.threshold-presets {
  display: flex;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

.threshold-preset {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.threshold-preset:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 6%);
}

.threshold-preset.active {
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
  border-color: color-mix(in oklch, var(--panel-border), var(--accent) 30%);
  color: var(--accent-deep);
}

/* Search input enhancements */
.search-input-wrapper {
  position: relative;
}

.search-input-wrapper::before {
  content: "🔍";
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.5;
  pointer-events: none;
}

.search-controls input,
.search-controls select {
  padding: 0.8rem 0.95rem 0.8rem 2.8rem !important;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.search-controls input:focus,
.search-controls select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), transparent 85%);
}

.search-skeleton {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.search-skeleton-item {
  height: 60px;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
  animation: pulse 1.5s ease-in-out infinite;
}

.search-skeleton-item:nth-child(2) {
  animation-delay: 0.2s;
}

.search-skeleton-item:nth-child(3) {
  animation-delay: 0.4s;
}

.search-result {
  border-left: 3px solid transparent;
  transition: border-color 180ms ease, transform 180ms ease;
}

.search-result:hover {
  transform: translateX(2px);
}

.search-result[data-event-type="decision"] {
  border-left-color: var(--node-decision);
}

.search-result[data-event-type="tool_call"],
.search-result[data-event-type="tool_result"] {
  border-left-color: var(--node-tool);
}

.search-result[data-event-type="llm_request"],
.search-result[data-event-type="llm_response"] {
  border-left-color: var(--node-llm);
}

.search-result[data-event-type="safety_check"],
.search-result[data-event-type="refusal"],
.search-result[data-event-type="policy_violation"] {
  border-left-color: var(--node-risk);
}

.search-result[data-event-type="checkpoint"] {
  border-left-color: var(--node-checkpoint);
}

.search-result[data-event-type="agent_turn"] {
  border-left-color: var(--node-session);
}

/* Analytics panel enhancements */
.analytics-panel .stat-value {
  font-variant-numeric: tabular-nums;
}

.analytics-panel .stat-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.analytics-panel .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px oklch(0.52 0.04 60 / 0.1);
}

.analytics-panel .cost-value {
  font-variant-numeric: tabular-nums;
}

/* Alert panel severity indicators */
.live-alert-row {
  position: relative;
  padding-left: calc(1rem + 4px);
  border-left: 4px solid transparent;
  transition: border-color 180ms ease;
}

.live-alert-row.low {
  border-left-color: var(--olive);
}

.live-alert-row.medium {
  border-left-color: var(--warning);
}

.live-alert-row.high {
  border-left-color: var(--danger);
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% {
    background: color-mix(in oklch, var(--panel), var(--danger) 8%);
  }
  50% {
    background: color-mix(in oklch, var(--panel), var(--danger) 14%);
  }
}

/* Drift alert enhancements */
.drift-alert {
  position: relative;
  padding-left: calc(10px + 4px);
  border-left-width: 4px;
  border-left-style: solid;
}

.drift-alert.low {
  border-left-color: var(--olive);
}

.drift-alert.medium {
  border-left-color: var(--warning);
}

.drift-alert.high {
  border-left-color: var(--danger);
}

/* Failure cluster enhancements */
.cluster-card {
  position: relative;
  padding-left: calc(1rem + 4px);
  border-left: 4px solid transparent;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.cluster-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px oklch(0.52 0.04 60 / 0.1);
}

.cluster-card[data-severity="high"] {
  border-left-color: var(--danger);
}

.cluster-card[data-severity="medium"] {
  border-left-color: var(--warning);
}

.cluster-card[data-severity="low"] {
  border-left-color: var(--olive);
}

/* Cost panel tabular numbers */
.cost-value {
  font-variant-numeric: tabular-nums;
}

.cost-summary .cost-value {
  font-variant-numeric: tabular-nums;
}

/* Detail grid tabular numbers */
.detail-grid strong {
  font-variant-numeric: tabular-nums;
}

/* Badge values tabular numbers */
.badge-value {
  font-variant-numeric: tabular-nums;
}

/* Metric badges tabular numbers */
.metric-badge .badge-value {
  font-variant-numeric: tabular-nums;
}

/* Live dot pulsing animation */
.live-dot.pulsing {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in oklch, var(--olive), transparent 60%);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in oklch, var(--olive), transparent 0%);
    opacity: 0.5;
  }
}

/* Live alert items polish */
.live-alert-row {
  transition: background-color 180ms ease, transform 180ms ease;
}

.live-alert-row:hover {
  transform: translateX(2px);
}

/* Metric badges polish */
.metric-badge {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 40%);
  transition: background-color 180ms ease;
}

.metric-badge:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
}

/* Rolling window info polish */
.rolling-window-info {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--accent), transparent 85%);
  color: var(--accent);
  font-size: 0.75rem;
}

/* Analysis strip polish */
.analysis-strip {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
}

/* Stat card hover effects */
.stat-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px oklch(0.52 0.04 60 / 0.1);
}

/* Adoption bar polish */
.adoption-bar-row {
  transition: background-color 180ms ease;
}

.adoption-bar-row:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 8%);
  border-radius: 8px;
}

/* Checkpoint label distinction */
.checkpoint-preview.selected .eyebrow {
  color: var(--accent);
}

.checkpoint-preview.anchor .eyebrow {
  color: var(--muted);
}

/* Decision Provenance Panel Styles */
.decision-provenance {
  margin-bottom: 1rem;
}

.provenance-sections {
  display: grid;
  gap: 1rem;
}

.provenance-card {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
}

.provenance-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.decision-action {
  margin: 0;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: color-mix(in oklch, var(--accent), transparent 90%);
  border-left: 3px solid var(--accent);
  font-weight: 500;
}

.reasoning-text {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in oklch, var(--panel), var(--muted) 8%);
}

.reasoning-text .metric-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.reasoning-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.confidence-meter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.confidence-meter .metric-label {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: color-mix(in oklch, var(--muted), transparent 70%);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--accent));
  transition: width 300ms ease;
}

.confidence-meter span:last-child {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.evidence-list {
  display: grid;
  gap: 0.5rem;
}

.evidence-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in oklch, var(--panel), var(--node-tool) 6%);
  border-left: 2px solid var(--node-tool);
}

.evidence-item pre {
  margin: 0;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-evidence-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in oklch, var(--warning), white 88%);
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 500;
}

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

.alternatives-list {
  display: grid;
  gap: 0.5rem;
}

.alternative-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in oklch, var(--panel), var(--muted) 6%);
  border-left: 2px solid var(--muted);
}

.alternative-item pre {
  margin: 0;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}

.no-data {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Timeline header layout for blocked actions toggle */
.timeline-header-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.timeline-header-right {
  display: flex;
  align-items: center;
}

.blocked-actions-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 38%);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.replay-toggle {
  flex-shrink: 0;
}

.blocked-actions-toggle:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
  border-color: color-mix(in oklch, var(--panel-border), var(--muted) 30%);
}

.toggle-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.toggle-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

/* Blocked action event styling */
.timeline-event.blocked {
  background: color-mix(in oklch, var(--panel), var(--muted) 25%);
  border-left: 3px solid var(--muted);
  opacity: 0.85;
}

.timeline-event.blocked:hover {
  background: color-mix(in oklch, var(--panel), var(--muted) 35%);
}

.blocked-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--muted), white 70%);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blocked-action {
  display: block;
  margin-top: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--muted), white 85%);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
}

.blocked-reason {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

.blocked-event-indicator {
  border: 1px solid color-mix(in oklch, var(--muted), white 55%);
  background: color-mix(in oklch, var(--panel), var(--muted) 20%);
}

.blocked-event-dot {
  background: var(--muted);
}

/* Decision Tree - Guided Exploration Styles */
.decision-tree .jump-recommended-btn {
  background: color-mix(in oklch, #22c55e, transparent 85%);
  color: #16a34a;
  border: 1px solid #22c55e;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.decision-tree .jump-recommended-btn:hover {
  background: color-mix(in oklch, #22c55e, transparent 75%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px oklch(0.6 0.15 145 / 0.3);
}

.decision-tree .jump-recommended-btn:active {
  transform: translateY(0);
}

.decision-tree .next-branch-btn {
  background: var(--accent-color, #3b82f6);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.decision-tree .next-branch-btn:hover:not(:disabled) {
  background: var(--accent-hover, #2563eb);
}

.decision-tree .next-branch-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.recommended-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Decision Tree - Redesigned Professional Styles */

/* Legend divider */
.legend-divider {
  width: 1px;
  height: 1rem;
  background: var(--panel-border);
  margin: 0 0.2rem;
}

/* Zoom badge */
.zoom-badge {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 42%);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 3.5rem;
  text-align: center;
}

/* Enhanced tree controls with backdrop blur */
.tree-controls {
  backdrop-filter: blur(8px);
  background: color-mix(in oklch, var(--panel), transparent 30%);
  padding: 0.5rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 50%);
  transition: opacity 200ms ease, transform 200ms ease;
}

.tree-controls.collapsed {
  display: none;
}

.tree-controls button {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 36px;
  transition: all 160ms ease;
}

.tree-controls button:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
  transform: translateY(-1px);
}

/* Enhanced legend with pill-shaped items */
.tree-legend {
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 15%);
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 50%);
  font-size: 0.75rem;
  gap: 0.7rem;
  transition: opacity 200ms ease, transform 200ms ease;
}

.tree-legend.collapsed {
  display: none;
}

/* Collapse toggle button */
.tree-collapse-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in oklch, var(--panel), transparent 30%);
  border: 1px solid color-mix(in oklch, var(--panel-border), transparent 50%);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 160ms ease;
  backdrop-filter: blur(8px);
}

.tree-collapse-toggle:hover {
  background: color-mix(in oklch, var(--panel), var(--accent) 12%);
  color: var(--accent);
  transform: translateY(-1px);
}

.legend-item {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
  transition: background-color 160ms ease;
}

.legend-item:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
}

.legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  box-shadow: 0 0 0 2px color-mix(in oklch, currentColor, transparent 85%);
}

/* Enhanced tooltip as card */
.tree-tooltip {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  background: color-mix(in oklch, var(--panel), white 30%);
  position: absolute;
  box-shadow: 0 4px 20px color-mix(in oklch, var(--shadow), transparent 30%);
  pointer-events: none;
  min-width: 180px;
  max-width: 280px;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tooltip-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  box-shadow: 0 0 0 2px color-mix(in oklch, currentColor, transparent 85%);
}

.tooltip-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
}

.tooltip-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.tooltip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.3rem;
  word-break: break-word;
}

.tooltip-importance {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tooltip-importance::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}

/* Node styling - pill shapes with shadows */
.node-rect {
  transition: all 0.2s ease;
}

.node.selected .node-rect {
  filter: drop-shadow(0 0 8px color-mix(in oklch, var(--node-selected), transparent 40%));
}

.node.recommended .node-rect {
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    stroke-opacity: 0.6;
    stroke-width: 2.5;
  }
  50% {
    stroke-opacity: 1;
    stroke-width: 3;
  }
}

/* Recommended glow rect */
.recommended-glow-rect {
  animation: recommended-pulse 2s ease-in-out infinite;
}

@keyframes recommended-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Importance bar animation */
.importance-bar {
  transition: width 0.3s ease;
}

/* Node label */
.node-label {
  text-shadow: 0 1px 2px color-mix(in oklch, black, transparent 70%);
}

/* Depth guide lines */
.depth-guide {
  pointer-events: none;
}

/* Inferred link dash animation */
@keyframes dash-flow {
  to {
    stroke-dashoffset: -4;
  }
}

/* Conversation Panel - Multi-Agent View Styles */
.conversation-panel .policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: color-mix(in oklch, var(--node-llm), transparent 85%);
  border: 1px solid color-mix(in oklch, var(--node-llm), transparent 60%);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--node-llm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conversation-panel .influence-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: color-mix(in oklch, var(--warning), transparent 85%);
  border-left: 2px solid var(--warning);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--warning);
}

.conversation-panel .policy-shift-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--accent), transparent 90%);
  border: 1px solid color-mix(in oklch, var(--accent), transparent 50%);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-deep);
}

.conversation-panel .shift-magnitude {
  font-weight: 700;
  color: var(--accent);
}

.conversation-panel .speaker-filter,
.conversation-panel .policy-filter {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 30%);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.conversation-panel .filter-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.conversation-panel .filter-pill:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
}

.conversation-panel .filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent-deep);
}

.conversation-panel .conversation-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid color-mix(in oklch, var(--panel-border), transparent 70%);
}

/* Live Dashboard Component Styles */
.live-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  text-align: left;
}

.dashboard-card:hover:not(:disabled) {
  background: color-mix(in oklch, var(--panel), var(--accent) 8%);
  border-color: color-mix(in oklch, var(--accent), var(--panel-border) 30%);
  transform: translateY(-1px);
}

.dashboard-card:disabled {
  cursor: default;
  opacity: 0.7;
}

.dashboard-card--static {
  cursor: default;
}

.dashboard-card--error {
  border-color: color-mix(in oklch, var(--danger), var(--panel-border) 50%);
  background: color-mix(in oklch, var(--panel), var(--danger) 6%);
}

.dashboard-meta {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* Smooth number transitions for dashboard metrics */
.dashboard-card strong,
.live-dashboard .analysis-strip strong,
.live-dashboard .stability-indicator strong {
  transition: color var(--duration-normal) var(--ease-out-quart);
}

.dashboard-meta--error {
  color: var(--danger);
  font-weight: 600;
}

/* Stability Indicator */
.stability-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  font-size: 0.85rem;
}

.stability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color 300ms ease;
}

.stability-indicator.stable .stability-dot {
  animation: stablePulse 3s ease-in-out infinite;
}

.stability-indicator.oscillating .stability-dot {
  animation: warningPulse 2s ease-in-out infinite;
}

.stability-indicator.problematic .stability-dot {
  animation: errorPulse 1.5s ease-in-out infinite;
}

.stability-count {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Dashboard Alerts Section */
.dashboard-alerts {
  margin-top: 0.5rem;
}

.dashboard-alerts h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-alert-list {
  display: grid;
  gap: 0.6rem;
}

.dashboard-alert-row {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  text-align: left;
}

.dashboard-alert-row:hover {
  transform: translateX(2px);
  background: color-mix(in oklch, var(--panel), var(--accent) 6%);
}

.dashboard-alert-row.medium {
  border-color: color-mix(in oklch, var(--warning), white 45%);
}

.dashboard-alert-row.high {
  border-color: color-mix(in oklch, var(--danger), white 45%);
  background: color-mix(in oklch, var(--panel), var(--danger) 6%);
}

.dashboard-alert-row.alert-derived {
  border-style: dashed;
  opacity: 0.9;
}

.dashboard-alert-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.dashboard-alert-head small {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-alert-signal {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-alert-empty {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

/* Dashboard Rolling Summary */
.dashboard-rolling {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
}

.dashboard-rolling h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.dashboard-rolling p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.rolling-window-info {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Dashboard Metrics */
.dashboard-metrics {
  margin-top: 0.5rem;
}

.dashboard-metrics h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.metric-badge {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--panel), var(--accent) 10%);
}

.metric-badge .badge-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.metric-badge .badge-value {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Checkpoint Delta Styles */
.checkpoint-delta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.delta-positive {
  color: var(--olive);
}

.delta-negative {
  color: var(--danger);
}

/* Stability Indicator Animations */
@keyframes stablePulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(var(--olive), 0.4);
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes warningPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(var(--warning), 0.4);
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes errorPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(var(--danger), 0.4);
  }
  50% {
    opacity: 0.5;
  }
}

.conversation-panel .filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conversation-panel .turn-goal {
  display: flex;
  gap: 0.25rem;
  align-items: baseline;
  margin-top: 0.25rem;
  padding: 0.2rem 0.4rem;
  background: color-mix(in oklch, var(--highlight-bg), transparent 50%);
  border-radius: 4px;
  font-size: 0.75rem;
}

.conversation-panel .turn-goal small {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.conversation-panel .turn-goal span {
  color: var(--text);
  font-weight: 500;
}

.conversation-panel .shift-from,
.conversation-panel .shift-to {
  font-weight: 600;
  font-family: 'Manrope', monospace;
  font-size: 0.65rem;
}

.conversation-panel .shift-from {
  color: var(--muted);
}

.conversation-panel .shift-to {
  color: var(--accent);
}

/* ============================================================================
   MULTI-AGENT COORDINATION PANEL STYLES
   ============================================================================ */

.coordination-panel {
  animation: fadeInUp 200ms ease;
}

.coordination-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.coordination-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.6rem;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
}

.coordination-metric .metric-label {
  font-size: 0.65rem;
  margin-bottom: 0.25rem;
}

.coordination-metric strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.coordination-metric small {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* Speaker Topology */
.speaker-topology {
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.speaker-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.speaker-bar-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  align-items: center;
}

.speaker-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-bar-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 0.6rem;
  background: color-mix(in oklch, var(--bg-strong), var(--muted) 15%);
  border-radius: 999px;
  overflow: hidden;
}

.speaker-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 300ms ease;
  min-width: 2px;
}

.speaker-turn-count {
  position: absolute;
  right: 0.4rem;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 0 2px color-mix(in oklch, var(--panel), white 50%);
}

/* Turn Timeline Strip */
.turn-timeline {
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.turn-strip {
  display: flex;
  gap: 2px;
  align-items: center;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.turn-cell {
  position: relative;
  width: 8px;
  height: 16px;
  border-radius: 2px;
  background: var(--node-default);
  transition: transform 150ms ease;
}

.turn-cell:hover {
  transform: scale(1.3);
  z-index: 1;
}

.turn-cell.escalation {
  background: var(--danger);
}

.turn-cell.policy-shift {
  background: var(--warning);
}

.turn-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.5rem;
  color: white;
  font-weight: 700;
}

.turn-ellipsis {
  width: auto;
  min-width: 24px;
  padding: 0 0.25rem;
  font-size: 0.55rem;
  color: var(--muted);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-indicator {
  font-size: 0.7rem;
}

/* Policy Pills */
.coordination-policies {
  padding: 0.75rem 0;
}

.policy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.policy-pill {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent), white 85%);
  border: 1px solid color-mix(in oklch, var(--accent), white 50%);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent-deep);
}

/* ============================================================================
   ENHANCED FAILURE CLUSTER PANEL STYLES
   ============================================================================ */

.cluster-bar-chart {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-bottom: 1rem;
  padding: 0 0.75rem;
}

.cluster-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease, opacity 200ms ease;
}

.cluster-bar:hover {
  opacity: 0.8;
}

.cluster-event-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--panel-border);
}

.cluster-event-detail small {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   MEDIA QUERIES
   ============================================================================ */

@media (max-width: 768px) {
  .coordination-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .speaker-bar-row {
    grid-template-columns: 1fr 1.5fr;
  }

  .turn-strip {
    gap: 1px;
  }

  .turn-cell {
    width: 6px;
    height: 12px;
  }
}

/* ============================================================================
   LATENCY WATERFALL IN TIMELINE
   ============================================================================ */

.latency-bar {
  display: flex;
  align-items: center;
  height: 4px;
  border-radius: 2px;
  transition: width 200ms ease, background-color 200ms ease;
  position: relative;
  min-width: 20px;
}

.latency-text {
  position: absolute;
  left: 100%;
  margin-left: 6px;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================================================
   EVENT TYPE FILTER CHIPS
   ============================================================================ */

.event-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 35%);
  border: 1px solid var(--panel-border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 160ms ease;
}

.filter-chip:hover {
  background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
  border-color: color-mix(in oklch, var(--panel-border), var(--muted) 30%);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: color-mix(in oklch, var(--accent), white 90%);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}

.filter-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: color-mix(in oklch, currentColor, transparent 85%);
  font-size: 0.65rem;
  font-weight: 600;
}

/* ============================================================================
   SESSION HEALTH SCORE
   ============================================================================ */

.session-header-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.health-grade-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 4px color-mix(in oklch, currentColor, transparent 70%);
}

.health-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--bg-strong), var(--muted) 20%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

/* Similar Failures Panel */
.similar-failures-panel {
  margin-top: var(--space-md);
}

.similar-failures-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.similar-failure-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-material);
}

.similar-failure-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px color-mix(in oklch, var(--accent), transparent 80%);
  transform: translateY(-1px);
}

.similar-failure-card.active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent), transparent 92%);
}

.failure-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.failure-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.failure-agent {
  font-weight: 600;
  color: var(--text);
}

.failure-framework {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.similarity-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.similarity-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.similarity-score {
  font-size: 0.9rem;
  font-weight: 700;
}

.failure-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.failure-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.detail-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.detail-value.failure-mode {
  font-weight: 600;
}

.failure-root-cause {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

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

.root-cause-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.failure-fix-note {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-sm);
  background: color-mix(in oklch, var(--success), transparent 92%);
  border-radius: 6px;
  border: 1px solid color-mix(in oklch, var(--success), transparent 80%);
}

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

.fix-note-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.view-session-link {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
}

.similar-failures-footer {
  padding: var(--space-sm) 0 0 0;
  text-align: center;
}

.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.error-state {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════
   ANIMATION UTILITY CLASSES
   GPU-accelerated only (transform + opacity)
   ═══════════════════════════════════════════════════════════ */

/* Entrance animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 oklch(0.65 0.2 145 / 0.4); }
  70% { box-shadow: 0 0 0 8px oklch(0.65 0.2 145 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.65 0.2 145 / 0); }
}

.fade-in { animation: fadeIn var(--duration-normal) var(--ease-out-quart) both; }
.slide-up { animation: slideUp var(--duration-slow) var(--ease-out-quart) both; }
.slide-in-left { animation: slideInLeft var(--duration-slow) var(--ease-out-quart) both; }
.slide-in-right { animation: slideInRight var(--duration-slow) var(--ease-out-quart) both; }
.scale-in { animation: scaleIn var(--duration-normal) var(--ease-out-quint) both; }
.shake-x { animation: shakeX 300ms var(--ease-material); }
.success-pulse { animation: successPulse 600ms var(--ease-out-quart); }

/* Stagger delays for sequenced reveals */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* Transition utilities */
.transition-colors {
  transition: color var(--duration-fast) var(--ease-out-quart),
              background-color var(--duration-fast) var(--ease-out-quart),
              border-color var(--duration-fast) var(--ease-out-quart);
}

.transition-transform {
  transition: transform var(--duration-fast) var(--ease-out-quart);
}

.transition-opacity {
  transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.transition-shadow {
  transition: box-shadow var(--duration-normal) var(--ease-out-quart);
}

/* Interactive hover/active feedback */
.interactive-hover {
  transition: transform var(--duration-fast) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
  will-change: transform;
}
.interactive-hover:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}
.interactive-hover:active {
  transform: scale(0.97);
}

/* Focus ring utility */
.focus-ring:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════
   LOADING PLACEHOLDERS & PERFORMANCE
   ═══════════════════════════════════════════════════════════ */

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--muted);
  font-size: 0.875rem;
}

.skeleton {
  background: linear-gradient(90deg,
    oklch(0.93 0.02 80) 25%,
    oklch(0.96 0.01 80) 50%,
    oklch(0.93 0.02 80) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-sm);
}

.skeleton-heading {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-card {
  height: 80px;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
}

/* Containment for heavy scrollable lists */
.session-rail-list {
  contain: strict;
}

.trace-timeline-list {
  contain: layout style;
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION — Accessibility
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════
	   ALERT DASHBOARD PANEL STYLES
	   ═══════════════════════════════════════════════════════════ */

.alert-dashboard {
	padding: 1.4rem;
}

.alert-dashboard .panel-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 1.3rem 1.5rem 1rem;
	border-bottom: 1px solid color-mix(in oklch, var(--panel-border), transparent 40%);
	margin-bottom: 1rem;
	background: linear-gradient(180deg, color-mix(in oklch, var(--panel), var(--bg-strong) 8%) 0%, transparent 100%);
	border-radius: 1.3rem 1.3rem 0 0;
}

.alert-dashboard .panel-head .eyebrow {
	margin: 0 0 0.3rem;
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
}

.alert-dashboard .panel-head h2 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: -0.025em;
}

/* Summary Cards */
.alert-summary-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.alert-card {
	display: grid;
	gap: 0.35rem;
	padding: 1.25rem;
	border-radius: 1.2rem;
	background: color-mix(in oklch, var(--panel), var(--accent) 4%);
	border: 1px solid color-mix(in oklch, var(--panel-border), var(--accent) 22%);
	text-align: center;
	transition: all var(--duration-normal) var(--ease-material);
	box-shadow: 0 2px 8px color-mix(in oklch, var(--muted), transparent 85%);
}

.alert-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px color-mix(in oklch, var(--muted), transparent 70%);
}

.alert-card .metric-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--muted);
}

.alert-card strong {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text);
}

.alert-card--critical {
	background: color-mix(in oklch, var(--panel), var(--danger) 6%);
	border-color: color-mix(in oklch, var(--panel-border), var(--danger) 25%);
}

.alert-card--critical strong {
	color: var(--danger);
}

.alert-card--warning {
	background: color-mix(in oklch, var(--panel), var(--warning) 6%);
	border-color: color-mix(in oklch, var(--panel-border), var(--warning) 25%);
}

.alert-card--warning strong {
	color: var(--warning);
}

.alert-card--info {
	background: color-mix(in oklch, var(--panel), var(--accent) 6%);
	border-color: color-mix(in oklch, var(--panel-border), var(--accent) 25%);
}

.alert-card--info strong {
	color: var(--accent);
}

/* Filter Bar */
.alert-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	padding: 1rem;
	border-radius: 1rem;
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 25%);
	margin-bottom: 1rem;
}

.alert-filter-bar .filter-select {
	padding: 0.6rem 0.9rem;
	border-radius: 0.8rem;
	border: 1px solid var(--panel-border);
	background: color-mix(in oklch, var(--panel), white 50%);
	color: var(--text);
	font-size: 0.85rem;
	cursor: pointer;
	transition: all var(--duration-normal) var(--ease-material);
}

.alert-filter-bar .filter-select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), transparent 80%);
}

.alert-filter-bar .clear-filters-btn {
	padding: 0.6rem 1rem;
	border-radius: 0.8rem;
	background: color-mix(in oklch, var(--muted), white 85%);
	border: 1px solid var(--panel-border);
	color: var(--text);
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--duration-normal) var(--ease-material);
}

.alert-filter-bar .clear-filters-btn:hover {
	background: color-mix(in oklch, var(--muted), white 75%);
	transform: translateY(-1px);
}

.alert-filter-bar .bulk-acknowledge-btn {
	padding: 0.6rem 1rem;
	border-radius: 0.8rem;
	background: color-mix(in oklch, var(--accent), white 85%);
	border: 1px solid color-mix(in oklch, var(--accent), white 50%);
	color: var(--accent-deep);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--duration-normal) var(--ease-material);
}

.alert-filter-bar .bulk-acknowledge-btn:hover {
	background: color-mix(in oklch, var(--accent), white 75%);
	transform: translateY(-1px);
}

/* Alert List */
.alert-list {
	display: grid;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.alert-row {
	position: relative;
	padding: 1rem 1.1rem;
	padding-left: 1.3rem;
	border-radius: 1rem;
	border: 1px solid var(--panel-border);
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 34%);
	text-align: left;
	cursor: pointer;
	transition: all var(--duration-normal) var(--ease-material);
	border-left: 4px solid transparent;
}

.alert-row:hover {
	transform: translateX(2px);
	box-shadow: 0 4px 12px color-mix(in oklch, var(--muted), transparent 70%);
}

.alert-row::before {
	content: '';
	position: absolute;
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--muted);
}

.alert-row--active {
	border-left-color: var(--danger);
	background: color-mix(in oklch, var(--panel), var(--danger) 8%);
}

.alert-row--active::before {
	background: var(--danger);
}

.alert-row--acknowledged {
	border-left-color: var(--warning);
	background: color-mix(in oklch, var(--panel), var(--warning) 6%);
}

.alert-row--acknowledged::before {
	background: var(--warning);
}

.alert-row--resolved {
	border-left-color: var(--olive);
	background: color-mix(in oklch, var(--panel), var(--olive) 6%);
	opacity: 0.85;
}

.alert-row--resolved::before {
	background: var(--olive);
}

.alert-row--dismissed {
	border-left-color: var(--muted);
	background: color-mix(in oklch, var(--panel), var(--muted) 6%);
	opacity: 0.7;
}

.alert-row--dismissed::before {
	background: var(--muted);
}

.alert-row-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.alert-row-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.alert-severity-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px color-mix(in oklch, currentColor, white 70%);
}

.alert-type {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.alert-severity {
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
}

.alert-status {
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 50%);
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
}

.alert-time {
	font-size: 0.75rem;
	color: var(--muted);
}

.alert-signal {
	margin: 0.5rem 0;
	font-size: 0.9rem;
	color: var(--text);
	line-height: 1.5;
}

/* Alert Details */
.alert-details {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--panel-border);
	display: grid;
	gap: 0.75rem;
}

.alert-detail-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
}

.alert-detail-label {
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.alert-detail-value {
	color: var(--text);
	font-weight: 500;
	text-align: right;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.alert-resolution {
	display: grid;
	gap: 0.5rem;
	padding: 0.75rem;
	border-radius: 0.75rem;
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 30%);
	margin-top: 0.5rem;
}

.alert-resolution label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.alert-resolution .resolution-input {
	width: 100%;
	padding: 0.6rem 0.8rem;
	border-radius: 0.6rem;
	border: 1px solid var(--panel-border);
	background: var(--panel);
	font-size: 0.85rem;
	resize: vertical;
	transition: border-color 0.2s ease;
}

.alert-resolution .resolution-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), transparent 80%);
}

.alert-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.alert-action-btn {
	padding: 0.5rem 0.9rem;
	border-radius: 0.6rem;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 160ms ease;
	border: 1px solid transparent;
}

.alert-action-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.alert-action-btn--acknowledge {
	background: color-mix(in oklch, var(--accent), white 85%);
	border-color: color-mix(in oklch, var(--accent), white 50%);
	color: var(--accent-deep);
}

.alert-action-btn--acknowledge:hover:not(:disabled) {
	background: color-mix(in oklch, var(--accent), white 75%);
	transform: translateY(-1px);
}

.alert-action-btn--resolve {
	background: color-mix(in oklch, var(--olive), white 85%);
	border-color: color-mix(in oklch, var(--olive), white 50%);
	color: var(--olive);
}

.alert-action-btn--resolve:hover:not(:disabled) {
	background: color-mix(in oklch, var(--olive), white 75%);
	transform: translateY(-1px);
}

.alert-action-btn--dismiss {
	background: color-mix(in oklch, var(--muted), white 85%);
	border-color: color-mix(in oklch, var(--panel-border), var(--muted) 30%);
	color: var(--muted);
}

.alert-action-btn--dismiss:hover {
	background: color-mix(in oklch, var(--muted), white 75%);
	transform: translateY(-1px);
}

/* Trending Section */
.trending-section {
	margin-top: 1.5rem;
	padding: 1rem;
	border-radius: 1rem;
	background: color-mix(in oklch, var(--panel), var(--bg-strong) 20%);
}

.trending-section h3 {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--muted);
}

.trending-bars {
	display: flex;
	gap: 4px;
	align-items: flex-end;
	height: 120px;
	padding: 0.5rem 0;
}

.trending-bar-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	height: 100%;
}

.trending-bar {
	width: 100%;
	background: linear-gradient(180deg, var(--accent) 0%, color-mix(in oklch, var(--accent), var(--bg) 30%) 100%);
	border-radius: 4px 4px 0 0;
	transition: height 300ms ease;
	min-height: 4px;
	position: relative;
}

.trending-bar:hover {
	background: linear-gradient(180deg, var(--olive) 0%, color-mix(in oklch, var(--olive), var(--bg) 30%) 100%);
}

.trending-label {
	font-size: 0.65rem;
	color: var(--muted);
	text-align: center;
	transform: rotate(-45deg);
	transform-origin: center;
	white-space: nowrap;
	margin-top: 0.25rem;
}

/* Loading and Empty States */
.alert-dashboard .loading-state {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 3rem 2rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.alert-dashboard .empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 3rem 2rem;
	gap: 0.75rem;
	min-height: 200px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.alert-summary-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.alert-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.alert-filter-bar .filter-select,
	.alert-filter-bar .clear-filters-btn,
	.alert-filter-bar .bulk-acknowledge-btn {
		width: 100%;
	}

	.alert-actions {
		flex-direction: column;
	}

	.alert-action-btn {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.alert-summary-cards {
		grid-template-columns: 1fr;
	}

	.alert-dashboard {
		padding: 1rem;
	}

	.alert-dashboard .panel-head {
		padding: 1rem;
	}
}

/* Checkpoint State Diff */
.checkpoint-state-diff {
  margin-top: 0.75rem;
}
.diff-context {
  margin-bottom: 0.5rem;
}
.diff-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #888);
}
.diff-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.diff-stat {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.diff-stat.diff-added {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.diff-stat.diff-removed {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.diff-stat.diff-changed {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.diff-unchanged {
  color: var(--text-secondary, #888);
  font-style: italic;
  font-size: 0.85rem;
}
.diff-entries {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.diff-entry {
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  padding: 0.5rem;
}
.diff-entry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.diff-type-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
}
.diff-added .diff-type-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.diff-removed .diff-type-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.diff-changed .diff-type-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.diff-key {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
}
.diff-old, .diff-new {
  margin-top: 0.25rem;
}
.diff-old pre, .diff-new pre {
  font-size: 0.7rem;
  padding: 0.25rem;
  border-radius: 3px;
  max-height: 120px;
  overflow-y: auto;
}
.diff-old pre {
  background: rgba(239, 68, 68, 0.05);
  border-left: 2px solid #ef4444;
}
.diff-new pre {
  background: rgba(34, 197, 94, 0.05);
  border-left: 2px solid #22c55e;
}
