/* QStrike SPA pre-hydration skeleton + <noscript> fallback styles.
 * Loaded from index.html; replaced by React on hydrate (skeleton sits inside #root and React's createRoot
 * replaces children on first render, so there is no hydration mismatch). External stylesheet keeps the
 * page CSP-clean (style-src 'self') without bloating the index.html sha256 allowlist. */

/* EGG CLS fix 2026-05-19 — define JetBrains Mono @font-face in the SKELETON
 * stylesheet (loaded synchronously in <head>) instead of only in the bundled
 * index.css (loaded after JS). With font-display: optional, the browser uses
 * the font ONLY if it loads within the ~100ms block period; otherwise it keeps
 * the fallback for the page lifecycle and NEVER swaps. This removes the
 * font-swap reflow of the SSR ops-console-band that was the dominant CLS source
 * (0.39 mobile). The Regular + Bold woff2 are preloaded in index.html so they
 * usually win the block period on first paint. */
@font-face {
  font-family: JetBrains Mono;
  src: url(/fonts/JetBrainsMono-Regular.woff2) format(woff2);
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: JetBrains Mono;
  src: url(/fonts/JetBrainsMono-Bold.woff2) format(woff2);
  font-weight: 700;
  font-style: normal;
  font-display: optional;
}

/* EGG CLS fix 2026-05-19 — mirror the index.css density-aware root font-size
 * in the skeleton stylesheet so rem-based SSR content (the ops console band)
 * is sized correctly from FIRST paint. Without this, html starts at the
 * browser-default 16px during the skeleton phase, then index.css applies
 * calc(16px * 0.8 compact-density) = 12.8px on load, shrinking every rem unit
 * ~20% and reflowing the band (dominant CLS source 0.30 mobile). The
 * data-density attribute is also set synchronously in main.tsx so the var is
 * present before index.css. */
html { font-size: calc(16px * var(--c2-density-scale, 0.8)); }
body { font-size: calc(15px * var(--c2-density-scale, 0.8)); }
[data-density='compact'] { --c2-density-scale: 0.8; }
[data-density='comfortable'] { --c2-density-scale: 1; }
[data-density='showroom'] { --c2-density-scale: 1.08; }


.qs-skeleton {
  background: #0a0e1a;
  color: #e0e6ed;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
}

