:root {
  --bg-dark: #07090e;
  --panel-bg: rgba(13, 18, 28, 0.94);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --cyan: #00f0ff;
  --gold: #fbbf24;
  --emerald: #10b981;
  --magenta: #f43f5e;
  --purple: #a855f7;
  --blue: #3b82f6;
  --orange: #f97316;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", monospace;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  height: 54px;
  background: #090d15;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
  flex-shrink: 0;
}

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

.brand-logo {
  font-size: 20px;
  filter: drop-shadow(0 0 8px var(--orange));
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metrics-strip {
  display: flex;
  gap: 14px;
  align-items: center;
}

.metric-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.metric-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  font-family: monospace;
}

/* Compact Metrics Dropdown Header */
.metrics-summary-wrap {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.metrics-summary-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
}

.metric-compact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 58px;
}

.metrics-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: rgba(11, 16, 26, 0.98);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.15);
  padding: 14px;
  z-index: 1000;
  min-width: 440px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.metrics-summary-wrap:hover .metrics-dropdown {
  display: block;
}

.metrics-dropdown-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.metrics-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-box-pop {
  display: flex;
  flex-direction: column;
}

.metric-box-pop .metric-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.metric-box-pop .metric-val {
  font-size: 13px;
  font-weight: 700;
  font-family: monospace;
}

/* Header Eco Badge */
.btn-eco-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.btn-eco-toggle.live {
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
}

.btn-eco-toggle:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

/* Header Speed Bar */
.header-speed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
}

.speed-btn-group {
  display: flex;
  gap: 3px;
}

.btn-speed {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-speed:hover, .btn-speed.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-speed.btn-slow, .btn-speed-chip.btn-slow {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.btn-speed.btn-slow:hover, .btn-speed.btn-slow.active,
.btn-speed-chip.btn-slow:hover, .btn-speed-chip.btn-slow.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

.btn-speed.btn-warp {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-speed.btn-warp:hover, .btn-speed.btn-warp.active {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: #fbbf24;
}

.header-speed-slider-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-adaptive-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  transition: all 0.15s ease;
}

.btn-adaptive-toggle.disabled {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.badge-life-burst {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #10b981;
  animation: pulseLife 1.5s infinite;
}

@keyframes pulseLife {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.03); }
}

.btn-speed-chip {
  padding: 4px 6px;
  font-size: 10px;
  text-align: center;
}

/* Workspace */
.workspace {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Panels */
.panel-left {
  width: 350px;
  min-width: 300px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
  z-index: 5;
  flex-shrink: 0;
}

.panel-left.collapsed {
  margin-left: -350px;
}

.panel-right {
  width: 380px;
  min-width: 320px;
  background: var(--panel-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: margin-right 0.25s ease;
  z-index: 5;
  flex-shrink: 0;
  overflow-y: auto;
}

.panel-right.collapsed {
  margin-right: -380px;
}

.panel-header {
  height: 38px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Catalog Controls */
.catalog-controls {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-input {
  width: 100%;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  outline: none;
}

.search-input:focus {
  border-color: var(--cyan);
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.btn-filter-group {
  display: flex;
  gap: 4px;
}

.btn-filter {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
}

.btn-filter.active {
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.4);
  font-weight: bold;
}

select, .sort-select {
  padding: 4px 8px;
  background: #0d1424;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 11px;
  outline: none;
  cursor: pointer;
  appearance: auto;
}

select:focus, .sort-select:focus {
  border-color: var(--cyan);
}

select option, .sort-select option {
  background: #0d1424;
  color: #f1f5f9;
  padding: 6px 10px;
}

/* AI Triad Tab Styling */
.ai-cycle-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.ai-role-tag {
  font-weight: bold;
  font-size: 10px;
  display: inline-block;
  margin-right: 4px;
}

.mol-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.mol-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.mol-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mol-formula {
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
}

.mol-name {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.mol-badge {
  font-size: 10px;
  font-weight: bold;
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-box {
  height: 160px;
  overflow-y: auto;
  padding: 8px;
  font-size: 10px;
  font-family: monospace;
}

.log-entry {
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
  line-height: 1.3;
}

.log-ts {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-synthesis { color: var(--cyan); }
.log-autocatalysis { color: var(--magenta); font-weight: bold; }
.log-avalanche { color: var(--orange); }
.log-god { color: var(--gold); }
.log-predation { color: #f87171; font-weight: bold; }

/* Center Stage */
.stage-center {
  flex: 1 1 0%;
  min-width: 0;
  position: relative;
  background: radial-gradient(circle at 50% 100%, #170d05 0%, #07090e 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Eco Mode Standby Overlay */
#ecoOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(13, 20, 32, 0.96) 0%, rgba(7, 9, 14, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
  text-align: center;
  transition: opacity 0.3s ease;
}

.eco-card {
  max-width: 520px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.08);
}

.eco-icon {
  font-size: 38px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.5));
}

.eco-title {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.eco-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.eco-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eco-stat-item {
  display: flex;
  flex-direction: column;
}

.eco-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.eco-stat-val {
  font-size: 15px;
  font-weight: bold;
  font-family: monospace;
  color: #fff;
  margin-top: 2px;
}

.btn-start-render {
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  transition: all 0.2s ease;
}

.btn-start-render:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.45), rgba(16, 185, 129, 0.45));
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
}

/* Floating HUD Controls on Canvas */
.canvas-hud-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(6, 12, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 8px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.btn-hud {
  background: rgba(9, 13, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.15s ease;
}

.btn-hud:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan);
}

/* Tooltip */
#tooltip {
  position: absolute;
  display: none;
  background: rgba(9, 13, 21, 0.95);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 50;
  line-height: 1.4;
}

/* Zen / Fullscreen Mode */
body.zen-mode header,
body.zen-mode .panel-left,
body.zen-mode .panel-right {
  display: none !important;
}

body.zen-mode .workspace {
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 100% !important;
}

body.zen-mode .stage-center {
  width: 100vw !important;
  height: 100vh !important;
}

.btn-zen-exit {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: rgba(13, 20, 36, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: var(--cyan);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6), 0 0 10px rgba(0,240,255,0.2);
  backdrop-filter: blur(10px);
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-zen-exit:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.45);
}

body.zen-mode .btn-zen-exit {
  display: inline-flex !important;
}

/* Docked Object Inspector in Bottom-Right Corner of Canvas */
.object-inspector-panel {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 45;
  background: rgba(9, 14, 26, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11px;
  color: #f1f5f9;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
  animation: inspectorSlideUp 0.18s ease-out;
}

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

.insp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 8px;
  gap: 8px;
}

.insp-title-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.insp-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insp-subtitle {
  font-size: 10px;
  color: #94a3b8;
}

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

.btn-insp-tool {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-insp-tool:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan);
  color: #fff;
}

.btn-insp-tool.active {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald);
  color: #a7f3d0;
}

.btn-insp-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-insp-close:hover {
  color: #f43f5e;
}

.insp-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 7px;
}

