:root {
  color-scheme: dark;
  --bg: #071012;
  --bg-raised: #0a171a;
  --panel: #101b20;
  --panel-soft: #14252b;
  --panel-strong: #1b3037;
  --line: #244149;
  --line-strong: #3a6870;
  --text: #f3f5f8;
  --text-soft: #c4d7dc;
  --text-muted: #7f9aa1;
  --text-faint: #5d747a;
  --blue: #5aa7ff;
  --green: #39c07f;
  --amber: #e6a93a;
  --red: #e35f5f;
  --cyan: #4bd7e8;
  --violet: #b6a4ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --radius-small: 6px;
  --font:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(75, 215, 232, 0.055), transparent 250px),
    radial-gradient(
      circle at 50% -12%,
      rgba(74, 215, 232, 0.15),
      transparent 34rem
    ),
    linear-gradient(
      90deg,
      rgba(57, 192, 127, 0.035),
      transparent 34%,
      rgba(90, 167, 255, 0.035)
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.cockpit-shell {
  min-height: 100vh;
  padding: 14px;
}

body.logged-out .cockpit-shell > :not(.trust-bar) {
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 15, 20, 0.82);
}

body.logged-in .auth-gate {
  display: none;
}

.auth-card {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h1,
.panel-header h2,
.operation-card h2,
.restore-card h2,
.restore-inline-card h2,
.drawer-header h2,
.mobile-state-summary h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-copy,
.state-copy,
.operation-summary,
.operation-evidence,
.confirmation-copy,
.restore-card p,
.restore-inline-card p,
.technical-copy,
.conversation-list p {
  color: var(--text-soft);
  line-height: 1.5;
}

.login-panel {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.login-panel label {
  color: var(--text-muted);
  font-size: 13px;
}

.login-panel input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #12151b;
  color: var(--text);
  padding: 0 12px;
}

.auth-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.trust-bar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(220px, 1.1fr) minmax(
      300px,
      auto
    );
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 18, 21, 0.94);
  backdrop-filter: blur(16px);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-small);
  background:
    radial-gradient(
      circle at 38% 26%,
      rgba(255, 255, 255, 0.95),
      transparent 0 6px
    ),
    linear-gradient(145deg, #56f0ff, #214f58 62%, #071012);
  color: #061012;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(75, 215, 232, 0.24);
}

.brand-title {
  margin: 0;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.trust-chip,
.safe-id {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(12, 26, 31, 0.82);
  color: var(--text-soft);
  padding: 4px 10px;
  font-size: 12px;
}

.trust-chip.state-connected,
.trust-chip.state-listening,
.trust-chip.state-user-speaking,
.trust-chip.state-speaking {
  border-color: rgba(57, 192, 127, 0.45);
  color: #9ee6bf;
}

.trust-chip.state-connecting,
.trust-chip.state-thinking,
.trust-chip.state-genesis-running,
.trust-chip.state-result-ready,
.trust-chip.state-reconnecting,
.trust-chip.state-confirmation {
  border-color: rgba(230, 169, 58, 0.5);
  color: #f1cc83;
}

.trust-chip.state-error,
.trust-chip.state-blocked {
  border-color: rgba(227, 95, 95, 0.5);
  color: #f0a0a0;
}

.mode-controls,
.segmented,
.primary-actions,
.operation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-controls {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #091317;
}

.segmented-btn,
.mode-btn,
.btn,
.thumb-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-soft);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.segmented-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
  text-decoration: none;
}

.segmented-btn:hover,
.mode-btn:hover,
.btn:hover,
.thumb-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.segmented-btn.active,
.mode-btn.active {
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.12);
  color: #d9ecff;
}

body.conversation-interpreter #interpreterModeBtn {
  border-color: rgba(155, 140, 255, 0.5);
  background: rgba(155, 140, 255, 0.14);
  color: #e2ddff;
}

.btn {
  justify-content: center;
  padding: 0 16px;
  font-weight: 700;
}

.btn-primary {
  border-color: rgba(75, 215, 232, 0.55);
  background: linear-gradient(180deg, #1d8595, #145466);
  color: #fff;
  box-shadow: 0 0 24px rgba(75, 215, 232, 0.16);
}

.btn-approve,
.thumb-btn.approve {
  border-color: rgba(57, 192, 127, 0.5);
  background: rgba(57, 192, 127, 0.13);
  color: #a9edc7;
}

.btn-cancel,
.thumb-btn.cancel {
  border-color: rgba(227, 95, 95, 0.5);
  background: rgba(227, 95, 95, 0.12);
  color: #f0a0a0;
}

.btn:disabled,
.thumb-btn:disabled,
.mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(560px, 1fr) minmax(
      320px,
      0.42fr
    );
  grid-template-rows: minmax(0, 0.68fr) minmax(0, 0.32fr);
  gap: 12px;
  align-items: stretch;
  height: min(900px, calc(100svh - 96px));
  min-height: 0;
  margin-top: 12px;
}

body.mode-jury .cockpit-grid {
  grid-template-columns: minmax(240px, 300px) 0.96fr 1.16fr 0.72fr;
}

body.session-sidebar-collapsed:not(.mode-jury) .cockpit-grid {
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 0.42fr);
}

body.mode-jury.session-sidebar-collapsed .cockpit-grid {
  grid-template-columns: 0.96fr 1.16fr 0.72fr;
}

.panel,
.stage-panel,
.operation-card,
.restore-inline-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  background: rgba(12, 24, 29, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.panel:hover,
.stage-panel:hover {
  border-color: rgba(88, 166, 255, 0.22);
  box-shadow: 0 8px 32px rgba(88, 166, 255, 0.06);
}

.panel,
.stage-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel {
  padding: 12px;
}

.left-rail {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.left-rail .session-sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(75, 215, 232, 0.03), transparent 38%),
    rgba(5, 10, 13, 0.92);
  border-color: rgba(255, 255, 255, 0.04);
}

body.session-sidebar-collapsed .left-rail {
  display: none;
}

body.session-sidebar-collapsed:not(.mode-jury) .conversation-panel,
body.mode-jury.session-sidebar-collapsed .conversation-panel {
  grid-column: 1;
}

.conversation-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(75, 215, 232, 0.04), transparent 34%),
    rgba(8, 15, 19, 0.82);
}