.qs-skeleton-banner {
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  letter-spacing: 0.18em;
  color: #FF003C;
  font-weight: 600;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qs-skeleton-title {
  font-size: clamp(1.5rem, 1.25rem + 0.75vw, 2rem);
  letter-spacing: 0.05em;
  color: #ffffff;
  margin: 0;
  font-weight: 700;
}

.qs-skeleton-sub {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.qs-skeleton-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.qs-skeleton-tabs span {
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qs-noscript {
  background: #0a0e1a;
  color: #e0e6ed;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  box-sizing: border-box;
}

.qs-noscript h1 {
  color: #ffffff;
  font-size: 1.5rem;
  margin-top: 0;
  letter-spacing: 0.02em;
}

.qs-noscript a {
  color: #FF003C;
  text-decoration: underline;
}

.qs-noscript pre {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.qs-noscript code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.qs-noscript ul {
  line-height: 1.7;
}

.qs-noscript-foot {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  letter-spacing: 0.05em;
}

/* ============================================================
 * Hero strip (build-time injected by scripts/inject-skeleton-strips.mjs).
 * Lives inside #root, auto-removed by React's createRoot on hydrate.
 * Provides immediate above-the-fold content for the ~3.7-4.1s window
 * before React mounts. Per CHROMASWARM allowlist + CSP style-src 'self'.
 * ============================================================ */

.qs-skeleton-hero {
  max-width: 1200px;
  margin: 1.25rem auto 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.qs-skeleton-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  font-size: 1.05rem;
  color: var(--color-text-primary);
}

.qs-metric strong {
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.qs-metric-label {
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 0.92rem;
}

.qs-metric-divider {
  color: var(--color-text-inactive);
  font-weight: 400;
}

.qs-skeleton-orient {
  margin: 0.6rem 0 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.qs-skeleton-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
}

.qs-prov-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.qs-prov-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  color: var(--color-text-tertiary);
}

.qs-prov-item code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .qs-skeleton-hero {
    margin: 0.75rem 0.5rem 0.5rem;
    padding: 0.75rem 0.85rem;
  }
  .qs-skeleton-metrics { font-size: 0.95rem; }
}

/* ───────────────────────────────────────────────────────────────────────
 * Phase 1.2 — Ops Console Band (SSR-rendered above the theater chrome).
 * Source of truth: scripts/lib/opsConsoleBandHtml.mjs +
 *   src/app/components/theater/OpsConsoleBand.tsx
 * Cyberpunk-aesthetic, professional-balanced (per owner directive 2026-05-14).
 * Dark base #0a0e1a, cyan accent #00f0ff, amber stage glow #ffb800.
 * ─────────────────────────────────────────────────────────────────────── */

.qs-ops-console-band {
  background: linear-gradient(180deg, #0a0e1a 0%, #0f1525 100%);
  border-bottom: 1px solid var(--color-accent-glow);
  color: #e0e6ed;
  padding: 0.65rem 1.5rem 0.55rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* EGG CLS fix 2026-05-19 -- pin base font-size/line-height so the band
   * does NOT inherit the body font-size jump (browser-default 16px ->
   * index.css 12px once bundled CSS loads = uniform ~20% text shrink that
   * reflowed the whole band, the dominant CLS source 0.30 mobile). 12px
   * matches the settled value (15px * 0.8 density). */
  font-size: 12px;
  line-height: 1.38;
  box-sizing: border-box;
  width: 100%;
  /* EGG CLS fix 2026-05-19 -- reserve a stable height in the default top-band
   * layout so the brief initial flex-wrap reflow of mission-clock / stage
   * pipeline / verify rows does NOT change band height and shove the hero strip
   * + #root downstream. Dominant CLS source (0.30 mobile, 0.73 desktop). The
   * egg-wave-b LEFT-RAIL mode overrides with height:100vh below, unaffected.
   * 200px holds the settled multi-row mobile band (~197px). */
  min-height: 200px;
}

.qs-ops-band-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.qs-ops-band-row-main {
  justify-content: space-between;
  /* EGG CLS fix 2026-05-19 -- nowrap so the 3 band columns never wrap to a
   * second row on the first layout pass and then collapse (the 262->200px
   * band shrink that shoved #root up 162px = dominant CLS source). */
  flex-wrap: nowrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.qs-ops-band-col {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.qs-ops-band-col-left {
  flex: 0 0 auto;
}

.qs-ops-band-col-center {
  flex: 1 1 auto;
  justify-content: center;
  /* EGG CLS fix 2026-05-19 -- stage pills stay on one row (no wrap-collapse). */
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 0.4rem;
}

.qs-ops-band-col-right {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* LEFT — mission clock */
.qs-ops-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.18em;
  color: #00f0ff;
  font-weight: 600;
}

.qs-ops-live-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 1) 0%, rgba(0, 240, 255, 0.8) 60%, rgba(0, 240, 255, 0.4) 100%);
  box-shadow: 0 0 6px var(--color-accent-primary);
  /* EGG Wave C #8: pulse-glow via named animation qs-live-pulse (hardgreen-whitelisted). */
  animation: qs-live-pulse 1s ease-in-out infinite;
}

/* qs-live-dot alias for EGG Wave C #8 — coexists with qs-ops-live-dot SSR class. */
.qs-live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 1) 0%, rgba(0, 240, 255, 0.8) 60%, rgba(0, 240, 255, 0.4) 100%);
  animation: qs-live-pulse 1s ease-in-out infinite;
}

@keyframes qs-live-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(0, 240, 255, 0.7),
      0 0 12px 4px rgba(0, 240, 255, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(0, 240, 255, 0),
      0 0 16px 6px rgba(0, 240, 255, 0.05);
  }
}

/* Legacy keyframe retained for backward compat (unused). */
@keyframes qs-ops-live-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .qs-ops-live-dot,
  .qs-live-dot {
    animation: none;
  }
}

.qs-ops-clock-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.qs-ops-clock-prefix {
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.18em;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

.qs-ops-clock-digits {
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.qs-ops-stage-line {
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.14em;
  color: rgba(255, 184, 0, 0.85);
  text-transform: uppercase;
  margin-left: 0.55rem;
}

/* CENTER — 4-stage pipeline pills */
.qs-ops-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-tertiary);
  background: rgba(255, 255, 255, 0.025);
}

.qs-ops-stage-pill::after {
  content: "▸";
  margin-left: 0.35rem;
  color: var(--color-text-inactive);
}

.qs-ops-stage-pill:last-of-type::after {
  content: "";
  margin-left: 0;
}

.qs-ops-stage-complete {
  color: var(--color-accent-secondary);
  border-color: var(--color-accent-inactive);
  background: var(--color-accent-glow);
}

.qs-ops-stage-current {
  color: #ffffff;
  border-color: rgba(255, 184, 0, 0.55);
  background: rgba(255, 184, 0, 0.07);
  box-shadow: 0 0 12px rgba(255, 184, 0, 0.18);
  /* Phase 1.4: glow animation removed to satisfy zero-ambient-motion contract */
}

@keyframes qs-ops-stage-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 184, 0, 0.15); }
  50%      { box-shadow: 0 0 18px rgba(255, 184, 0, 0.35); }
}

.qs-ops-stage-future {
  color: var(--color-text-inactive);
  border-style: dashed;
}

.qs-ops-stage-glyph {
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  line-height: 1;
}

.qs-ops-stage-label {
  font-weight: 600;
}

/* RIGHT — verify-run badge */
.qs-ops-verify-meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.qs-ops-verify-label {
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.18em;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

.qs-ops-verify-sha {
  font-size: 0.78rem;
  color: #00f0ff;
  background: var(--color-accent-glow);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--color-accent-inactive);
}

