:root {
  --bg: #09090b;
  --surface-1: #0f0f12;
  --surface-2: #16161a;
  --surface-3: #1e1e24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --primary-bg: #fafafa;
  --primary-fg: #09090b;
  --primary-hover: #e4e4e7;

  --live: #f59e0b;
  --live-soft: rgba(245, 158, 11, 0.11);
  --live-border: rgba(245, 158, 11, 0.34);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.11);
  --ok-border: rgba(16, 185, 129, 0.32);

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.11);
  --danger-border: rgba(239, 68, 68, 0.34);

  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.11);
  --accent-border: rgba(56, 189, 248, 0.32);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 11px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ico-sm {
  width: 12px;
  height: 12px;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ======================== Top Navigation Bar ======================== */
.topbar {
  height: 48px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  width: 18px;
  height: 18px;
  color: var(--live);
}

.brand-name {
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.03em;
}

.topbar-sep {
  color: var(--text-muted);
  opacity: 0.45;
  flex-shrink: 0;
}

.brand-sub {
  color: var(--text-secondary);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineage-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.ctl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.ctl-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

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

.ctl-btn.active,
.ctl-split.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.branch-btn {
  max-width: 170px;
}

.branch-btn-name {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 120ms ease, transform 80ms ease;
}

.share-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.ctl-subtle-link {
  background: transparent;
  color: var(--text-secondary);
}

.ctl-subtle-link:hover:not(:disabled) {
  color: var(--text);
}

.wasm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 220px;
}

.wasm-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.status-dot.ready {
  background: var(--ok);
}

.status-dot.loading,
.status-dot.busy {
  background: var(--live);
  animation: pulse-ring 1.3s ease-in-out infinite;
}

.status-dot.error {
  background: var(--danger);
}

.cancel-exec-btn {
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 600;
}

.cancel-exec-btn:hover {
  background: rgba(239, 68, 68, 0.22);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); opacity: 0.72; }
}

/* Popover Dropdowns */
.dropdown-wrap {
  position: relative;
}

.popover-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 248px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  padding: 6px;
  z-index: 60;
}

.popover-right {
  left: auto;
  right: 0;
  min-width: 205px;
}

.popover-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.branch-menu-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.branch-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
}

.branch-menu-item:hover {
  background: var(--surface-3);
}

.branch-menu-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.branch-menu-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.branch-menu-name {
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-menu-sha {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.branch-create-form {
  display: flex;
  gap: 5px;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}

.branch-create-form input {
  flex: 1;
  min-width: 0;
  height: 27px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  outline: none;
}

.branch-create-form input:focus {
  border-color: var(--border-strong);
}

.btn-subtle {
  height: 27px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  font-size: 11.5px;
  font-weight: 500;
}

.btn-subtle:hover {
  background: #282830;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.menu-item:hover {
  background: var(--surface-3);
}

.menu-item.danger {
  color: #fca5a5;
}

.menu-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ======================== Contextual Relay Strip ======================== */
.relay-strip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 5px 14px;
  background: #121216;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.relay-strip.diverged {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(56, 189, 248, 0.05));
  border-bottom-color: rgba(245, 158, 11, 0.22);
  color: var(--text);
}

.relay-strip.shared {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.09), rgba(16, 185, 129, 0.05));
  border-bottom-color: rgba(56, 189, 248, 0.24);
  color: var(--text);
}

.relay-strip-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.relay-state-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.relay-state-pill.live {
  color: var(--live);
  background: var(--live-soft);
  border-color: var(--live-border);
}

.relay-state-pill.fail {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.relay-state-pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: var(--ok-border);
}

.relay-id-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.relay-summary {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 440px;
}

.relay-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.relay-lineage-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.relay-lineage-link:hover {
  background: rgba(56, 189, 248, 0.2);
}

.relay-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.strip-action {
  height: 23px;
  padding: 0 9px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.strip-action:hover {
  background: var(--surface-3);
}

.strip-action-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
  font-weight: 600;
}

.strip-action-primary:hover {
  background: var(--primary-hover);
}

/* Mobile Pane Switcher (hidden on desktop) */
.mobile-pane-bar {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.mobile-pane-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.mobile-pane-btn.active {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text);
}

.mobile-pane-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.mobile-pane-count:empty {
  display: none;
}

.mobile-ram-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mobile-ram-dot.live {
  background: var(--live);
}

