/* Prism Comparison Theater (/cdiss/compare)
 * Inherits obsidian-glass tokens from /cdiss/visualizer/style.css.
 * Full-bleed 1920x1080 projector layout with neutral equal-weight 50/50 columns.
 */

:root {
  --theater-font-size: 16px;
  --theater-prompt-size: 17px;
  --chrome-bg: rgba(11, 18, 34, 0.96);
  --surface-elevated: rgba(15, 24, 44, 0.95);
  --surface-subtle: rgba(9, 15, 29, 0.88);
  --border-strong: rgba(70, 102, 152, 0.78);
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.compare-body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

.compare-shell {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  margin: 0;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-shell[data-view="deep"] {
  height: auto;
  min-height: 100vh;
}

body.compare-body.is-deep-scroll {
  overflow: auto;
}

/* Projector font presets */
.compare-shell[data-font="14"] {
  --theater-font-size: 14px;
  --theater-prompt-size: 15px;
}

.compare-shell[data-font="16"] {
  --theater-font-size: 16px;
  --theater-prompt-size: 17px;
}

.compare-shell[data-font="18"] {
  --theater-font-size: 18px;
  --theater-prompt-size: 19.5px;
}

/* ==================== COMPACT 2-ROW CHROME (~100px) ==================== */

.compare-chrome {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: var(--chrome-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.chrome-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.chrome-row-2 {
  padding-top: 6px;
  border-top: 1px solid rgba(48, 72, 112, 0.45);
}

.chrome-brand,
.chrome-status-cluster,
.chrome-display-cluster,
.transport-cluster,
.progress-cluster,
.tools-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.compare-emblem {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.chrome-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
  white-space: nowrap;
}

.seg-compact {
  padding: 2px;
  border-radius: 8px;
  gap: 2px;
}

.seg-compact .seg-btn {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.btn-xs {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
}

.btn-xs:disabled,
.nav-btn:disabled,
.action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.nav-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.progress-cluster {
  flex: 1 1 240px;
  justify-content: center;
}

.progress-text {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  white-space: nowrap;
}

.progress-track {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  background: rgba(28, 44, 74, 0.92);
  border: 1px solid rgba(52, 78, 120, 0.6);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width 220ms ease;
}

.arc-text {
  font-size: 12px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Export dropdown */
.export-menu-wrap {
  position: relative;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dropdown-item {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(63, 224, 197, 0.14);
  border-color: rgba(63, 224, 197, 0.4);
  color: var(--cyan);
}

/* ==================== NOTICE BAR ==================== */

.notice-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(20, 30, 54, 0.94);
  border: 1px solid rgba(244, 196, 86, 0.55);
  border-radius: 10px;
  font-size: 12.5px;
}

.notice-bar.is-error {
  border-color: rgba(242, 100, 100, 0.65);
  background: rgba(44, 18, 28, 0.92);
}

.notice-text {
  flex: 1;
  color: var(--white);
}

/* ==================== MAIN STAGE & VIEW MODES ==================== */

.compare-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* View 1: 3-Column Main View (Far Left Raw Chat + Middle Governed Prism = 62% | Far Right All 6 CDISS Visuals = 38%) */
.compare-shell[data-view="split"] .compare-stage {
  display: grid;
  grid-template-columns: minmax(0, 62%) minmax(520px, 38%);
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.compare-shell[data-view="split"] .chat-pane {
  min-height: 0;
  min-width: 0;
}

.compare-shell[data-view="split"] .compact-cockpit {
  min-height: 0;
  min-width: 0;
}

@media (max-width: 1280px) {
  .compare-shell[data-view="split"] .compare-stage {
    grid-template-columns: minmax(0, 58%) minmax(420px, 42%);
  }
}

/* View 2: Focus Chat (100% Chat + slim 1-line ribbon) */
.compare-shell[data-view="focus"] .chat-pane {
  flex: 1 1 auto;
  min-height: 0;
}

.compare-shell[data-view="focus"] .compact-cockpit {
  display: none;
}

/* View 3: Deep Math Inspector */
.compare-shell[data-view="deep"] .chat-pane,
.compare-shell[data-view="deep"] .compact-cockpit,
.compare-shell[data-view="deep"] .focus-ribbon {
  display: none;
}

/* ==================== UNIFIED TURN-ROW 50/50 CHAT PANE ==================== */

.chat-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.chat-col-headers {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 17, 32, 0.96);
}

.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
}

.col-head-raw {
  border-right: 1px solid var(--border);
}

.col-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
}

.col-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.turn-rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.turn-rows > * {
  flex-shrink: 0;
}

/* Empty / Ready Landing Card */
.empty-stage-card {
  margin: auto;
  max-width: 820px;
  padding: 22px 26px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-stage-card h2 {
  margin: 0;
  font-size: 19px;
  color: var(--white);
}

.empty-stage-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 680px;
}

.empty-next-preview {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(16, 28, 52, 0.85);
  border: 1px solid rgba(63, 224, 197, 0.35);
  text-align: left;
}

.empty-next-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cyan);
  margin-bottom: 4px;
}

.empty-next-prompt {
  margin: 0;
  font-size: var(--theater-prompt-size);
  font-weight: 600;
  color: var(--white);
}

.shortcut-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.kbd-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(24, 38, 66, 0.85);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

/* Fresh Thread Divider */
.fresh-thread-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 2px;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fresh-thread-divider::before,
.fresh-thread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 196, 86, 0.55), transparent);
}