.conversation-panel > .panel-header,
.conversation-signal-stack,
.chat-transcript-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage-panel {
  grid-column: 3;
  grid-row: 1;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

body.session-sidebar-collapsed:not(.mode-jury) .stage-panel,
body.session-sidebar-collapsed:not(.mode-jury) .right-rail,
body.mode-jury.session-sidebar-collapsed .stage-panel {
  grid-column: 2;
}

body.status-rail-collapsed:not(.mode-jury) .right-rail {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 12px;
}

.conversation-panel > .panel-header:not([hidden]),
.conversation-panel .chat-transcript-head:not([hidden]),
.conversation-panel .chat-session-identity {
  display: flex;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  padding: 10px 16px 0;
}

.conversation-panel .conversation-signal-stack:not([hidden]) {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

.conversation-panel > .panel-header {
  padding-bottom: 8px;
  border-bottom: 0;
}

.panel-kicker,
.eyebrow,
.card-label,
.operation-meta span,
.restore-meta dt,
.technical-grid dt {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intent-card,
.response-card,
.decision-note,
.blocker-card,
.conversation-item,
.evidence-card,
.timeline-item,
.jury-summary-card,
.technical-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-soft);
}

.conversation-signal-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px;
}

.intent-card,
.response-card,
.decision-note,
.blocker-card,
.jury-summary-card {
  padding: 12px;
  margin-bottom: 0;
}

.intent-card,
.response-card {
  border-color: rgba(75, 215, 232, 0.1);
  background: rgba(12, 23, 28, 0.38);
  min-height: 54px;
}

.intent-card p:last-child,
.response-card p:last-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.decision-note {
  display: none;
}

.intent-card p:last-child,
.response-card p:last-child,
.decision-note p:last-child,
.blocker-card p:last-child,
.jury-summary-card p:last-child {
  margin-bottom: 0;
}

.blocker-card {
  border-color: rgba(227, 95, 95, 0.48);
  background: rgba(227, 95, 95, 0.08);
}

.quiet-main-detail {
  display: none !important;
}

/* ── Compact agent status and native plan inside conversation flow ── */
.live-work-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.live-work-panel:empty,
.live-work-panel:not(:has(.status-card:not([hidden]))) {
  display: none;
}

.status-card {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid rgba(75, 215, 232, 0.08);
  border-radius: var(--radius-small);
  background: rgba(12, 23, 28, 0.28);
  min-height: 0;
}

.status-card .card-label {
  display: block;
  margin: 0 0 6px;
}

.status-card .agent-status-list {
  display: grid;
  gap: 4px;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.status-card .agent-status-item {
  display: grid;
  gap: 2px;
  padding: 5px 7px;
  border-left: 2px solid rgba(75, 215, 232, 0.35);
  background: rgba(16, 31, 36, 0.22);
  border-radius: 0 4px 4px 0;
}

.status-card .agent-status-item strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.status-card .agent-status-item p,
.status-card .agent-status-item time,
.status-card .agent-status-empty,
.native-turn-state p,
.native-turn-state time {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.native-turn-state {
  display: grid;
  gap: 3px;
  padding: 6px 8px;
  border-left: 2px solid rgba(75, 215, 232, 0.38);
  border-radius: 0 4px 4px 0;
  background: rgba(16, 31, 36, 0.22);
}

.native-turn-state strong {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.25;
}

.native-turn-card[data-turn-state="running"] .native-turn-state {
  border-left-color: rgba(251, 191, 36, 0.7);
}

.native-turn-card[data-turn-state="stuck"] .native-turn-state {
  border-left-color: rgba(248, 113, 113, 0.75);
}

.native-turn-card[data-turn-state="answered"] .native-turn-state {
  border-left-color: rgba(110, 231, 183, 0.68);
}

.status-card .native-todo-list {
  display: grid;
  gap: 4px;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.native-todo-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgba(75, 215, 232, 0.08);
  border-radius: 4px;
  background: rgba(16, 31, 36, 0.18);
}

.native-todo-status {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 18px;
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--mono);
  border: 1px solid var(--line);
  text-transform: uppercase;
}

.native-todo-item.done .native-todo-status {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.5);
}

.native-todo-item.active .native-todo-status {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.55);
}

.native-todo-item.blocked .native-todo-status {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.55);
}

.native-todo-item strong {
  min-width: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ── Chat rules moved to css/chat-*.css; keep structural non-chat rules here ── */

.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;
}

.codex-bridge-grid {
  order: 3;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  opacity: 0.72;
}

.codex-bridge-chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(8, 15, 19, 0.82);
  color: var(--text-soft);
  padding: 6px 8px;
  font-size: 0.72rem;
}

.codex-bridge-chip[data-bridge-state="open"],
.codex-bridge-chip[data-bridge-state="live"],
.codex-bridge-chip[data-bridge-state="empty"] {
  border-color: rgba(57, 192, 127, 0.34);
  color: #a9edc7;
}

.codex-bridge-chip[data-bridge-state="waiting"],
.codex-bridge-chip[data-bridge-state="pending"],
.codex-bridge-chip[data-bridge-state="checking"] {
  border-color: rgba(230, 169, 58, 0.38);
  color: #f1cc83;
}

.codex-bridge-chip[data-bridge-state="closed"],
.codex-bridge-chip[data-bridge-state="blocked"],
.codex-bridge-chip[data-bridge-state="none"] {
  border-color: rgba(227, 95, 95, 0.34);
  color: #f0a0a0;
}

.mod-routing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mod-routing-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mod-routing-grid span {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.mod-routing-grid select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #101820;
  color: var(--text-soft);
  padding: 0 8px;
  font-size: 0.76rem;
}

.native-session-field {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.35fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(91, 110, 120, 0.22);
  border-radius: var(--radius-small);
  background: rgba(7, 14, 18, 0.42);
  padding: 8px;
  opacity: 0.94;
}

.native-session-field span {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.native-cli-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  grid-column: span 2;
  margin-bottom: 0;
}

.native-session-field > span,
.native-session-field > small {
  align-self: center;
}

.native-session-field > span,
.native-session-field > small {
  grid-column: span 2;
}

.native-session-field > input {
  display: block;
}

.native-session-field > small {
  display: block;
}

#nativeSessionRoleHint {
  color: #a9edc7;
}

#nativeSessionNewBtn {
  width: auto;
  min-width: 108px;
}

.native-cli-select {
  width: 100%;
}

.native-session-count {
  color: var(--text-faint);
  font-size: 0.68rem;
  line-height: 1.35;
}

.native-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  grid-column: span 2;
}

.native-session-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  grid-column: span 2;
}

.native-session-status-grid .codex-bridge-chip {
  padding: 5px 7px;
  font-size: 0.68rem;
}