.mobile-ram-dot.dead {
  background: var(--danger);
}

.mobile-ram-dot.ok {
  background: var(--ok);
}

.strip-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
}

.strip-dismiss:hover {
  color: var(--text);
}

/* ======================== Main Workspace (Single Universe) ======================== */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 338px;
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.pane-timeline {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
}

.pane-heart {
  background: var(--surface-1);
  border-left: 1px solid var(--border);
}

.pane-head {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.pane-head-tabs {
  padding-left: 6px;
}

.pane-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.pane-head-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.ghost-xs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ghost-xs:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-xs:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn-xs:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-xs-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
  font-weight: 600;
}

.btn-xs-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-xs.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-xs.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ======================== Left Rail: SVG Commit DAG ======================== */
.dirty-guard,
.inline-commit-form {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dirty-guard {
  background: rgba(245, 158, 11, 0.08);
  border-bottom-color: var(--live-border);
}

.dirty-guard-msg {
  font-size: 11.5px;
  color: #fde68a;
}

.dirty-guard-btns,
.inline-commit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inline-commit-form input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 12px;
  outline: none;
}

.dag-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.dag-wrap {
  position: relative;
}

.dag-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.dag-rows {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.dag-row {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}

.dag-row:hover {
  background: var(--surface-2);
}

.dag-row.active-head {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}

.dag-row.working-row {
  border: 1px dashed var(--live-border);
  background: rgba(245, 158, 11, 0.05);
  cursor: default;
}

.dag-row.dangling-row {
  opacity: 0.52;
}

.dag-row.dangling-row:hover {
  opacity: 0.9;
}

.dag-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dag-row-top {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ref-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-badge.head {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
}

.commit-sha {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.commit-state-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
}

.commit-state-tag.live {
  color: var(--live);
}

.commit-state-tag.fail {
  color: var(--danger);
}

.commit-state-tag.ok {
  color: var(--ok);
}

.dag-row-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.dag-row-msg {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dag-row.active-head .dag-row-msg {
  color: var(--text);
}

.dag-row-hover {
  display: none;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
}

.dag-step-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 4px;
  height: 15px;
  line-height: 15px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  flex-shrink: 0;
}

.dag-step-tag.merge {
  color: #a7f3d0;
  border-color: var(--ok-border);
  background: var(--ok-soft);
}

.dag-step-tag.fs {
  color: #bae6fd;
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.file-sidebar-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.diff-after-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  min-width: 0;
}

.diff-after-label {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.diff-after-bar input,
.probe-form-row input {
  flex: 1;
  min-width: 0;
  height: 25px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text);
  outline: none;
}

.diff-after-bar input:focus,
.probe-form-row input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.probe-form {
  margin-top: 8px;
}

.probe-form-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.after-verdict-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.after-verdict-card.same {
  border-color: var(--ok-border);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), var(--surface-1));
}

.after-verdict-card.apart {
  border-color: var(--live-border);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--surface-1));
}

.split-parting-tag.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: var(--ok-border);
}

.split-parting-tag.fail {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.dag-row:hover .dag-row-hover {
  display: flex;
}

.dag-row:hover .commit-state-tag {
  display: none;
}

.dag-mini-act {
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 10.5px;
}

.dag-mini-act:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ======================== Center Stage: Tabs, Console, Editor, Diff ======================== */
.tab-bar {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}

.tab-btn {
  height: 100%;
  padding: 0 11px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: color 100ms ease, border-color 100ms ease;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.center-view {
  position: relative;
  display: none;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.center-view.active {
  display: flex;
}

/* ======================== Boot Progress Overlay ======================== */
.boot-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  opacity: 1;
  transition: opacity 220ms ease;
}

.boot-overlay.boot-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-card {
  width: 100%;
  max-width: 440px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.boot-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.boot-mark {
  width: 20px;
  height: 20px;
  color: var(--live);
  flex-shrink: 0;
}

.boot-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.boot-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.boot-progress-track {
  height: 5px;
  width: 100%;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.boot-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--live), var(--accent));
  transition: width 160ms ease-out;
}

.boot-progress-fill.indeterminate {
  width: 36%;
  animation: boot-slide 1.2s ease-in-out infinite;
}

.boot-progress-fill.cached {
  background: var(--ok);
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

.boot-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.boot-progress-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boot-progress-pct {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ======================== First-Visit Quick-Try Strip ======================== */
.quicktry-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), var(--surface-1));
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 180ms ease;
}