/* Unified Turn Row */
.turn-row {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

.turn-row:hover {
  border-color: var(--border-strong);
}

.turn-row.is-selected {
  border-color: rgba(63, 224, 197, 0.78);
  box-shadow: 0 0 0 1px rgba(63, 224, 197, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.turn-row.is-inflight {
  border-color: rgba(244, 196, 86, 0.65);
}

/* Full-width single prompt header bar */
.turn-prompt-bar {
  padding: 10px 14px;
  background: rgba(16, 26, 48, 0.9);
  border-bottom: 1px solid rgba(48, 72, 112, 0.62);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.turn-prompt-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.turn-prompt-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.turn-num-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-transform: uppercase;
}

.turn-group-label {
  font-size: 11.5px;
  color: var(--muted);
}

.turn-prompt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.turn-prompt-text {
  margin: 0;
  font-size: var(--theater-prompt-size);
  font-weight: 650;
  color: var(--white);
  line-height: 1.4;
}

.turn-obs-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* Equal-weight 50/50 side-by-side reply columns */
.turn-replies-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.arm-col {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.arm-raw {
  border-right: 1px solid rgba(48, 72, 112, 0.55);
}

.arm-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.arm-meta-left,
.arm-meta-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.arm-reply-body {
  margin: 0;
  font-size: var(--theater-font-size);
  line-height: 1.52;
  color: var(--white);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1 1 auto;
}

.arm-reply-body.is-pending {
  color: var(--muted);
  font-style: italic;
}

/* Neutral Governance / Approval / Oscillation Callout inside Prism column */
.arm-gate-callout {
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(14, 24, 44, 0.92);
  border: 1px solid rgba(244, 196, 86, 0.55);
  font-size: 12.5px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.arm-gate-callout.is-osc {
  border-color: rgba(242, 100, 100, 0.65);
  background: rgba(40, 18, 28, 0.65);
}

.arm-gate-title {
  font-weight: 700;
  color: var(--gold);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.arm-gate-callout.is-osc .arm-gate-title {
  color: var(--coral);
}

/* Symmetric observable metrics chips */
.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(40, 60, 96, 0.5);
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16, 26, 46, 0.92);
  border: 1px solid rgba(46, 70, 108, 0.65);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.metric-chip strong {
  color: var(--white);
  font-weight: 700;
}

/* Formula-derived observable highlights strip */
.turn-highlights-strip {
  padding: 7px 14px;
  border-top: 1px solid rgba(42, 64, 98, 0.55);
  background: rgba(11, 18, 34, 0.86);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.highlight-chip {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20, 34, 60, 0.85);
  border: 1px solid rgba(56, 84, 128, 0.65);
  color: var(--white);
}

/* Expandable Inspect Prompt / Context Drawer inside each turn */
.turn-inspect-drawer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  background: rgba(7, 12, 24, 0.95);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  cursor: default;
}

.inspect-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.inspect-heading {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cyan);
}

.inspect-pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(12, 20, 36, 0.95);
  border: 1px solid rgba(42, 64, 98, 0.65);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

/* ==================== FOCUS CHAT 1-LINE RIBBON ==================== */

.focus-ribbon {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
}

.ribbon-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.ribbon-k {
  color: var(--muted);
  font-weight: 600;
}

/* ==================== BUILT-IN TURN DIFFERENCE EXPLAINER ==================== */

.turn-diff-banner {
  flex: 0 0 auto;
  border-top: 1px solid rgba(56, 232, 213, 0.42);
  background: linear-gradient(180deg, rgba(12, 22, 42, 0.98), rgba(8, 15, 30, 0.99));
  padding: 10px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

.turn-diff-banner.is-explaining {
  border-top: 2px solid rgba(245, 183, 73, 0.95);
  background: linear-gradient(180deg, rgba(22, 34, 62, 0.99), rgba(11, 19, 38, 0.99));
  box-shadow: inset 0 2px 0 rgba(245, 183, 73, 0.75), 0 -10px 30px rgba(245, 183, 73, 0.16);
}

.turn-diff-banner.is-explaining .diff-banner-takeaway {
  color: #fff6d6;
  background: rgba(46, 36, 14, 0.72);
  border-color: rgba(245, 183, 73, 0.72);
}

.diff-banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
  flex: 1 1 auto;
}

.diff-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diff-cell {
  background: rgba(16, 27, 50, 0.92);
  border: 1px solid rgba(54, 80, 122, 0.65);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.diff-cell-raw {
  border-left: 3px solid rgba(148, 163, 184, 0.85);
}

.diff-cell-prism {
  border-left: 3px solid rgba(56, 232, 213, 0.9);
}

.diff-cell-cdiss {
  border-left: 3px solid rgba(167, 139, 250, 0.9);
}

.diff-cell-k {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.diff-cell-v {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--white);
}

.diff-banner-takeaway {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #bfeff0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(18, 36, 56, 0.72);
  border: 1px solid rgba(56, 232, 213, 0.32);
}

/* ==================== FAR RIGHT COLUMN: ALL 6 LIVE CDISS VISUALS ==================== */

.compact-cockpit,
.cdiss-side-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.cockpit-eq-header {
  flex: 0 0 auto;
  padding: 8px 10px;
  gap: 5px;
}

.cdiss-side-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
}

.cockpit-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow: hidden;
}

.widget-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.widget-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-head-pills {
  display: flex;
  align-items: center;
  gap: 5px;
}

.side-canvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  object-fit: contain;
}

.side-canvas-sm {
  flex: 0 0 84px;
  width: 100%;
  height: 84px;
  object-fit: contain;
}

.side-fiber-wrap,
.side-sphere-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(0, 1.15fr);
  gap: 7px;
  align-items: center;
}