.native-session-field input,
.native-session-field select,
.native-session-field button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(8, 15, 19, 0.92);
  color: var(--text-soft);
  padding: 0 8px;
  font-size: 0.76rem;
}

.native-session-field input {
  width: 100%;
}

.native-session-field select {
  width: 100%;
}

.native-session-field button {
  padding: 0 12px;
  color: #d9ecff;
  background: rgba(88, 166, 255, 0.14);
  cursor: pointer;
}

#nativeSessionConnectBtn {
  min-width: 94px;
  color: var(--text-faint);
  background: rgba(10, 20, 26, 0.76);
}

/* ── Chat transcript, conversation items, composer moved to css/chat-*.css ── */

.stage-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-color: rgba(75, 215, 232, 0.18);
  background:
    linear-gradient(180deg, rgba(75, 215, 232, 0.055), transparent 42%),
    rgba(9, 20, 24, 0.86);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.36),
    0 0 50px rgba(75, 215, 232, 0.07);
}

.state-stage {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-rows: auto auto auto minmax(132px, 1fr) auto auto;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px 16px 16px;
  overflow: hidden;
  border: 1px solid rgba(75, 215, 232, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(75, 215, 232, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 215, 232, 0.035) 1px, transparent 1px),
    radial-gradient(
      circle at 50% 42%,
      rgba(75, 215, 232, 0.15),
      transparent 14rem
    ),
    linear-gradient(180deg, #091b1f, #071113);
  background-size:
    100% 18px,
    18px 100%,
    auto,
    auto;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.42);
}

.state-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(75, 215, 232, 0.08);
  border-radius: var(--radius-small);
  pointer-events: none;
}

.state-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(75, 215, 232, 0.08),
    transparent
  );
  animation: stageScan 5s linear infinite;
  pointer-events: none;
}

.state-stage h1 {
  margin: 0;
  font-size: clamp(30px, 2.4vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.state-copy {
  max-width: 300px;
  margin: 0;
}

.state-indicator {
  --mic-level: 0;
  --speaker-level: 0;
  --orb-level: max(var(--mic-level), var(--speaker-level));
  position: relative;
  width: min(100%, 338px);
  height: 134px;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(86, 199, 216, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(86, 199, 216, calc(0.08 + var(--speaker-level) * 0.18)),
      transparent
    ),
    linear-gradient(rgba(86, 199, 216, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 199, 216, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(5, 17, 22, 0.96), rgba(4, 10, 14, 0.94));
  background-size:
    100% 100%,
    100% 16px,
    18px 100%,
    auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -24px 40px rgba(0, 0, 0, 0.42),
    0 0 calc(18px + var(--orb-level) * 34px) rgba(86, 199, 216, 0.14);
}

.state-indicator::before,
.state-indicator::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.state-indicator::before {
  inset: 12px;
  border: 1px solid rgba(86, 199, 216, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(
      90deg,
      rgba(86, 199, 216, 0.11),
      transparent 20% 80%,
      rgba(86, 199, 216, 0.11)
    ),
    linear-gradient(180deg, transparent, rgba(86, 199, 216, 0.08), transparent);
}

.state-indicator::after {
  left: 8%;
  right: 8%;
  bottom: 26px;
  height: 36px;
  background:
    linear-gradient(
      90deg,
      transparent 0 4%,
      rgba(86, 199, 216, 0.2) 4% 4.4%,
      transparent 4.4% 9%
    ),
    linear-gradient(
      90deg,
      transparent,
      rgba(57, 192, 127, calc(0.06 + var(--mic-level) * 0.18)),
      transparent
    );
  background-size:
    22px 100%,
    100% 100%;
  opacity: calc(0.46 + var(--orb-level) * 0.3);
}

.state-core {
  position: relative;
  width: calc(62% + var(--orb-level) * 18%);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(220, 252, 255, 0.9),
    rgba(86, 199, 216, 0.92),
    transparent
  );
  box-shadow:
    0 0 calc(18px + var(--orb-level) * 36px) rgba(86, 199, 216, 0.5),
    0 0 calc(10px + var(--mic-level) * 26px) rgba(57, 192, 127, 0.28);
  transform: translateY(calc(var(--speaker-level) * -8px));
  transition:
    transform 90ms linear,
    box-shadow 140ms ease,
    width 140ms ease,
    background 160ms ease;
  z-index: 3;
}

.state-core::before,
.state-core::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(86, 199, 216, 0.36),
    transparent
  );
}

.state-core::before {
  top: 40%;
  transform: translateY(-24px);
}

.state-core::after {
  bottom: 40%;
  transform: translateY(24px);
}

.voice-aura {
  position: absolute;
  left: -18%;
  right: -18%;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(57, 192, 127, calc(0.14 + var(--mic-level) * 0.24)),
    rgba(86, 199, 216, calc(0.12 + var(--speaker-level) * 0.28)),
    transparent
  );
  filter: blur(12px);
  opacity: calc(0.28 + var(--orb-level) * 0.36);
  z-index: 0;
}

.aura-one {
  top: 28px;
  transform: rotate(-2deg) translateX(calc(var(--mic-level) * 16px));
}

.aura-two {
  bottom: 24px;
  filter: blur(10px);
  opacity: calc(0.24 + var(--speaker-level) * 0.36);
  transform: rotate(2deg) translateX(calc(var(--speaker-level) * -16px));
}

.voice-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 74px;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(224, 251, 255, 0.18),
    transparent
  );
  transform: translateX(-150%);
  animation: signalSweep 4.2s ease-in-out infinite;
  box-shadow: 0 0 calc(10px + var(--orb-level) * 22px) rgba(86, 199, 216, 0.28);
  opacity: calc(0.44 + var(--orb-level) * 0.28);
  z-index: 4;
}

.state-ring {
  position: absolute;
  border: 0;
  border-radius: 0;
  z-index: 2;
}

.ring-one {
  left: 12%;
  right: 12%;
  top: 50%;
  height: 38px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(86, 199, 216, 0.24);
  border-bottom: 1px solid rgba(86, 199, 216, 0.12);
}

.ring-two {
  top: 16%;
  bottom: 16%;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(220, 252, 255, 0.34),
    transparent
  );
}

.state-indicator.listening .state-core {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(220, 255, 241, 0.92),
    rgba(57, 192, 127, 0.95),
    transparent
  );
}

.state-indicator.listening .ring-one {
  animation: softPulse 1.8s ease-in-out infinite;
  border-color: rgba(57, 192, 127, 0.58);
}

.state-indicator.thinking .state-core,
.state-indicator.reconnecting .state-core {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 238, 189, 0.9),
    rgba(230, 169, 58, 0.9),
    transparent
  );
}