.qs-ops-verify-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  letter-spacing: 0.12em;
  color: #0a0e1a;
  background: #00f0ff;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: filter 120ms ease-out;
}

.qs-ops-verify-cta:hover,
.qs-ops-verify-cta:focus-visible {
  filter: brightness(1.15);
  outline: 2px solid var(--color-accent-tertiary);
  outline-offset: 2px;
}

.qs-ops-verify-cmd {
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  color: var(--color-text-tertiary);
  max-width: 18rem;
}

.qs-ops-verify-cmd summary {
  cursor: pointer;
  color: var(--color-accent-secondary);
  letter-spacing: 0.08em;
}

.qs-ops-verify-cmd pre {
  margin: 0.35rem 0 0;
  padding: 0.35rem 0.55rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.71rem; /* EGG visual-realism fix: >=9px at compact density */
  white-space: pre;
  line-height: 1.45;
}

/* BOTTOM — event ticker */
.qs-ops-band-row-ticker {
  padding-top: 0.5rem;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
}

.qs-ops-ticker-marker {
  color: #00f0ff;
  font-weight: 700;
}

.qs-ops-ticker-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.qs-ops-ticker-ts {
  color: rgba(255, 184, 0, 0.8);
  font-variant-numeric: tabular-nums;
}

.qs-ops-ticker-vendor {
  color: var(--color-accent-secondary);
}

.qs-ops-ticker-text {
  color: var(--color-text-secondary);
}

/* Responsive collapse */
@media (max-width: 920px) {
  .qs-ops-console-band {
    padding: 0.55rem 0.85rem 0.5rem;
  }
  .qs-ops-band-col-right {
    width: 100%;
    justify-content: space-between;
  }
  .qs-ops-stage-line {
    margin-left: 0.25rem;
  }
}

@media (max-width: 640px) {
  .qs-ops-band-row-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }
  .qs-ops-band-col-center {
    justify-content: flex-start;
  }
  .qs-ops-verify-cmd {
    max-width: 100%;
  }
}

/* ───────────────────────────────────────────────────────────────────────────
 * EGG Wave B — Layout / Deadspace Fix (#1 #2 #4 #5)
 * Item #1: relocate SSR ops console band to 64px left rail on desktop
 * Item #2: vertical-nav + horizontal sub-tabs styles
 * Item #4: hard-left mini-KPI tile row
 * Item #5: master-detail split layout helpers
 * ─────────────────────────────────────────────────────────────────────── */

/* ITEM #1 — Left Status Rail (CSS relocation of existing SSR ops band) */
@media (min-width: 1024px) {
  /* Push entire theater right by 64px to make room for left rail */
  body[data-egg-wave-b] {
    --qs-left-rail-w: 64px;
  }
  /* Relocate the SSR-injected ops band from a horizontal top band into a fixed left rail.
     We keep all the data-testids (ops-console-band, mission-clock, stage-pipeline, verify-run,
     event-ticker) but change visual layout. */
  body[data-egg-wave-b] .qs-ops-console-band {
    position: fixed;
    top: 0;
    left: 0;
    width: 64px;
    height: 100vh;
    z-index: 50;
    padding: 0.5rem 0.25rem;
    border-bottom: none;
    border-right: 1px solid rgba(0, 240, 255, 0.15);
    overflow: hidden;
    transition: width 200ms ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.6rem;
  }
  body[data-egg-wave-b] .qs-ops-console-band:hover {
    width: 240px;
    overflow-y: auto;
  }
  /* Stack rows vertically inside the rail */
  body[data-egg-wave-b] .qs-ops-band-row {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }
  body[data-egg-wave-b] .qs-ops-band-row-main {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-bottom: 0.5rem !important;
  }
  body[data-egg-wave-b] .qs-ops-band-col {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    text-align: center;
  }
  /* Compact rail-mode font sizing */
  body[data-egg-wave-b] .qs-ops-console-band {
    font-size: 9px;
    line-height: 1.1;
  }
  body[data-egg-wave-b] .qs-ops-console-band:hover {
    font-size: 11px;
  }
  /* Stage pills become a vertical column */
  body[data-egg-wave-b] [data-testid="stage-pipeline"] {
    flex-direction: column !important;
    gap: 0.25rem;
  }
  body[data-egg-wave-b] .qs-ops-stage-pill {
    width: 100%;
    justify-content: center;
  }
  /* Event ticker truncates aggressively in rail mode */
  body[data-egg-wave-b] [data-testid="event-ticker"] .qs-ops-ticker-text {
    display: none;
  }
  body[data-egg-wave-b] .qs-ops-console-band:hover [data-testid="event-ticker"] .qs-ops-ticker-text {
    display: inline;
  }
  /* Push main app content to the right of the rail */
  body[data-egg-wave-b] [data-testid="theater-root"],
  body[data-egg-wave-b] .qs-app-content {
    margin-left: 64px;
  }
}
/* On mobile/short-viewport, keep the original top-band layout (responsive fallback) */