.side-fiber-wrap canvas,
.side-sphere-wrap canvas {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.side-gates-compact {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-fiber-metrics {
  gap: 4px;
  overflow-y: auto;
  max-height: 100%;
}

.compact-fiber-metrics .bar-head {
  font-size: 10.5px;
}

.compact-fiber-metrics .bar-track {
  height: 6px;
}

.compact-fiber-metrics .guard-box {
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.3;
}

.compact-eq-strip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compact-eq-pill {
  padding: 3px 8px;
  font-size: 12px;
  gap: 2px;
}

.compact-eq-pill .eq-term {
  padding: 2px 4px;
  font-size: 11.5px;
}

.compact-eq-explain {
  margin: 0;
  font-size: 11px;
  color: var(--cyan);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-scalars {
  gap: 3px;
  overflow-y: auto;
  padding-right: 2px;
  max-height: 100%;
}

.compact-scalars .bar-row {
  gap: 2px;
}

.compact-scalars .bar-head {
  font-size: 11px;
}

.compact-scalars .bar-track {
  height: 6px;
}

.compact-gates-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.compact-chips {
  gap: 4px;
}

.compact-chips .pill {
  padding: 2px 6px;
  font-size: 10px;
}

.compact-gate-list {
  max-height: none;
  flex: 1 1 auto;
  gap: 4px;
}

.compact-gate-list .gate-item {
  padding: 5px 7px;
  font-size: 11px;
}

/* Compact Widget 3: Timeline */
.cockpit-timeline .timeline-canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  cursor: pointer;
}

/* ==================== DEEP MATH INSPECTOR (VIEW 3) ==================== */

.deep-inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 32px;
}

.deep-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 16px;
  background: rgba(11, 18, 34, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(10px);
}

.deep-banner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deep-banner-meta,
.deep-banner-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.deep-prompt-quote {
  margin: 0;
  font-size: var(--theater-prompt-size);
  font-weight: 650;
  color: var(--white);
}

.deep-replies-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.deep-reply-box {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-inset);
  border: 1px solid rgba(44, 68, 106, 0.65);
  max-height: 112px;
  overflow-y: auto;
}