.state-indicator.thinking .ring-one,
.state-indicator.reconnecting .ring-one {
  border-color: rgba(230, 169, 58, 0.65);
  animation: signalPulse 1.1s ease-in-out infinite;
}

.state-indicator.thinking .ring-two,
.state-indicator.reconnecting .ring-two {
  background: linear-gradient(
    180deg,
    transparent,
    rgba(230, 169, 58, 0.44),
    transparent
  );
  animation: signalPulse 1.6s ease-in-out infinite reverse;
}

.state-indicator.speaking .state-core {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(230, 252, 255, 0.95),
    rgba(86, 199, 216, 0.98),
    transparent
  );
}

.state-indicator.error .state-core,
.state-indicator.blocked .state-core {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 220, 220, 0.9),
    rgba(240, 91, 91, 0.95),
    transparent
  );
}

.waveform {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 7px;
  align-items: end;
  z-index: 5;
}

.state-indicator.speaking .waveform {
  display: flex;
}

.waveform i {
  display: block;
  width: 7%;
  max-width: 18px;
  height: calc(8px + var(--orb-level) * 18px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), var(--cyan));
  opacity: calc(0.36 + var(--orb-level) * 0.36);
  animation: meter 980ms ease-in-out infinite;
}

.waveform i:nth-child(2) {
  animation-delay: 90ms;
}

.waveform i:nth-child(3) {
  animation-delay: 160ms;
}

.waveform i:nth-child(4) {
  animation-delay: 230ms;
}

.waveform i:nth-child(5) {
  animation-delay: 300ms;
}

.voice-visualizers {
  width: min(100%, 440px);
  display: grid;
  gap: 10px;
}

.voice-visualizers.compact {
  margin-top: 12px;
  width: 100%;
}

.voice-channel {
  --voice-level: 0;
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(
      circle at calc(12% + var(--voice-level) * 28%) 50%,
      rgba(86, 199, 216, calc(0.08 + var(--voice-level) * 0.18)),
      transparent 42%
    ),
    rgba(18, 22, 29, 0.86);
  transition:
    border-color 180ms ease,
    opacity 180ms ease,
    background 180ms ease;
}

.voice-channel.active {
  border-color: rgba(86, 199, 216, 0.5);
}

.voice-channel.input-channel.active {
  border-color: rgba(57, 192, 127, 0.56);
}

.voice-channel.muted {
  opacity: 0.58;
}

.voice-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
}

.voice-channel-header strong {
  color: var(--text-soft);
  font-size: 12px;
}

.voice-meter {
  height: 30px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.voice-meter i {
  --bar-level: 0.08;
  display: block;
  height: calc(8px + var(--bar-level) * 34px);
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--cyan));
  box-shadow: 0 0 calc(8px + var(--bar-level) * 18px) rgba(86, 199, 216, 0.26);
  transition:
    height 70ms linear,
    opacity 120ms ease,
    box-shadow 120ms ease;
}

.input-channel .voice-meter i {
  background: linear-gradient(180deg, rgba(238, 255, 247, 0.94), var(--green));
  box-shadow: 0 0 calc(8px + var(--bar-level) * 18px) rgba(57, 192, 127, 0.24);
}

.voice-channel.muted .voice-meter i {
  height: 8px;
  opacity: 0.38;
  box-shadow: none;
}

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

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

@keyframes softPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes meter {
  0%,
  100% {
    height: 10px;
  }
  50% {
    height: 28px;
  }
}

@keyframes stageScan {
  to {
    transform: translateY(360%);
  }
}

@keyframes signalSweep {
  0%,
  18% {
    transform: translateX(-150%);
  }
  52%,
  70% {
    transform: translateX(150%);
  }
  100% {
    transform: translateX(150%);
  }
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(-50%) scaleX(0.94);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1.04);
  }
}

.operation-status {
  min-height: 22px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.operation-card {
  padding: 10px;
}

.operation-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.operation-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.operation-meta div,
.restore-meta div,
.technical-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #161a21;
  padding: 7px;
}