.insp-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan);
  letter-spacing: 0.4px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
}

.insp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 10.5px;
}

.insp-val {
  color: #f1f5f9;
  font-weight: 600;
  font-family: monospace;
}

.insp-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.insp-tag {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #38bdf8;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-family: monospace;
}

.insp-tag-element {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde047;
}

.insp-tag-peptide {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: #f472b6;
}

.insp-tag-strand {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

/* Right Section Blocks */
.section-block {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
}

.engine-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}

.engine-desc {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.engine-name {
  font-weight: bold;
  color: #fff;
}

.engine-sub {
  font-size: 9px;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .2s;
  border-radius: 18px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--cyan);
}

input:checked + .slider-round:before {
  transform: translateX(16px);
}

/* Sliders */
.control-row {
  margin-bottom: 8px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.slider-val {
  font-family: monospace;
  color: var(--cyan);
  font-weight: bold;
}

input[type=range] {
  width: 100%;
  accent-color: var(--cyan);
  cursor: pointer;
}

/* Buttons */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-god {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-god:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* Dominance Slider */
.dominance-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
}

.dominance-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 4px;
}

/* AI Tab: Demiurge Operator Panel, Briefing & MCP Console */
.ai-operator-panel {
  background: rgba(14, 18, 27, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.ai-operator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-badge-status {
  font-size: 10px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-badge-status.thinking {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  animation: pulse-glow 1.5s infinite;
}

.ai-badge-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.ai-directive-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 11px;
  padding: 8px;
  resize: vertical;
  min-height: 52px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-directive-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.ai-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.btn-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 9px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Operator Briefing Card */
.ai-briefing-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.briefing-tip-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 5px 8px;
  margin-top: 4px;
  font-size: 10px;
}

.btn-apply-tip {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.btn-apply-tip:hover {
  background: #38bdf8;
  color: #000;
}

/* MCP Console */
.ai-mcp-console {
  background: #030712;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 10px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 10px;
}

.ai-mcp-log-container {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mcp-line {
  line-height: 1.35;
  word-break: break-all;
}

.mcp-badge-success { color: #10b981; font-weight: bold; }
.mcp-badge-guardrail { color: #f59e0b; font-weight: bold; }
.mcp-badge-error { color: #ef4444; font-weight: bold; }