.deep-reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11.5px;
}

.deep-reply-text {
  margin: 0;
  font-size: 13px;
  color: var(--white);
  white-space: pre-wrap;
  line-height: 1.42;
}

.sphere-canvas {
  cursor: grab;
}

.sphere-canvas:active {
  cursor: grabbing;
}

.timeline-canvas {
  cursor: pointer;
}

/* ==================== QUEUE DRAWER & MODALS ==================== */

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
}

.queue-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(620px, 94vw);
  background: rgba(10, 17, 32, 0.98);
  border-left: 1px solid var(--border-strong);
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 12px;
}

.drawer-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2,
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--white);
}

.drawer-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-form {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-inset);
  border: 1px solid rgba(63, 224, 197, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--cyan);
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.field-label-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.95);
  border: 1px solid var(--border);
  color: var(--white);
  font: inherit;
  font-size: 13px;
}

.field-select-sm {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
}

.field-textarea {
  resize: vertical;
  line-height: 1.4;
}

.field-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inline-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.queue-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.queue-item {
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--bg-inset);
  border: 1px solid rgba(42, 64, 98, 0.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item.is-done {
  opacity: 0.82;
  border-color: rgba(63, 224, 197, 0.3);
}

.queue-item.is-next {
  border-color: rgba(244, 196, 86, 0.72);
  background: rgba(24, 34, 58, 0.9);
}

.queue-item.is-disabled {
  opacity: 0.5;
}

.queue-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.queue-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.queue-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.queue-item-prompt {
  margin: 0;
  font-size: 13px;
  color: var(--white);
  line-height: 1.4;
}

.queue-item-editor {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(48, 72, 112, 0.5);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Upload Modal */
.upload-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 95;
  width: min(880px, 94vw);
  max-height: 88vh;
  background: rgba(10, 17, 32, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.upload-dropzone {
  padding: 18px;
  border-radius: 12px;
  border: 1.5px dashed rgba(63, 224, 197, 0.55);
  background: rgba(14, 24, 44, 0.85);
  text-align: center;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  background: rgba(20, 40, 66, 0.92);
  border-color: var(--cyan);
}

.dropzone-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.dropzone-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.upload-paste-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-paste-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-paste-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-feedback {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(16, 26, 46, 0.92);
  border: 1px solid var(--border);
  font-size: 12px;
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-err {
  color: var(--coral);
}

.feedback-warn {
  color: var(--gold);
}

.upload-preview-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-inset);
}

.upload-preview-table {
  font-size: 12px;
}

.upload-preview-table td {
  padding: 6px 8px;
  vertical-align: top;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== PLAIN / GRANDMA SIMPLE STAGE & SAFARI SPOTLIGHT ==================== */

.simple-only {
  display: none;
}

.compare-shell[data-lang="plain"] .math-only-block {
  display: none !important;
}

.compare-shell[data-simple-stage="true"] .simple-only {
  display: inline-flex;
}

.compare-shell[data-simple-stage="true"] {
  --theater-font-size: 17.5px;
  --theater-prompt-size: 19px;
}

.compare-shell[data-simple-stage="true"] .compare-chrome {
  padding: 6px 14px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.compare-shell[data-simple-stage="true"] .chrome-row-1 {
  flex: 1 1 auto;
}

.compare-shell[data-simple-stage="true"] .chrome-row-2 {
  flex: 0 0 auto;
  border-top: none;
  padding-top: 0;
}

.compare-shell[data-simple-stage="true"] .chrome-status-cluster,
.compare-shell[data-simple-stage="true"] #view-mode-group,
.compare-shell[data-simple-stage="true"] #font-size-group,
.compare-shell[data-simple-stage="true"] #math-mode-group,
.compare-shell[data-simple-stage="true"] .nav-link-btn,
.compare-shell[data-simple-stage="true"] .transport-cluster,
.compare-shell[data-simple-stage="true"] .tools-cluster,
.compare-shell[data-simple-stage="true"] #replay-badge,
.compare-shell[data-simple-stage="true"] #btn-exit-replay,
.compare-shell[data-simple-stage="true"] #session-status-pill,
.compare-shell[data-simple-stage="true"] #arc-label,
.compare-shell[data-simple-stage="true"] .turn-diff-banner,
.compare-shell[data-simple-stage="true"] .turn-row:not(.is-selected) {
  display: none !important;
}

.compare-shell[data-simple-stage="true"] .progress-text {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--gold);
}

.compare-shell[data-simple-stage="true"] .progress-track {
  width: 190px;
  height: 8px;
}

/* Smooth spotlight focus transitions */
.turn-prompt-bar,
.arm-raw,
.arm-prism,
.turn-replies-grid,
.cdiss-side-column .cockpit-widget,
.chat-col-headers .col-head {
  transition: opacity 280ms ease, box-shadow 280ms ease, border-color 280ms ease, background 280ms ease, transform 280ms ease;
}

/* Beat 1: Spotlight Prompt */
.compare-shell[data-spotlight="prompt"] .turn-row.is-selected .turn-replies-grid,
.compare-shell[data-spotlight="prompt"] .cdiss-side-column .cockpit-widget {
  opacity: 0.44;
}
.compare-shell[data-spotlight="prompt"] .turn-row.is-selected .turn-prompt-bar {
  background: linear-gradient(180deg, rgba(56, 44, 16, 0.94), rgba(26, 24, 20, 0.96));
  border: 2px solid #f4c456;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(244, 196, 86, 0.25), 0 0 28px rgba(244, 196, 86, 0.35);
}

/* Beat 2: Spotlight Regular AI (Far Left) */
.compare-shell[data-spotlight="raw"] .turn-row.is-selected .arm-prism,
.compare-shell[data-spotlight="raw"] .turn-row.is-selected .turn-prompt-bar,
.compare-shell[data-spotlight="raw"] .cdiss-side-column .cockpit-widget,
.compare-shell[data-spotlight="raw"] .col-head-prism {
  opacity: 0.42;
}
.compare-shell[data-spotlight="raw"] .col-head-raw {
  background: rgba(86, 165, 255, 0.2);
}
.compare-shell[data-spotlight="raw"] .turn-row.is-selected .arm-raw {
  background: rgba(20, 42, 76, 0.88);
  border: 2px solid #56a5ff;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(86, 165, 255, 0.35), 0 0 26px rgba(86, 165, 255, 0.32);
}

/* Beat 3: Spotlight Prism AI (Middle) */
.compare-shell[data-spotlight="prism"] .turn-row.is-selected .arm-raw,
.compare-shell[data-spotlight="prism"] .turn-row.is-selected .turn-prompt-bar,
.compare-shell[data-spotlight="prism"] .cdiss-side-column .cockpit-widget,
.compare-shell[data-spotlight="prism"] .col-head-raw {
  opacity: 0.42;
}
.compare-shell[data-spotlight="prism"] .col-head-prism {
  background: rgba(63, 224, 197, 0.2);
}
.compare-shell[data-spotlight="prism"] .turn-row.is-selected .arm-prism {
  background: rgba(14, 48, 60, 0.88);
  border: 2px solid #3fe0c5;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(63, 224, 197, 0.35), 0 0 26px rgba(63, 224, 197, 0.34);
}

/* Beat 4: Spotlight Side-by-Side Difference */
.compare-shell[data-spotlight="diff"] .turn-row.is-selected .turn-prompt-bar,
.compare-shell[data-spotlight="diff"] .cdiss-side-column .cockpit-widget {
  opacity: 0.48;
}
.compare-shell[data-spotlight="diff"] .turn-row.is-selected .arm-raw {
  background: rgba(20, 38, 68, 0.72);
  border: 2px solid rgba(86, 165, 255, 0.85);
  border-radius: 10px 0 0 10px;
}
.compare-shell[data-spotlight="diff"] .turn-row.is-selected .arm-prism {
  background: rgba(14, 46, 56, 0.78);
  border: 2px solid rgba(63, 224, 197, 0.9);
  border-radius: 0 10px 10px 0;
}

/* Beat 5: Spotlight Specific Right-Hand Visual Widget */
.compare-shell[data-spotlight="visual"] .chat-pane {
  opacity: 0.56;
}
.compare-shell[data-spotlight="visual"] .cdiss-side-column .cockpit-widget {
  opacity: 0.34;
}
.compare-shell[data-spotlight="visual"] .cdiss-side-column .cockpit-widget.is-spotlight-panel {
  opacity: 1 !important;
  border: 2.5px solid #f472b6;
  background: linear-gradient(180deg, rgba(36, 20, 56, 0.96), rgba(14, 22, 44, 0.98));
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.28), 0 0 32px rgba(244, 114, 182, 0.45);
  transform: scale(1.015);
  z-index: 5;
}

/* Large Bottom Safari Subtitle Bar */
.safari-subtitle-bar {
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.98), rgba(4, 8, 18, 0.99));
  border: 2px solid rgba(244, 196, 86, 0.72);
  border-radius: 14px;
  padding: 12px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55), 0 0 22px rgba(244, 196, 86, 0.16);
}