.operation-meta strong,
.restore-meta dd,
.technical-grid dd {
  display: block;
  min-width: 0;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-summary {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.confirmation-block {
  margin-top: 12px;
  border: 1px solid rgba(230, 169, 58, 0.5);
  border-radius: var(--radius);
  background: rgba(230, 169, 58, 0.09);
  padding: 14px;
}

.operation-card.needs-confirmation {
  border-color: rgba(230, 169, 58, 0.65);
  box-shadow: 0 0 0 1px rgba(230, 169, 58, 0.16);
}

.not-started {
  margin: 0 0 8px;
  color: #f1cc83;
  font-weight: 750;
}

.operation-evidence {
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #161a21;
  padding: 8px;
  max-height: 92px;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.primary-actions {
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.primary-actions .btn {
  min-width: 0;
  min-height: 34px;
  padding-inline: 8px;
  font-size: 12px;
  line-height: 1.15;
  white-space: normal;
}

.readiness-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.readiness-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #151920;
  padding: 6px 7px;
}

.readiness-item span,
.readiness-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-item span {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.readiness-item strong {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.readiness-item.ready,
.readiness-item.warm {
  border-color: rgba(57, 192, 127, 0.36);
  background: rgba(57, 192, 127, 0.08);
}

.readiness-item.ready strong,
.readiness-item.warm strong {
  color: #9ee6bf;
}

.readiness-item.cold,
.readiness-item.muted {
  border-color: rgba(230, 169, 58, 0.4);
  background: rgba(230, 169, 58, 0.08);
}

.readiness-item.cold strong,
.readiness-item.muted strong {
  color: #f1cc83;
}

.readiness-item.blocked {
  border-color: rgba(227, 95, 95, 0.44);
  background: rgba(227, 95, 95, 0.08);
}

.readiness-item.blocked strong {
  color: #f0a0a0;
}

.context-fabric-panel {
  min-width: 0;
  border: 1px solid rgba(75, 215, 232, 0.22);
  border-radius: var(--radius-small);
  background:
    linear-gradient(90deg, rgba(75, 215, 232, 0.08), transparent 65%), #10151c;
  padding: 10px;
}

.context-fabric-panel .operation-card-header {
  margin-bottom: 6px;
}

.context-fabric-todos .evidence-todo-list {
  gap: 4px;
  margin-top: 6px;
}

.context-fabric-todos .evidence-todo-item {
  padding: 5px 7px;
}

.context-fabric-more {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.control-note,
.thumb-note {
  margin: 4px auto 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.thumb-note {
  display: none;
}

.right-rail {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0.96;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

body.mode-jury.session-sidebar-collapsed .right-rail {
  grid-column: 3;
}

.status-rail {
  --status-rail-panel-opacity: 0.72;
  isolation: isolate;
}

.status-rail .panel {
  border-color: rgba(75, 215, 232, 0.12);
}

.stage-panel::-webkit-scrollbar,
.right-rail::-webkit-scrollbar {
  width: 8px;
}

.stage-panel::-webkit-scrollbar-thumb,
.right-rail::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line-strong);
}

/* ── ChatGPT-style Session Sidebar ── */

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  flex: 0 0 auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-brand-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, #56f0ff, #214f58 62%, #071012);
  color: #061012;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 14px rgba(75, 215, 232, 0.18);
  flex: 0 0 auto;
}

.sidebar-brand-text {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--text);
}

.sidebar-close-btn {
  display: none;
}

/* ── New Session button ── */
.sidebar-new-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px;
  padding: 0 14px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease;
  flex: 0 0 auto;
}

.sidebar-new-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

/* ── Search ── */
.sidebar-search-wrap {
  position: relative;
  margin: 0 12px;
  flex: 0 0 auto;
}

.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-search {
  width: 100%;
  min-height: 36px;
  padding: 0 10px 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 13px;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.sidebar-search::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-search:focus {
  outline: none;
  border-color: rgba(75, 215, 232, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Session list ── */
.sidebar-sessions {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0 6px;
  display: flex;
  flex-direction: column;
}

.sidebar-session-select {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
  padding: 2px 4px;
}

.sidebar-session-select::-webkit-scrollbar {
  width: 5px;
}

.sidebar-session-select::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-session-select option {
  padding: 9px 10px;
  margin: 1px 0;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-soft);
  background: transparent;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 100ms ease;
  min-height: 38px;
}

.sidebar-session-select option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-session-select option:checked {
  background: rgba(75, 215, 232, 0.13);
  color: #d9f9ff;
  font-weight: 550;
}

/* When a real session (non-placeholder) is selected via :checked */
.sidebar-session-select option:checked:not([value=""]) {
  background: rgba(75, 215, 232, 0.15);
  border: none;
}

.sidebar-session-select:focus {
  outline: none;
}

.sidebar-session-select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 8px;
}

/* ── Bottom area ── */
.sidebar-bottom {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.sidebar-count {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.sidebar-selected-note {
  display: block;
  color: #9ee6bf;
  font-size: 11px;
  line-height: 1.3;
  min-height: 14px;
}

.sidebar-selected-note[data-readiness="preparing"],
.sidebar-selected-note[data-readiness="terminal-ready"] {
  color: #a9d8ff;
}

.sidebar-selected-note[data-readiness="ready"] {
  color: #9ee6bf;
}

.sidebar-selected-note[data-readiness="blocked"] {
  color: #ffb3b3;
}

.sidebar-selected-note:empty {
  display: none;
}

.sidebar-connect-btn {
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.sidebar-connect-btn[hidden] {
  display: none;
}

.sidebar-load-more-btn {
  min-height: 30px;
  margin: 0 14px 6px;
}

.sidebar-connect-btn:not(:disabled):hover {
  background: rgba(75, 215, 232, 0.1);
  border-color: rgba(75, 215, 232, 0.25);
  color: var(--text);
}

.sidebar-connect-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Hidden technical elements ── */
.sidebar-tech-hidden {
  display: none !important;
}

.timeline-panel,
.evidence-panel {
  min-height: 0;
}

.timeline-panel {
  opacity: var(--status-rail-panel-opacity);
  background: rgba(8, 15, 19, 0.46);
  box-shadow: none;
}

.timeline-panel:hover,
.timeline-panel:focus-within {
  opacity: 0.9;
}

.timeline-panel .panel-header {
  margin-bottom: 6px;
  padding-bottom: 7px;
}

.timeline-panel .panel-header h2 {
  color: var(--text-muted);
  font-size: 14px;
}

.timeline-panel .panel-kicker {
  font-size: 10px;
}

.timeline-list,
.evidence-list {
  display: grid;
  gap: 8px;
  max-height: min(34vh, 360px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.timeline-list::-webkit-scrollbar,
.evidence-list::-webkit-scrollbar {
  width: 8px;
}

.timeline-list::-webkit-scrollbar-thumb,
.evidence-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line-strong);
}

.timeline-list {
  max-height: 112px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 9px;
  background: rgba(16, 31, 36, 0.62);
}

.timeline-panel .timeline-item {
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 7px;
  padding: 6px;
  background: rgba(16, 31, 36, 0.34);
}

.timeline-panel .timeline-dot {
  width: 7px;
  height: 7px;
}

.timeline-panel .timeline-item h3 {
  font-size: 12px;
}

.timeline-panel .timeline-item p,
.timeline-panel .timeline-item time {
  font-size: 11px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.timeline-item.done .timeline-dot {
  background: var(--green);
}

.timeline-item.warning .timeline-dot,
.timeline-item.working .timeline-dot {
  background: var(--amber);
}

.timeline-item.connected .timeline-dot {
  background: var(--blue);
}

.timeline-item.error .timeline-dot {
  background: var(--red);
}

.timeline-item h3,
.evidence-card h3,
.technical-section h3 {
  margin: 0;
  font-size: 14px;
}

.timeline-item time {
  display: block;
  margin-top: 2px;
}

.timeline-item p,
.evidence-card p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
}

.panel-pager[hidden] {
  display: none;
}

.pager-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #161a21;
  color: var(--text);
  cursor: pointer;
}

.pager-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pager-label {
  min-width: 44px;
  text-align: center;
}

.btn.busy,
.thumb-btn.busy {
  opacity: 0.72;
  cursor: progress;
}

.evidence-card {
  min-width: 0;
  padding: 10px;
  overflow: hidden;
}

.status-rail .evidence-card {
  background: rgba(16, 31, 36, 0.46);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.evidence-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 8px;
  background: #161a21;
}

.evidence-grid span {
  display: block;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.evidence-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.evidence-readable-template {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.evidence-readable-template div {
  min-width: 0;
  border: 1px solid rgba(75, 215, 232, 0.18);
  border-radius: var(--radius-small);
  padding: 9px;
  background:
    linear-gradient(90deg, rgba(75, 215, 232, 0.08), transparent 70%),
    rgba(10, 20, 24, 0.72);
}

.evidence-readable-template span {
  display: block;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.evidence-readable-template strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.evidence-todo-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.evidence-todo-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #12161d;
}

.evidence-todo-status {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 20px;
  border-radius: var(--radius-small);
  color: var(--text-muted);
  font-size: 11px;
  border: 1px solid var(--line);
}

.evidence-todo-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.evidence-todo-item.done .evidence-todo-status {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.5);
}

.evidence-todo-item.active .evidence-todo-status {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.55);
}

.evidence-todo-item.blocked .evidence-todo-status {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.55);
}

.jury-panel {
  min-height: 100%;
}

.restore-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 19, 24, 0.72);
}

.restore-card {
  width: min(100%, 460px);
  border: 1px solid rgba(230, 169, 58, 0.65);
  border-radius: var(--radius);
  background: #211d15;
  box-shadow: var(--shadow);
  padding: 22px;
}

.restore-meta,
.technical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.restore-inline-card {
  border-color: rgba(230, 169, 58, 0.55);
  background: #211d15;
  padding: 14px;
}

.mobile-state-summary,
.mobile-tabs,
.thumb-actions {
  display: none;
}

.technical-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 55;
  width: min(100%, 520px);
  background: rgba(0, 0, 0, 0.35);
}

.drawer-shell {
  height: 100%;
  overflow: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.drawer-header,
.technical-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.technical-section {
  padding: 12px;
  margin-top: 12px;
}

.technical-log {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  margin-top: 10px;
}

.transcript-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #14171d;
  padding: 9px;
}

.transcript-label {
  display: block;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.transcript-text {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  line-height: 1.45;
  word-break: break-word;
}

body.restore-pending .btn-primary,
body.restore-pending .thumb-btn.primary {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .trust-bar {
    grid-template-columns: 1fr;
  }

  .trust-strip,
  .mode-controls {
    justify-content: flex-start;
  }

  .cockpit-grid,
  body.mode-jury .cockpit-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    height: auto;
  }

  .conversation-panel,
  .left-rail,
  .stage-panel,
  .evidence-panel,
  .right-rail,
  .jury-panel {
    grid-column: 1 / -1;
  }

  .conversation-panel {
    grid-row: auto;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
}

@media (max-width: 780px) {
  body {
    padding-bottom: 0;
    overflow-y: hidden;
  }

  .cockpit-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100svh;
    padding: 0;
    overflow: hidden;
  }

  .trust-bar {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    border-radius: 0;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }

  .brand-subtitle,
  .workspace-chip,
  #workspaceChip,
  #operationMiniChip,
  .account-action {
    display: none;
  }

  .trust-strip {
    gap: 5px;
  }

  .mode-controls {
    overflow-x: visible;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  #technicalDrawerBtn {
    display: none;
  }

  .mobile-state-summary {
    display: none;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 14px;
  }

  .mobile-state-summary p {
    margin: 0;
    color: var(--text-muted);
  }

  .mobile-state-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    align-items: center;
    gap: 10px;
  }

  .mobile-state-summary h2 {
    margin-top: 4px;
    font-size: 32px;
  }

  .mobile-voice-core {
    justify-self: end;
    width: 104px;
    height: 104px;
  }

  .mobile-voice-core .state-core {
    width: 48px;
    height: 48px;
  }

  .mobile-voice-core .voice-scan {
    width: 78px;
    height: 28px;
  }

  .mobile-state-summary .voice-visualizers {
    gap: 8px;
  }

  .mobile-state-summary .voice-channel {
    padding: 9px 10px;
  }

  .mobile-state-summary .voice-meter {
    height: 30px;
  }

  .codex-bridge-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-grid,
  body.mode-jury .cockpit-grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    gap: 0;
    overflow: hidden;
  }

  .stage-panel {
    display: none;
    margin-bottom: 10px;
    max-height: none;
    overflow-y: visible;
  }

  .stage-panel .state-stage {
    display: none;
  }

  .state-stage {
    min-height: 260px;
  }

  .state-stage h1 {
    font-size: 34px;
  }

  .state-indicator {
    width: 132px;
    height: 132px;
  }

  .state-core {
    width: 62px;
    height: 62px;
  }

  .voice-scan {
    width: 96px;
    height: 34px;
  }

  .mobile-panel,
  .left-rail,
  .right-rail,
  .jury-panel {
    display: none;
    margin-top: 10px;
    max-height: none;
    overflow-y: visible;
  }

  body.tab-conversation [data-mobile-panel="conversation"] {
    display: flex;
  }

  body.tab-plan [data-mobile-panel="plan"],
  body.tab-evidence [data-mobile-panel="evidence"] {
    display: block;
  }

  body.tab-plan .right-rail,
  body.tab-evidence .right-rail {
    display: block;
    max-height: calc(100svh - 132px);
    overflow-y: auto;
  }

  body.tab-plan .left-rail {
    display: block;
    max-height: calc(100svh - 132px);
    overflow-y: auto;
  }

  body.mode-jury .jury-panel:not([hidden]) {
    display: block;
  }

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

  .timeline-list,
  .evidence-list {
    max-height: 52vh;
  }

  .primary-actions {
    display: none;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(96px, 1.2fr);
    flex: 0 0 auto;
    gap: 4px;
    margin: 0;
    padding: 6px 8px;
    border-top: 1px solid rgba(75, 215, 232, 0.08);
    background: var(--panel);
  }

  .mobile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--panel-soft);
    color: var(--text-soft);
  }

  .mobile-tab.active {
    border-color: rgba(88, 166, 255, 0.5);
    color: #d9ecff;
  }

  .mobile-session-toggle {
    gap: 6px;
    padding: 0 8px;
    overflow: hidden;
    white-space: nowrap;
  }

  .mobile-session-toggle span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .thumb-actions {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(23, 26, 33, 0.98);
    box-shadow: var(--shadow);
  }

  .thumb-btn {
    min-width: 0;
    min-height: 44px;
    padding-inline: 6px;
    font-size: 13px;
    line-height: 1.15;
    white-space: normal;
  }

  .thumb-note {
    display: block;
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
  }

  .thumb-btn {
    min-width: 0;
    min-height: 42px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.12;
  }

  .operation-card.needs-confirmation {
    position: static;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .restore-inline-card:not([hidden]) {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 86px;
    z-index: 38;
    max-height: calc(100vh - 170px);
    overflow: auto;
    box-shadow: var(--shadow);
  }

  .technical-drawer {
    width: 100%;
  }

  .auth-card {
    padding: 22px;
  }
}