/* ITEM #2 — Vertical Nav rail + horizontal sub-tabs */
.qs-vertical-nav {
  /* EGG visual-realism fix: 200 -> 224px so nav labels fit without ellipsis clip. */
  width: 224px;
  flex-shrink: 0;
  background: var(--color-surface-1, #0f1525);
  border-right: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  align-self: flex-start;
  max-height: 100vh;
}
.qs-vertical-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.5rem;
  border-radius: 4px;
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.7));
  font-size: 12px;
  text-transform: uppercase;
  /* EGG visual-realism fix: tighter tracking + gap so labels fit (no clip). */
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  border-top: 2px solid transparent;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  background: transparent;
}
.qs-vertical-nav-item:hover {
  background: rgba(155, 127, 247, 0.08);
  color: var(--color-text-primary, #e0e6ed);
}
.qs-vertical-nav-item[data-active="true"] {
  background: rgba(155, 127, 247, 0.12);
  color: #d4bfff;
  border-top-color: #9b7ff7;
}
.qs-vertical-nav-icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.qs-vertical-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Horizontal sub-tabs (inside each tab content pane) */
.qs-sub-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(15, 21, 37, 0.6);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto;
}
.qs-sub-tab-item {
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.65));
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}
.qs-sub-tab-item:hover {
  color: #d4bfff;
  background: rgba(155, 127, 247, 0.06);
}
.qs-sub-tab-item[data-active="true"] {
  color: #d4bfff;
  background: rgba(155, 127, 247, 0.15);
  border-color: rgba(155, 127, 247, 0.4);
}

/* ITEM #4 — Hard-left mini-KPI tile row */
.qs-kpi-row {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface-1, #0f1525);
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto;
}
.qs-kpi-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0.25rem 1rem;
  border-right: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  min-width: max-content;
}
.qs-kpi-tile:last-child {
  border-right: none;
}
.qs-kpi-tile-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary, #e0e6ed);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.qs-kpi-tile-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-tertiary, rgba(224, 230, 237, 0.55));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}
.qs-kpi-tile-build {
  cursor: pointer;
}
.qs-kpi-tile-build:hover .qs-kpi-tile-value {
  color: #9b7ff7;
}

/* ITEM #5 — Master-detail split layout helpers */
.qs-master-detail-split {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
  padding: 0.5rem;
}
.qs-master-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  background: var(--color-surface-1, #0f1525);
  border: 1px solid var(--color-border-subtle, rgba(155, 127, 247, 0.25));
  border-radius: 4px;
  padding: 0.5rem;
  min-height: 0;
}
.qs-master-list-item {
  padding: 0.5rem 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.7));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 120ms ease, border-color 120ms ease;
}
.qs-master-list-item:hover {
  background: rgba(155, 127, 247, 0.06);
  color: #d4bfff;
}
.qs-master-list-item[data-selected="true"] {
  background: rgba(155, 127, 247, 0.14);
  border-color: rgba(155, 127, 247, 0.45);
  color: #d4bfff;
}
.qs-detail-pane {
  background: var(--color-surface-1, #0f1525);
  border: 1px solid var(--color-border-subtle, rgba(155, 127, 247, 0.25));
  border-radius: 4px;
  padding: 0.75rem;
  overflow-y: auto;
  min-height: 0;
}
.qs-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-tertiary, rgba(224, 230, 237, 0.5));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* EGG Wave B — suppress legacy centered hero when new KPI row is active */
@media (min-width: 1024px) {
  body[data-egg-wave-b]:not([data-focus-mode=true]) [data-testid="public-command-deck"] {
    display: none !important;
  }
  body[data-egg-wave-b] [data-testid="theater-kpi-hero"] {
    display: none !important;
  }
}