.safari-subtitle-bar[data-beat="raw"] {
  border-color: rgba(86, 165, 255, 0.85);
}
.safari-subtitle-bar[data-beat="prism"] {
  border-color: rgba(63, 224, 197, 0.9);
}
.safari-subtitle-bar[data-beat="diff"] {
  border-color: rgba(244, 196, 86, 0.92);
}
.safari-subtitle-bar[data-beat="visual"] {
  border-color: rgba(244, 114, 182, 0.92);
}

.safari-sub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.safari-beat-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(244, 196, 86, 0.2);
  color: #ffe08a;
  border: 1px solid rgba(244, 196, 86, 0.65);
}

.safari-subtitle-bar[data-beat="raw"] .safari-beat-pill {
  background: rgba(86, 165, 255, 0.22);
  color: #a8d4ff;
  border-color: rgba(86, 165, 255, 0.7);
}
.safari-subtitle-bar[data-beat="prism"] .safari-beat-pill {
  background: rgba(63, 224, 197, 0.2);
  color: #8bf7e6;
  border-color: rgba(63, 224, 197, 0.72);
}
.safari-subtitle-bar[data-beat="visual"] .safari-beat-pill {
  background: rgba(244, 114, 182, 0.24);
  color: #ffb3db;
  border-color: rgba(244, 114, 182, 0.78);
}