/* Genesis Trace Panel - Symmetric & Compact */
.genesis-trace-panel {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  background: rgba(23, 26, 33, 0.6);
  padding: 14px;
  margin-top: 14px;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.genesis-trace-panel.active-run-active {
  border-color: rgba(57, 192, 127, 0.4);
  box-shadow: 0 0 16px rgba(57, 192, 127, 0.12);
  animation: traceGlow 2s infinite alternate;
}

@keyframes traceGlow {
  0% {
    border-color: rgba(57, 192, 127, 0.25);
    box-shadow: 0 0 8px rgba(57, 192, 127, 0.08);
  }
  100% {
    border-color: rgba(57, 192, 127, 0.55);
    box-shadow: 0 0 20px rgba(57, 192, 127, 0.22);
  }
}

.trace-status-copy {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.trace-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.trace-meta-item {
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-small);
  background: rgba(32, 38, 49, 0.4);
  padding: 8px 10px;
}

.trace-meta-item span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.trace-meta-item strong {
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

.trace-lane-span {
  grid-column: span 2;
}

.trace-evidence-block {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 12px;
}

.trace-evidence-preview {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  max-height: 180px;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text-soft);
  padding: 9px 10px;
  background: rgba(18, 21, 27, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-small);
}

.trace-evidence-label {
  margin-bottom: 5px;
  color: #9ee6bf;
  font-size: 11px;
  font-weight: 700;
}

.trace-evidence-status,
.trace-evidence-waiting,
.trace-evidence-safe-output {
  margin: 0;
}

.trace-evidence-status + .trace-evidence-label {
  margin-top: 6px;
}

/* Module 1 follow-up: voice-first hierarchy */
.trust-bar {
  min-height: 54px;
}

/* Trust-bar sidebar toggle – compact icon style */
#sessionSidebarToggleBtn {
  min-width: 38px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#sessionSidebarToggleBtn::before {
  content: "";
  display: block;
  width: 14px;
  height: 12px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' viewBox='0 0 16 14'%3E%3Crect y='0' width='16' height='2' rx='1'/%3E%3Crect y='6' width='16' height='2' rx='1'/%3E%3Crect y='12' width='16' height='2' rx='1'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  flex: 0 0 auto;
}