.quicktry-card.quicktry-used {
  opacity: 0.72;
}

.quicktry-card.quicktry-used:hover {
  opacity: 1;
}

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

.quicktry-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.quicktry-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 3px;
}

.quicktry-dismiss:hover {
  color: var(--text);
}

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

.quicktry-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}

.quicktry-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.quicktry-btn-top {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.quicktry-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--live);
  background: var(--live-soft);
  border: 1px solid var(--live-border);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
  flex-shrink: 0;
}

.quicktry-btn[data-quicktry="split"] .quicktry-num {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.quicktry-btn[data-quicktry="shell"] .quicktry-num {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: var(--ok-border);
}

.quicktry-btn[data-quicktry="share"] .quicktry-num {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.quicktry-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.quicktry-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Optional Free-Play Sparks */
.sparks-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  background: #0c0c0f;
  overflow-x: auto;
}

.sparks-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.spark-chip {
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11.5px;
  white-space: nowrap;
  transition: border-color 110ms ease, color 110ms ease, background 110ms ease;
}

.spark-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-3);
}

/* Execution Block Console Stream */
.console-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exec-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  overflow: hidden;
}

.exec-block.state-crash {
  border-color: var(--danger-border);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.05), var(--surface-1) 48px);
}

.exec-block.state-system {
  border-style: dashed;
  background: transparent;
}

.exec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.exec-cmd-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.exec-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.exec-tag.py { color: #fde68a; background: rgba(245, 158, 11, 0.14); }
.exec-tag.sh { color: #bae6fd; background: rgba(56, 189, 248, 0.14); }
.exec-tag.git { color: #a7f3d0; background: rgba(16, 185, 129, 0.14); }

.exec-cmd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.exec-pill {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
}

.exec-pill.live { color: var(--live); background: var(--live-soft); }
.exec-pill.ok { color: var(--ok); background: var(--ok-soft); }
.exec-pill.fail { color: var(--danger); background: var(--danger-soft); }

.exec-body {
  padding: 9px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e4e4e7;
}

.exec-body.stderr {
  color: #fca5a5;
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.04);
}

.exec-body.dim {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.exec-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Multi-Mode Composer */
.composer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.mode-switch {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

.mode-pill:hover {
  color: var(--text-secondary);
}

.mode-pill.active {
  background: var(--surface-3);
  color: var(--text);
}

.composer-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.composer-input-row:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
}

.composer-prompt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--live);
  line-height: 22px;
  user-select: none;
  flex-shrink: 0;
}

#composer-input {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 22px;
  color: var(--text);
}

#composer-input::placeholder {
  color: var(--text-muted);
}

.run-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: 5px;
  border: none;
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.run-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.run-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ======================== View 2: Live VFS Editor ======================== */
.editor-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
}

.file-sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.new-file-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.new-file-form input {
  width: 100%;
  height: 25px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
}

.mode-switch-xs .mode-pill {
  padding: 2px 6px;
  font-size: 10.5px;
}

.ram-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ram-section + .ram-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ram-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.ram-vars-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ram-var-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.ram-var-row.row-changed {
  animation: row-flash 900ms ease-out;
}

.ram-var-row.row-diff {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.ram-var-k {
  color: var(--live);
  flex-shrink: 0;
}

.ram-var-v {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.file-group-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 4px 6px 2px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.file-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.file-item.active {
  background: var(--surface-3);
  color: var(--text);
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rootfs-summary {
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rootfs-bins {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--text-muted);
  word-break: break-word;
}

.editor-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.editor-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: #0c0c0f;
}

.editor-path-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.editor-path {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.code-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 12px 14px;
  background: var(--bg);
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  tab-size: 4;
}

/* ======================== View 3: 3-Layer Causal Diff ======================== */
.diff-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #0c0c0f;
  min-width: 0;
}

.diff-select-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diff-select-wrap label {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.diff-select-wrap select,
.uni-branch-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 27px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  outline: none;
}

.diff-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.diff-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parting-card {
  border: 1px solid var(--live-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--surface-1));
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.parting-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.parting-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fde68a;
}

.parting-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.parting-track {
  display: flex;
  align-items: center;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-3);
}

.parting-track-shared {
  height: 100%;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), var(--ok));
}