.safari-rhythm-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rhythm-step {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: rgba(142, 163, 196, 0.65);
  background: rgba(16, 26, 48, 0.75);
  border: 1px solid rgba(48, 72, 112, 0.45);
  transition: all 220ms ease;
}

.rhythm-step.is-active {
  color: #ffffff;
  background: rgba(244, 196, 86, 0.26);
  border-color: #f4c456;
  box-shadow: 0 0 12px rgba(244, 196, 86, 0.35);
}

.safari-subtitle-bar[data-beat="raw"] .rhythm-step.is-active {
  background: rgba(86, 165, 255, 0.28);
  border-color: #56a5ff;
  box-shadow: 0 0 12px rgba(86, 165, 255, 0.35);
}
.safari-subtitle-bar[data-beat="prism"] .rhythm-step.is-active {
  background: rgba(63, 224, 197, 0.26);
  border-color: #3fe0c5;
  box-shadow: 0 0 12px rgba(63, 224, 197, 0.35);
}
.safari-subtitle-bar[data-beat="visual"] .rhythm-step.is-active {
  background: rgba(244, 114, 182, 0.28);
  border-color: #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.38);
}

.safari-subtitle-text {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.32;
  color: #ffffff;
  letter-spacing: -0.005em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

/* ==================== LIVE PROMPT COMPOSER, DUAL SIGNAL ROUTER & STREAMING CARET ==================== */

.live-prompt-composer {
  flex: 0 0 auto;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, rgba(16, 26, 48, 0.98), rgba(11, 18, 35, 0.98));
  border-bottom: 1px solid rgba(244, 196, 86, 0.38);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: box-shadow 260ms ease, border-color 260ms ease, opacity 260ms ease;
}