#sessionSidebarToggleBtn.active::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' viewBox='0 0 16 14'%3E%3Crect y='0' width='16' height='2' rx='1'/%3E%3Crect y='6' width='16' height='2' rx='1'/%3E%3Crect y='12' width='16' height='2' rx='1'/%3E%3C/svg%3E");
}

.trust-chip,
.safe-id {
  min-height: 24px;
  max-width: 160px;
  padding: 3px 8px;
  font-size: 11px;
}

.mode-btn {
  min-height: 32px;
  padding: 0 9px;
}

.segmented-btn {
  min-height: 28px;
  padding: 0 8px;
}

@media (min-width: 1181px) {
  .cockpit-shell {
    display: flex;
    min-height: 0;
    height: 100svh;
    flex-direction: column;
    overflow: hidden;
  }

  .cockpit-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.mode-jury) .cockpit-grid {
    grid-template-columns: minmax(260px, 320px) minmax(560px, 1fr) minmax(
        300px,
        360px
      );
  }

  body.session-sidebar-collapsed:not(.mode-jury) .cockpit-grid {
    grid-template-columns: minmax(560px, 1fr) minmax(300px, 360px);
  }

  body.mode-jury .cockpit-grid {
    grid-template-columns: minmax(240px, 300px) 0.9fr 1.16fr 0.72fr;
  }

  .conversation-panel {
    opacity: 1;
  }

  body:not(.mode-jury) .conversation-panel {
    grid-column: 2;
  }

  body.session-sidebar-collapsed:not(.mode-jury) .conversation-panel {
    grid-column: 1;
  }

  body:not(.mode-jury) .stage-panel {
    grid-column: 3;
    grid-row: 1;
  }

  body:not(.mode-jury) .right-rail {
    grid-column: 3;
    grid-row: 2;
  }

  body.session-sidebar-collapsed:not(.mode-jury) .stage-panel,
  body.session-sidebar-collapsed:not(.mode-jury) .right-rail {
    grid-column: 2;
  }

  .conversation-panel .panel-header h2 {
    font-size: 20px;
  }

  .conversation-signal-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 16px;
  }

  .intent-card,
  .response-card,
  .decision-note,
  .blocker-card,
  .codex-text-form {
    padding: 10px 12px;
  }

  .state-stage {
    min-height: 330px;
    padding: 18px 16px 16px;
  }

  .state-indicator {
    width: min(100%, 338px);
    height: 134px;
  }

  .state-core {
    width: calc(62% + var(--orb-level) * 18%);
    height: 3px;
  }

  .voice-scan {
    width: 74px;
    height: auto;
  }

  .ring-one {
    inset: auto 12%;
    top: 50%;
  }

  .ring-two {
    inset: 16% auto 16% 50%;
  }

  .readiness-panel {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    opacity: 0.74;
  }

  .readiness-item {
    padding: 6px 7px;
    background: rgba(10, 20, 24, 0.58);
  }

  .readiness-item span {
    font-size: 9px;
  }

  .readiness-item strong {
    font-size: 11px;
  }

  .operation-card,
  .genesis-trace-panel {
    padding: 12px;
    background: rgba(10, 20, 24, 0.54);
    border-color: rgba(75, 215, 232, 0.08);
    box-shadow: none;
  }

  .operation-card-header {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  .operation-card h2,
  .genesis-trace-panel h2 {
    font-size: 17px;
  }

  .operation-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .operation-meta div,
  .trace-meta-item {
    padding: 6px 7px;
    background: rgba(8, 17, 20, 0.58);
  }

  .operation-summary,
  .operation-evidence,
  .trace-status-copy {
    font-size: 12px;
    line-height: 1.35;
  }

  .operation-evidence,
  .trace-evidence-preview {
    max-height: 96px;
  }

  .genesis-trace-panel {
    margin-top: 0;
    opacity: 0.72;
  }

  .right-rail {
    opacity: 0.96;
  }

  .right-rail .panel {
    padding: 8px;
    background: rgba(10, 20, 24, 0.54);
    box-shadow: none;
  }

  .right-rail:hover,
  .right-rail:focus-within {
    opacity: 0.96;
  }

  .right-rail .panel-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .right-rail .panel-header h2 {
    font-size: 19px;
  }

  .timeline-list,
  .evidence-list {
    max-height: min(32vh, 300px);
    gap: 7px;
  }

  .timeline-item {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }

  .timeline-dot {
    width: 8px;
    height: 8px;
  }

  .timeline-item h3,
  .evidence-card h3 {
    font-size: 13px;
  }

  .timeline-item p,
  .evidence-card p {
    font-size: 12px;
    line-height: 1.3;
  }
}