.parting-track-diverge {
  height: 100%;
  background: var(--danger);
}

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

.parting-side {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 8px 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow-x: auto;
}

.parting-side.left { border-left: 2px solid var(--danger); }
.parting-side.right { border-left: 2px solid var(--ok); }

.parting-side-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.diff-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  overflow: hidden;
}

.diff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.02);
}

.diff-code {
  margin: 0;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  overflow-x: auto;
}

.diff-ln {
  display: block;
  padding: 0 10px;
  white-space: pre;
}

.diff-ln.add { background: rgba(16, 185, 129, 0.12); color: #86efac; }
.diff-ln.del { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.diff-ln.hdr { color: var(--accent); background: rgba(56, 189, 248, 0.07); }

/* ======================== Right Rail: The Live Memory Heart ======================== */
.heart-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.heartbeat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 180ms ease, background 180ms ease;
}

.heartbeat-card.is-live {
  border-color: var(--live-border);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), var(--surface-2) 60%);
}

.heartbeat-card.is-dead {
  border-color: var(--danger-border);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), var(--surface-2) 60%);
}

.hb-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hb-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.heartbeat-card.is-live .hb-pulse {
  background: var(--live);
  animation: pulse-ring 2s ease-in-out infinite;
}

.heartbeat-card.is-dead .hb-pulse {
  background: var(--danger);
}

.hb-titles {
  min-width: 0;
}

.hb-status {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hb-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

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

.hb-metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 7px;
}

.hb-metric-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.hb-metric-v {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-resurrect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: #fca5a5;
}

/* Live :memory: SQLite Card */
.ram-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ram-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ram-card-title {
  font-size: 12.5px;
  font-weight: 600;
}

.ram-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.ram-probe-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ram-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ram-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}

.ram-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ram-table tr:last-child td {
  border-bottom: none;
}

.ram-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ram-table tr.row-changed {
  animation: row-flash 900ms ease-out;
}

.ram-table tr.row-diff {
  background: rgba(56, 189, 248, 0.11);
}

@keyframes row-flash {
  0% { background: rgba(245, 158, 11, 0.28); }
  100% { background: transparent; }
}

.ram-empty {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

.ram-quarantine {
  margin-top: 6px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--live-border);
  background: var(--live-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fde68a;
}

.ram-insert-form {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ram-insert-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.ram-insert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px auto;
  gap: 5px;
}

.ram-insert-row input {
  height: 26px;
  min-width: 0;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  outline: none;
}

.ram-insert-row input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Collapsible OS & Wasm Proof Drawer */
.proof-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  overflow: hidden;
}

.proof-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  user-select: none;
}

.proof-summary::-webkit-details-marker {
  display: none;
}

.proof-summary:hover {
  background: var(--surface-3);
}

.proof-summary-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.proof-body {
  padding: 0 11px 11px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proof-sec-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 8px;
}

.proof-kv {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

.fd-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

/* ======================== Mode 2: Fork Split Parallel Universes ======================== */
.split-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.split-bridge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.split-bridge-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-bridge-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.split-columns {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.universe-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.universe-pane[data-side="left"] {
  border-right: 1px solid var(--border-strong);
}

.universe-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.universe-head-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.universe-head-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.uni-tag {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.uni-tag-a {
  background: rgba(244, 244, 245, 0.14);
  color: var(--text);
}

.uni-tag-b {
  background: var(--accent-soft);
  color: var(--accent);
}

.uni-branch-select {
  max-width: 170px;
}

.uni-pulse-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.uni-pulse-badge.live { color: var(--live); background: var(--live-soft); border: 1px solid var(--live-border); }
.uni-pulse-badge.dead { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger-border); }
.uni-pulse-badge.settled { color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border); }

.universe-ram {
  flex-shrink: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #0c0c0f;
  max-height: 210px;
  overflow-y: auto;
}

.universe-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

.universe-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

.universe-form input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.split-parting-bar {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
}

.split-parting-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
  line-height: 1.4;
}

.split-parting-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--live);
  background: var(--live-soft);
  border: 1px solid var(--live-border);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ======================== Minimal Single-Line Footer ======================== */