/* EGG Wave B — suppress skeleton hero strip (SSR injection) when KPIRow takes over */
@media (min-width: 1024px) {
  body[data-egg-wave-b] #skeleton-hero-root {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   EGG Wave C — realism CSS additions (#16 EKG sweep, #19 card meta-row,
   #20 stage pill tooltip + interactive hover).
   These named keyframes (qs-live-pulse, qs-ekg-sweep) are whitelisted in
   tests/public-demo-hardgreen.spec.ts via the named-animation allowlist.
   All other ambient animations remain forbidden.
   ───────────────────────────────────────────────────────────────────────── */

/* #16 — EKG / radar sweep bar under ops band */
.qs-ops-console-band {
  position: relative; /* anchor for the absolute-positioned sweep bar */
}

.qs-ekg-sweep {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  height: 2px;
  width: 200px;
  background: linear-gradient(90deg, transparent 0%, #00f0ff 50%, transparent 100%);
  pointer-events: none;
  animation: qs-ekg-sweep 4s linear infinite;
  /* EGG geometry fix 2026-05-19 — clip to anchor (ops-console-band) so translateX(100vw)
   * keyframe end does not contribute to body bounding-rect overflow. */
  clip-path: inset(0 0 0 0);
}

/* EGG geometry fix 2026-05-19 — anchor MUST clip overflowing children. */
.qs-ops-console-band {
  overflow-x: hidden;
}

@keyframes qs-ekg-sweep {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(100vw); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .qs-ekg-sweep {
    animation: none;
    opacity: 0.3;
    transform: translateX(0);
  }
}

/* #17 — tail-style 4-line event ticker (replaces single rotating line) */
.qs-ops-ticker-tail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  line-height: 1.3;
  /* EGG CLS fix 2026-05-19 — reserve fixed height so SSR-placeholder -> React-data
   * ticker swap does NOT reflow surrounding layout (was dominant CLS source:
   * 0.32 mobile / 0.73 desktop). */
  height: 4.1rem;
  overflow: hidden;
}

.qs-ops-ticker-tail-line {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  min-height: 1rem;
  opacity: 1;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
  /* EGG CLS fix 2026-05-19 — single-line, ellipsis-clipped so a long event
   * string can never wrap to a second visual row and grow the tail height. */
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}

.qs-ops-ticker-tail-line > .qs-ops-ticker-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.qs-ops-ticker-tail-line[data-tail-position="0"] {
  opacity: 0.4;
}
.qs-ops-ticker-tail-line[data-tail-position="1"] {
  opacity: 0.65;
}
.qs-ops-ticker-tail-line[data-tail-position="2"] {
  opacity: 0.85;
}
.qs-ops-ticker-tail-line[data-tail-position="3"] {
  opacity: 1;
  color: #ffffff;
}

.qs-ops-ticker-vendor-side-channel  { color: #FFB800; }
.qs-ops-ticker-vendor-key-compromise,
.qs-ops-ticker-vendor-ransomware    { color: #FF003C; }
.qs-ops-ticker-vendor-supply-chain  { color: #9B7FF7; }
.qs-ops-ticker-vendor-default       { color: rgba(224, 230, 237, 0.7); }

/* #19 — per-card meta-row (T+timestamp · confidence · platforms) */
.qs-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  color: rgba(224, 230, 237, 0.55);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qs-card-meta .qs-mono {
  font-variant-numeric: tabular-nums;
  color: rgba(0, 240, 255, 0.7);
}

.qs-card-meta .qs-confidence {
  color: rgba(224, 230, 237, 0.7);
}

.qs-card-meta .qs-text-tertiary {
  color: rgba(224, 230, 237, 0.4);
}

.qs-card-meta .qs-divider {
  color: rgba(224, 230, 237, 0.25);
  user-select: none;
}

/* #20 — stage pill interactive (hover/focus + tooltip) */
.qs-ops-stage-pill {
  cursor: pointer;
  position: relative;
  background-color: transparent;
  font-family: inherit;
  outline: none;
  transition: border-color 120ms ease-out, color 120ms ease-out, background-color 120ms ease-out;
}

.qs-ops-stage-pill:hover,
.qs-ops-stage-pill:focus-visible {
  border-color: rgba(0, 240, 255, 0.65);
  color: #ffffff;
  background: rgba(0, 240, 255, 0.08);
}

.qs-ops-stage-pill:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.55);
  outline-offset: 1px;
}

.qs-stage-tooltip {
  position: absolute;
  display: none;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0a0e1a;
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.72rem; /* EGG visual-realism: >=9px @ compact density */
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  color: rgba(224, 230, 237, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qs-stage-tooltip > div:first-child {
  color: #00f0ff;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


.qs-ops-stage-pill:hover .qs-stage-tooltip,
.qs-ops-stage-pill:focus-visible .qs-stage-tooltip,
.qs-ops-stage-pill:focus-within .qs-stage-tooltip {
  display: flex;
}

/* ============================================================================
 * EGG Wave D — Polish (#7 #9 #10 #11 #13 #14 #18 #21 #22 #23 #25)
 *
 * Pure CSS additions on top of Wave A tokens + Wave B layout + Wave C realism.
 * No existing rule is rewritten; everything here is additive and scoped to new
 * class names or new data-attributes.
 * ========================================================================= */

/* ---------------------------------------------------------------------------
 * Wave D #7 — 1% noise / dot-matrix overlay on the main content area
 * --------------------------------------------------------------------------- */
.qs-content-area {
  position: relative;
  /* Keep existing content above the overlay (overlay z-index 1; content z-index 2 via positioning) */
}
.qs-content-area::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url(data:image/svg+xml,%3Csvg xmlns=http://www.w3.org/2000/svg width=4 height=4%3E%3Ccircle cx=2 cy=2 r=0.5 fill=white fill-opacity=0.04/%3E%3C/svg%3E);
  background-size: 4px 4px;
  opacity: 1; /* fill is already at 0.04 alpha; ~1% perceptual */
  mix-blend-mode: screen;
}
.qs-content-area > * {
  position: relative;
  z-index: 2;
  max-width: 100%;
  min-width: 0;
}

/* EGG geometry fix 2026-05-19 — viewport-rooted overflow clip on the content area. */
.qs-content-area {
  max-width: 100%;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  .qs-content-area::before { opacity: 0.6; }
}

/* ---------------------------------------------------------------------------
 * Wave D #9 — Active tab: 2px violet top-border accent + bg-lift (surface-1)
 * Layered on top of Wave B's .qs-vertical-nav-item[data-active=true] rule.
 * --------------------------------------------------------------------------- */
.qs-vertical-nav-item[data-active=true] {
  border-top-width: 2px;
  border-top-style: solid;
  border-top-color: var(--color-stage-current, #9B7FF7);
  background: var(--color-surface-1, #11141C);
  color: var(--color-text-primary, #E0E6ED);
  box-shadow: inset 0 0 0 1px rgba(155, 127, 247, 0.12);
}
.qs-sub-tab-item[data-active=true] {
  border-top: 2px solid var(--color-stage-current, #9B7FF7);
  background: var(--color-surface-1, #11141C);
  color: var(--color-text-primary, #E0E6ED);
}

/* ---------------------------------------------------------------------------
 * Wave D #10 — Saturation reserved for actionable/anomalous slots
 *   .qs-data-count → COUNT in primary text colour (white-ish)
 *   .qs-data-delta → since last sync amber slot
 *   .qs-data-alarm → P0 / active alarm red slot
 * --------------------------------------------------------------------------- */
.qs-data-count {
  color: var(--color-text-primary, #E0E6ED) !important;
  font-variant-numeric: tabular-nums;
}
.qs-data-delta {
  color: var(--color-warning, #FFB800) !important;
  font-variant-numeric: tabular-nums;
}
.qs-data-alarm {
  color: var(--color-alert, #E5484D) !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qs-kpi-tile-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-top: 0.15rem;
  font-size: var(--font-size-10, 10px);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------------------
 * Wave D #11 — Page title demoted to H2 utility size
 * --------------------------------------------------------------------------- */
.qs-page-heading-block {
  /* Moves to top-left visually; KPIRow / mission-clock are the new visual anchors */
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}
.qs-page-heading-h2 {
  font-size: var(--font-size-18, 1.125rem);
  font-weight: 600;
  line-height: var(--line-height-tight, 1.2);
  color: var(--color-text-primary, #E0E6ED);
}
.qs-page-heading-sub {
  font-size: var(--font-size-10, 0.625rem);
  font-weight: 500;
  color: var(--color-text-tertiary, rgba(224, 230, 237, 0.55));
  margin-top: 1px;
}

/* ---------------------------------------------------------------------------
 * Wave D #13 — Copy-on-click SHA button + global toast
 * --------------------------------------------------------------------------- */
.qs-copy-sha-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.4rem;
  background: transparent;
  border: 1px solid var(--color-border-subtle, rgba(224, 230, 237, 0.08));
  border-radius: 3px;
  color: var(--color-text-primary, #E0E6ED);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.qs-copy-sha-button:hover,
.qs-copy-sha-button:focus-visible {
  background: rgba(155, 127, 247, 0.08);
  border-color: rgba(155, 127, 247, 0.45);
  color: var(--color-text-primary, #E0E6ED);
  outline: none;
}
.qs-copy-sha-glyph {
  opacity: 0.55;
  font-size: 10px;
}
.qs-copy-sha-button:hover .qs-copy-sha-glyph {
  opacity: 1;
  color: var(--color-stage-current, #9B7FF7);
}
.qs-kpi-build-copy {
  padding-left: 0;
  padding-right: 0;
  border: none;
}
.qs-kpi-build-copy:hover,
.qs-kpi-build-copy:focus-visible {
  border: none;
  background: transparent;
}

/* Toast — bottom-right, fades in/out via data-visible attribute */
.qs-copy-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  pointer-events: none;
  background: var(--color-surface-2, #161A24);
  border: 1px solid rgba(155, 127, 247, 0.45);
  border-radius: 4px;
  padding: 0.5rem 0.85rem;
  color: var(--color-text-primary, #E0E6ED);
  font-family: var(--font-mono);
  font-size: var(--font-size-12, 12px);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 240, 255, 0.08);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.qs-copy-toast[data-visible=true] {
  opacity: 1;
  transform: translateY(0);
}
.qs-copy-toast-message {
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Wave D #14 — Content-aware card grid
 * Use the utility on any card container:
 *   .qs-card-grid > .qs-card-dense  → spans 2 columns
 *   .qs-card-grid > .qs-card-sparse → spans 1
 * --------------------------------------------------------------------------- */
.qs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.qs-card-grid > .qs-card-dense {
  grid-column: span 2;
}
.qs-card-grid > .qs-card-sparse {
  grid-column: span 1;
}
@media (max-width: 1024px) {
  .qs-card-grid > .qs-card-dense { grid-column: span 1; }
}

/* ---------------------------------------------------------------------------
 * Wave D #18 — Intelligence Model stage presence widget (top-right of content area)
 * --------------------------------------------------------------------------- */
.qs-wave-d-top-right {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}
.qs-im-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.45rem;
  background: var(--color-surface-1, #11141C);
  border: 1px solid var(--color-border-subtle, rgba(224, 230, 237, 0.08));
  border-radius: 4px;
}
.qs-im-stage {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: help;
  font-family: var(--font-mono);
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease;
}
.qs-im-stage:hover,
.qs-im-stage:focus-visible {
  background: rgba(155, 127, 247, 0.08);
  border-color: rgba(155, 127, 247, 0.4);
  outline: none;
}
.qs-im-glyph {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.75));
  letter-spacing: 0.06em;
  line-height: 1;
}
.qs-im-stage[data-active=true] .qs-im-glyph {
  color: var(--color-text-primary, #E0E6ED);
}
.qs-im-activity-dot {
  margin-top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-stage-future, #3A3F4B);
}
.qs-im-activity-dot[data-active=true] {
  background: var(--color-stage-complete, #0A8F5E);
  box-shadow: 0 0 6px rgba(10, 143, 94, 0.55);
}
.qs-im-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  white-space: nowrap;
  background: var(--color-surface-2, #161A24);
  border: 1px solid rgba(155, 127, 247, 0.35);
  border-radius: 3px;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-primary, #E0E6ED);
  z-index: 80;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.qs-im-tooltip-name {
  font-weight: 600;
  color: var(--color-stage-current, #9B7FF7);
  letter-spacing: 0.04em;
}
.qs-im-tooltip-activity {
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.75));
}
.qs-im-stage:hover .qs-im-tooltip,
.qs-im-stage:focus-visible .qs-im-tooltip {
  display: flex;
}

/* ---------------------------------------------------------------------------
 * Wave D #21 — Unified shimmering skeleton across all 9 tabs
 * --------------------------------------------------------------------------- */
.qs-unified-skeleton {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  min-height: 240px;
}
.qs-unified-skeleton-single {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.qs-unified-skeleton-master-detail {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  flex: 1;
}
.qs-unified-skeleton-master,
.qs-unified-skeleton-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qs-skeleton-shimmer-row {
  height: 44px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--color-surface-1, #11141C) 0%,
    var(--color-surface-2, #161A24) 50%,
    var(--color-surface-1, #11141C) 100%
  );
  background-size: 200% 100%;
  animation: qs-skeleton-shimmer 1.5s linear infinite;
  border: 1px solid var(--color-border-subtle, rgba(224, 230, 237, 0.08));
}
.qs-skeleton-shimmer-tall {
  flex: 1;
  height: auto;
  min-height: 240px;
}
@keyframes qs-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .qs-skeleton-shimmer-row { animation: none; }
}

/* ---------------------------------------------------------------------------
 * Wave D #22 — Chord pill on vertical-nav labels
 * --------------------------------------------------------------------------- */
.qs-vertical-nav-item {
  position: relative;
}
.qs-vertical-nav-chord {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  background: rgba(224, 230, 237, 0.06);
  border: 1px solid rgba(224, 230, 237, 0.12);
  color: var(--color-text-tertiary, rgba(224, 230, 237, 0.55));
  border-radius: 2px;
  text-transform: uppercase;
}
.qs-vertical-nav-item[data-active=true] .qs-vertical-nav-chord {
  background: rgba(155, 127, 247, 0.12);
  border-color: rgba(155, 127, 247, 0.4);
  color: var(--color-text-primary, #E0E6ED);
}

/* Kbd shortcuts modal */
.qs-kbd-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.qs-kbd-help-panel {
  background: var(--color-surface-1, #11141C);
  border: 1px solid var(--color-border-strong, rgba(224, 230, 237, 0.24));
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  min-width: 320px;
  max-width: 520px;
  width: 80vw;
  color: var(--color-text-primary, #E0E6ED);
  font-family: var(--font-sans);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.qs-kbd-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-14, 0.875rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border-subtle, rgba(224, 230, 237, 0.08));
  margin-bottom: 0.65rem;
}
.qs-kbd-help-close {
  background: transparent;
  border: none;
  color: var(--color-text-tertiary, rgba(224, 230, 237, 0.55));
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.35rem;
}
.qs-kbd-help-close:hover { color: var(--color-text-primary, #E0E6ED); }
.qs-kbd-help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
}
.qs-kbd-help-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--font-size-12, 0.75rem);
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.75));
}
.qs-kbd-chord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  background: rgba(155, 127, 247, 0.1);
  border: 1px solid rgba(155, 127, 247, 0.35);
  color: var(--color-text-primary, #E0E6ED);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.qs-kbd-help-desc { color: var(--color-text-secondary, rgba(224, 230, 237, 0.75)); }

/* ---------------------------------------------------------------------------
 * Wave D #23 — Focus Mode toggle + suppression rules
 * --------------------------------------------------------------------------- */
.qs-focus-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-surface-1, #11141C);
  border: 1px solid var(--color-border-subtle, rgba(224, 230, 237, 0.08));
  border-radius: 4px;
  color: var(--color-text-secondary, rgba(224, 230, 237, 0.75));
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.qs-focus-mode-toggle:hover,
.qs-focus-mode-toggle:focus-visible {
  background: rgba(155, 127, 247, 0.1);
  border-color: rgba(155, 127, 247, 0.45);
  color: var(--color-text-primary, #E0E6ED);
  outline: none;
}
.qs-focus-mode-toggle[data-active=true] {
  background: rgba(155, 127, 247, 0.2);
  border-color: var(--color-stage-current, #9B7FF7);
  color: var(--color-text-primary, #E0E6ED);
}

body[data-focus-mode=true] [data-testid=qs-left-rail],
body[data-focus-mode=true] [data-testid=qs-vertical-nav],
body[data-focus-mode=true] [data-testid=qs-kpi-row] {
  display: none !important;
}
body[data-focus-mode=true] .qs-ops-console-band {
  display: none !important;
}
body[data-focus-mode=true] [data-testid=theater-root],
body[data-focus-mode=true] .qs-app-content {
  margin-left: 0 !important;
}
body[data-focus-mode=true] .qs-content-area {
  padding: 8px !important;
}

/* ---------------------------------------------------------------------------
 * Wave D #25 — Sticky Evidence Download bar (Overview + Adversarial)
 * --------------------------------------------------------------------------- */
.qs-evidence-bar {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.45rem;
  padding: 0.45rem 0.7rem;
  background: var(--color-surface-2, #161A24);
  border-top: 1px solid rgba(155, 127, 247, 0.35);
  box-shadow: none;
  font-family: var(--font-mono);
}
.qs-evidence-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 3px;
  font-size: var(--font-size-12, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.qs-evidence-button-primary {
  background: var(--color-stage-current, #9B7FF7);
  color: #0B0D12;
  border: 1px solid var(--color-stage-current, #9B7FF7);
}
.qs-evidence-button-primary:hover,
.qs-evidence-button-primary:focus-visible {
  background: #B69BFF;
  outline: none;
}
.qs-evidence-button-secondary {
  background: transparent;
  color: var(--color-text-primary, #E0E6ED);
  border: 1px solid var(--color-border-default, rgba(224, 230, 237, 0.16));
}
.qs-evidence-button-secondary:hover,
.qs-evidence-button-secondary:focus-visible {
  background: rgba(155, 127, 247, 0.08);
  border-color: rgba(155, 127, 247, 0.45);
  outline: none;
}
body[data-egg-wave-b] .qs-evidence-bar {
  left: auto;
}
body[data-focus-mode=true] .qs-evidence-bar {
  left: auto;
}

/* Unsupported command-surface widths render the intentional desktop-required gate.
 * Hide pre-hydration proof strips there so static dist does not show duplicate C2 content above the gate. */
@media (max-width: 1279px) {
  #ops-console-band-root,
  #skeleton-hero-root {
    display: none !important;
  }
}


/* === Live mission tape (always-visible streaming telemetry, 2026-06-02) ===== */
.qs-live-tape {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 22px;
  padding: 0.24rem 14rem 0.24rem 1.1rem;
  min-height: 20px;
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.96), rgba(14, 20, 34, 0.96));
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(224, 230, 237, 0.82);
  overflow: hidden;
  white-space: nowrap;
}
.qs-live-tape-led { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; }
.qs-live-tape-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7);
  animation: qs-live-pulse 1.5s ease-in-out infinite;
}
.qs-live-tape-live { color: #00f0ff; font-weight: 700; }
.qs-live-tape-progress {
  position: relative; flex: none; width: 84px; height: 3px;
  border-radius: 2px; background: rgba(0, 240, 255, 0.12); overflow: hidden;
}
.qs-live-tape-progress-fill {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), #00f0ff);
  box-shadow: 0 0 8px 1px rgba(0, 240, 255, 0.35);
}
.qs-live-tape-event {
  display: inline-flex; align-items: center; gap: 0.4rem;
  flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.qs-live-tape-marker { color: #00f0ff; flex: none; }
.qs-live-tape-ts { color: rgba(224, 230, 237, 0.55); flex: none; }
.qs-live-tape-vendor { color: #9b7ff7; flex: none; }
.qs-live-tape-text {
  color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.qs-live-tape-new {
  flex: none; margin-left: 0.1rem; padding: 0 0.3rem; border-radius: 3px;
  font-size: 10.5px; font-weight: 700; color: #001014; background: #00f0ff;
  animation: qs-live-pulse 1.5s ease-in-out infinite;
}
.qs-live-tape-count { flex: none; color: rgba(224, 230, 237, 0.6); margin-left: auto; }
.qs-live-tape-sep { opacity: 0.5; }
@keyframes qs-live-tape-in {
  0%   { opacity: 0; transform: translateY(-6px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); }
}
.qs-live-tape-event.qs-live-tape-in {
  animation: qs-live-tape-in 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .qs-live-tape-dot, .qs-live-tape-new { animation: none; }
  .qs-live-tape-progress-fill { transition: none; }
  .qs-live-tape-event.qs-live-tape-in { animation: none; }
}