/* Mobile text overlap & layout robustness */
@media (max-width: 780px) {
  body {
    padding-bottom: 10px;
  }

  .cockpit-shell {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }

  .trust-bar {
    order: 1;
    gap: 7px;
    padding: 7px 8px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .brand-title {
    font-size: 14px;
  }

  .trust-chip {
    min-height: 22px;
    max-width: 132px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .mode-controls {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow: visible;
    scrollbar-width: none;
  }

  .mode-controls::-webkit-scrollbar {
    display: none;
  }

  .mode-btn {
    flex: 0 1 auto;
    min-height: 30px;
    padding: 0 7px;
    font-size: 10px;
    white-space: nowrap;
  }

  .segmented-btn {
    min-height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }

  .mobile-state-summary {
    order: 1;
    min-height: min(54svh, 430px);
    display: grid;
    align-content: center;
    padding: 16px 12px;
    background:
      radial-gradient(
        circle at 50% 46%,
        rgba(75, 215, 232, 0.18),
        transparent 13rem
      ),
      linear-gradient(180deg, rgba(75, 215, 232, 0.07), rgba(7, 16, 18, 0.92));
    border-color: rgba(75, 215, 232, 0.18);
  }

  .mobile-state-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .mobile-state-summary h2 {
    font-size: clamp(28px, 10vw, 42px) !important;
    word-break: break-word;
    line-height: 1.08;
  }

  .mobile-voice-core {
    justify-self: center;
    width: min(62vw, 220px);
    height: min(62vw, 220px);
  }

  .mobile-voice-core .state-core {
    width: min(28vw, 98px);
    height: min(28vw, 98px);
  }

  .mobile-voice-core .voice-scan {
    width: min(48vw, 168px);
    height: min(17vw, 58px);
  }

  .mobile-voice-core .ring-one {
    inset: 42px;
  }

  .mobile-voice-core .ring-two {
    inset: 10px;
  }

  .mobile-state-summary .voice-visualizers {
    max-width: 330px;
    margin: 8px auto 0;
  }

  .mobile-state-summary .voice-channel {
    padding: 7px 9px;
  }

  .mobile-state-summary .voice-meter {
    height: 24px;
  }

  .thumb-actions {
    order: 4;
    margin-top: 8px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  }

  .thumb-btn {
    min-height: 38px;
    font-size: 10px;
  }

  .thumb-note {
    display: none;
  }

  .mobile-tabs {
    order: 2;
    margin-top: 6px;
  }

  .mobile-tab {
    min-height: 36px;
    font-size: 12px;
  }

  .cockpit-grid {
    order: 5;
  }

  .cockpit-grid .conversation-panel {
    order: -3;
  }

  .cockpit-grid .left-rail {
    order: -2;
  }

  .cockpit-grid .stage-panel {
    order: 2;
  }

  .cockpit-grid .right-rail {
    order: 3;
  }

  .left-rail {
    order: 2;
  }

  .stage-panel {
    order: 3;
  }

  .right-rail {
    order: 3;
  }

  body.tab-conversation [data-mobile-panel="conversation"] {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--mobile-chat-chrome-h));
    min-height: 0;
    overflow: hidden;
  }

  body.tab-conversation .conversation-panel {
    height: calc(100dvh - var(--mobile-chat-chrome-h));
    opacity: 1;
  }

  .conversation-panel {
    display: flex;
    flex-direction: column;
    height: calc(100svh - 92px);
    min-height: 0;
    overflow: hidden;
  }

  body.tab-conversation .stage-panel,
  body.tab-conversation .left-rail,
  body.tab-conversation .right-rail,
  body.tab-conversation .jury-panel {
    display: none;
  }

  body.tab-conversation .mobile-state-summary,
  body.tab-conversation .thumb-actions {
    display: none;
  }

  body.tab-conversation .trust-bar {
    padding: 8px 10px;
  }

  body.tab-conversation .trust-strip,
  body.tab-conversation .mode-controls {
    display: none;
  }

  body.tab-conversation .cockpit-grid {
    order: 3;
    flex: 1 1 auto;
    margin-top: 8px;
    min-height: 0;
  }

  body.tab-plan .mobile-state-summary,
  body.tab-evidence .mobile-state-summary {
    min-height: auto;
    align-content: start;
    padding: 10px;
  }

  body.tab-plan .mobile-state-head,
  body.tab-evidence .mobile-state-head {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
    text-align: left;
    gap: 8px;
  }

  body.tab-plan .mobile-state-summary h2,
  body.tab-evidence .mobile-state-summary h2 {
    font-size: 22px !important;
  }

  body.tab-plan .mobile-voice-core,
  body.tab-evidence .mobile-voice-core {
    width: 72px;
    height: 72px;
  }

  body.tab-plan .mobile-voice-core .state-core,
  body.tab-evidence .mobile-voice-core .state-core {
    width: 32px;
    height: 32px;
  }

  body.tab-plan .mobile-voice-core .voice-scan,
  body.tab-evidence .mobile-voice-core .voice-scan,
  body.tab-plan .mobile-state-summary .voice-visualizers,
  body.tab-evidence .mobile-state-summary .voice-visualizers {
    display: none;
  }

  body.session-sidebar-open .cockpit-grid .left-rail {
    position: fixed;
    inset: 72px 8px 10px;
    z-index: 46;
    display: block;
    max-height: none;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(7, 16, 18, 0.98);
    box-shadow: var(--shadow);
  }

  body.session-sidebar-open .left-rail .session-sidebar {
    height: 100%;
    border-radius: var(--radius);
    background: rgba(5, 10, 13, 0.98);
  }

  body.session-sidebar-open .sidebar-header {
    align-items: center;
    gap: 12px;
  }

  body.session-sidebar-open .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(75, 215, 232, 0.24);
    border-radius: 999px;
    background: rgba(12, 26, 32, 0.82);
    color: var(--text-soft);
    font: inherit;
    font-size: 0;
    font-weight: 750;
  }

  body.session-sidebar-open .sidebar-close-btn::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
  }

  body.session-sidebar-collapsed .cockpit-grid .left-rail {
    display: none;
  }

  #nativeSessionNewBtn {
    min-width: 0;
  }

  .native-session-row {
    grid-column: span 1;
  }

  .trust-strip {
    justify-content: flex-start;
  }

  .trace-meta-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .trace-lane-span {
    grid-column: span 1;
  }
}