.compare-shell[data-composer="on"] .turn-row .turn-prompt-bar {
  display: none !important;
}

.compare-shell[data-spotlight="composer"] .turn-rows,
.compare-shell[data-spotlight="composer"] .cdiss-side-column .cockpit-widget {
  opacity: 0.42;
}

.compare-shell[data-spotlight="composer"] .live-prompt-composer {
  border-bottom: 2px solid #f4c456;
  box-shadow: inset 0 0 0 2px rgba(244, 196, 86, 0.72), 0 0 28px rgba(244, 196, 86, 0.32);
}

.compare-shell[data-spotlight="raw"] .live-prompt-composer,
.compare-shell[data-spotlight="prism"] .live-prompt-composer,
.compare-shell[data-spotlight="diff"] .live-prompt-composer {
  opacity: 0.55;
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-who {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f4c456;
  text-transform: uppercase;
}

.composer-input-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.composer-textbox {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(6, 11, 22, 0.94);
  border: 1.5px solid rgba(86, 165, 255, 0.42);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.compare-shell[data-spotlight="composer"] .composer-textbox {
  border-color: #f4c456;
  box-shadow: 0 0 14px rgba(244, 196, 86, 0.24);
}

.composer-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.composer-caret,
.stream-caret {
  display: inline-block;
  width: 2.5px;
  height: 1.15em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: #f4c456;
  animation: prismBlink 0.72s steps(2, start) infinite;
}

.stream-caret {
  background: #3fe0c5;
}

@keyframes prismBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.composer-send-btn {
  flex: 0 0 auto;
  padding: 0 20px;
  border-radius: 10px;
  border: 1.5px solid rgba(244, 196, 86, 0.8);
  background: linear-gradient(135deg, #f4c456, #e59b2c);
  color: #09111f;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.composer-send-btn.is-pressed {
  transform: scale(0.92);
  box-shadow: 0 0 24px rgba(244, 196, 86, 0.85);
  filter: brightness(1.18);
}

.signal-router-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 2px;
}

.signal-lane {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-lane-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.signal-router-bar[data-flow="sending"] .signal-lane-raw .signal-lane-label,
.signal-router-bar[data-flow="streaming"] .signal-lane-raw .signal-lane-label {
  color: #8cc4ff;
}

.signal-router-bar[data-flow="sending"] .signal-lane-prism .signal-lane-label,
.signal-router-bar[data-flow="streaming"] .signal-lane-prism .signal-lane-label {
  color: #6ff5e0;
}

.signal-rail {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(34, 52, 86, 0.72);
  overflow: hidden;
}

.signal-packet {
  position: absolute;
  top: 0;
  left: -38%;
  width: 38%;
  height: 100%;
  border-radius: 999px;
  opacity: 0;
}

.signal-packet-raw {
  background: linear-gradient(90deg, transparent, #56a5ff, #b8dcff);
  box-shadow: 0 0 12px #56a5ff;
}

.signal-packet-prism {
  background: linear-gradient(90deg, transparent, #f472b6, #3fe0c5);
  box-shadow: 0 0 12px #3fe0c5;
}

.signal-router-bar[data-flow="sending"] .signal-packet,
.signal-router-bar[data-flow="streaming"] .signal-packet {
  opacity: 1;
  animation: prismSignalPulse 0.95s ease-in-out infinite;
}

.signal-router-bar[data-flow="done"] .signal-rail {
  background: rgba(63, 224, 197, 0.22);
}

@keyframes prismSignalPulse {
  0% { left: -38%; }
  100% { left: 105%; }
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

@media (max-width: 1280px) {
  .cdiss-side-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 960px) {
  body.compare-body {
    overflow: auto;
  }
  .compare-shell {
    height: auto;
    min-height: 100vh;
  }
  .chat-col-headers,
  .turn-replies-grid,
  .turn-inspect-drawer,
  .deep-replies-grid,
  .diff-banner-grid,
  .field-row-3 {
    grid-template-columns: 1fr;
  }
  .col-head-raw,
  .arm-raw {
    border-right: none;
    border-bottom: 1px solid rgba(48, 72, 112, 0.55);
  }
}