.footer {
  height: 29px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.footer-mode {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-sep {
  opacity: 0.4;
  flex-shrink: 0;
}

.footer-cmd {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-copy {
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 10.5px;
  flex-shrink: 0;
}

.footer-copy:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.footer-right {
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ======================== Modals & Toast ======================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.modal-card-wide {
  max-width: 660px;
}

.modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 15px 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.copy-box code {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.relay-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.relay-step-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.share-receipt {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ok-border);
  background: var(--ok-soft);
  font-size: 12px;
  color: #a7f3d0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.share-preview-chip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.share-dirty-pill {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--live);
  background: var(--live-soft);
  border: 1px solid var(--live-border);
}

.share-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.share-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.share-field input[type="text"],
.share-field input[type="password"],
.share-field input[type="url"] {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.share-field input[type="password"],
.share-field input[type="url"] {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.share-field input:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.share-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.share-check-row input[type="checkbox"] {
  accent-color: var(--live);
  margin: 0;
}

.share-notice {
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--live-border);
  background: var(--live-soft);
  color: #fde68a;
  font-size: 12px;
  line-height: 1.5;
}

.share-error {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: #fca5a5;
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-word;
}

.share-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.share-token-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 7px 9px;
}

.share-token-details summary {
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.share-token-details[open] summary {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.blurb-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.blurb-preview {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.blurb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ======================== About / How It Works Modal ======================== */
.about-spec-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.about-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
}

.about-workflow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.about-wf-step {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.about-wf-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.about-wf-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.about-cmd-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
}

.about-cmd-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 10px;
  font-size: 11.5px;
  align-items: baseline;
}

.about-cmd-row code {
  color: var(--text);
  font-size: 11px;
}

.about-cmd-row span {
  color: var(--text-muted);
}

.about-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

.about-footer-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.about-footer-link:hover {
  text-decoration: underline;
}

.hub-remote-row {
  display: flex;
  gap: 6px;
}

.hub-remote-row input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  outline: none;
}

.toast {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  z-index: 120;
  white-space: nowrap;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ======================== Responsive Protection ======================== */
@media (max-width: 1180px) {
  .brand-sub,
  .topbar-sep {
    display: none;
  }
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr) 300px;
  }
}

@media (max-width: 920px) {
  .topbar {
    height: auto;
    min-height: 46px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 8px;
    padding: 6px 10px;
  }
  .topbar-left {
    order: 1;
  }
  .topbar-right {
    order: 2;
    gap: 5px;
  }
  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    gap: 5px;
  }
  .wasm-status {
    max-width: 150px;
  }
  .mobile-pane-bar {
    display: flex;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .workspace .pane-timeline,
  .workspace .pane-center,
  .workspace .pane-heart {
    display: none;
    flex: 1;
    min-height: 0;
    border: none;
  }
  .workspace[data-mobile-pane="center"] .pane-center,
  .workspace[data-mobile-pane="timeline"] .pane-timeline,
  .workspace[data-mobile-pane="heart"] .pane-heart {
    display: flex;
  }
  .split-columns {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }
  .universe-pane {
    min-height: 280px;
  }
  .universe-pane[data-side="left"] {
    border-right: none;
    border-bottom: 1px solid var(--border-strong);
  }
  .relay-strip {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  .relay-summary {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 6px 8px;
  }
  .topbar-right .btn-label {
    display: none;
  }
  .topbar-right .ctl-btn {
    padding: 0 7px;
    height: 28px;
  }
  .topbar-right .icon-btn {
    width: 28px;
    height: 28px;
  }
  .topbar-right .btn-primary {
    height: 28px;
    padding: 0 9px;
  }
  .topbar-center .ctl-btn {
    height: 27px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  .branch-btn {
    max-width: 120px;
  }
  .lineage-pill {
    display: none;
  }
  .wasm-status {
    height: 26px;
    padding: 0 7px;
    max-width: 115px;
    font-size: 10.5px;
  }
  .wasm-status.is-ready .wasm-status-text {
    display: none;
  }
  .quicktry-grid,
  .about-workflow,
  .parting-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-cmd-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .composer-hint {
    display: none;
  }
  .editor-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .file-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 148px;
  }
  .diff-toolbar {
    flex-wrap: wrap;
  }
  .diff-select-wrap {
    flex: 1 1 140px;
  }
  .split-bridge {
    flex-wrap: wrap;
    padding: 7px 10px;
  }
  .footer {
    padding: 0 10px;
    gap: 8px;
  }
  .footer-right {
    display: none;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-card {
    max-height: calc(100vh - 20px);
  }
}
