/* ============================================================
   WorkspaceNavigator — Two-Axis Premium Navigation
   FortLine Systems
   Horizontal: Major workspace  |  Vertical: Subcategory
   States: idle · hover · pressed · selected · disabled ·
           previewing · applied · simulating · locked
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
.wn-root {
  --wn-bg:          #0a0d14;
  --wn-surface:     #111520;
  --wn-glass:       rgba(255,255,255,0.04);
  --wn-glass-hover: rgba(255,255,255,0.07);
  --wn-border:      rgba(255,255,255,0.08);
  --wn-border-active: rgba(99,179,237,0.6);
  --wn-text-dim:    rgba(255,255,255,0.4);
  --wn-text-mid:    rgba(255,255,255,0.7);
  --wn-text-full:   rgba(255,255,255,0.95);
  --wn-accent:      #63b3ed;
  --wn-accent-glow: rgba(99,179,237,0.25);
  --wn-danger:      #fc8181;
  --wn-success:     #68d391;
  --wn-warn:        #f6ad55;
  --wn-sim:         #b794f4;
  --wn-sim-glow:    rgba(183,148,244,0.2);
  --wn-video:       #63b3ed;
  --wn-video-glow:  rgba(99,179,237,0.2);
  --wn-assets:      #68d391;
  --wn-assets-glow: rgba(104,211,145,0.2);
  --wn-settings:    #f6ad55;
  --wn-settings-glow: rgba(246,173,85,0.2);
  --wn-radius-sm:   6px;
  --wn-radius:      10px;
  --wn-radius-lg:   16px;
  --wn-transition:  200ms cubic-bezier(0.4,0,0.2,1);
  --wn-h-tab-h:     52px;
  --wn-v-tab-w:     200px;
  --wn-panel-min:   320px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Root layout ─────────────────────────────────────────── */
.wn-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wn-bg);
  color: var(--wn-text-full);
  overflow: hidden;
  position: relative;
}

/* ── Horizontal Tab Bar ───────────────────────────────────── */
.wn-h-bar {
  display: flex;
  align-items: stretch;
  height: var(--wn-h-tab-h);
  background: var(--wn-surface);
  border-bottom: 1px solid var(--wn-border);
  padding: 0 8px;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.wn-h-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: var(--wn-radius) var(--wn-radius) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  cursor: pointer;
  background: transparent;
  color: var(--wn-text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--wn-transition), color var(--wn-transition),
              border-color var(--wn-transition), box-shadow var(--wn-transition);
  position: relative;
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  margin-top: 6px;
}

.wn-h-tab:hover {
  background: var(--wn-glass-hover);
  color: var(--wn-text-mid);
}

.wn-h-tab:active {
  transform: translateY(1px);
}

.wn-h-tab.active {
  background: var(--wn-bg);
  border-color: var(--wn-border);
  color: var(--wn-text-full);
  margin-top: 4px;
  /* Merge bottom into content area */
  border-bottom: 1px solid var(--wn-bg);
  margin-bottom: -1px;
}

.wn-h-tab.active .wn-h-tab-dot {
  opacity: 1;
  transform: scale(1);
}

.wn-h-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity var(--wn-transition), transform var(--wn-transition);
  flex-shrink: 0;
}

/* Per-category accent colors */
.wn-h-tab[data-category="video"].active    { box-shadow: 0 -2px 12px var(--wn-video-glow);    }
.wn-h-tab[data-category="video"] .wn-h-tab-dot    { background: var(--wn-video);    }
.wn-h-tab[data-category="simulation"].active { box-shadow: 0 -2px 12px var(--wn-sim-glow);  }
.wn-h-tab[data-category="simulation"] .wn-h-tab-dot { background: var(--wn-sim);  }
.wn-h-tab[data-category="assets"].active   { box-shadow: 0 -2px 12px var(--wn-assets-glow);   }
.wn-h-tab[data-category="assets"] .wn-h-tab-dot   { background: var(--wn-assets);   }
.wn-h-tab[data-category="settings"].active { box-shadow: 0 -2px 12px var(--wn-settings-glow); }
.wn-h-tab[data-category="settings"] .wn-h-tab-dot { background: var(--wn-settings); }

.wn-h-tab-icon { font-size: 15px; }
.wn-h-tab-label { font-size: 13px; }

.wn-h-spacer { flex: 1; }

.wn-h-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  font-size: 11px;
  color: var(--wn-text-dim);
}

.wn-status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--wn-border);
  background: var(--wn-glass);
  font-size: 11px;
  font-weight: 500;
}

.wn-status-pill.simulating { border-color: var(--wn-sim); color: var(--wn-sim); }
.wn-status-pill.recording  { border-color: var(--wn-danger); color: var(--wn-danger); }
.wn-status-pill.idle       { color: var(--wn-text-dim); }

.wn-status-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.wn-status-pill.simulating .wn-status-led { animation: wn-pulse 1.4s ease-in-out infinite; }
.wn-status-pill.recording  .wn-status-led { animation: wn-pulse 0.8s ease-in-out infinite; }
@keyframes wn-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ── Body: Vertical nav + Content ────────────────────────── */
.wn-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Vertical Tab Rail ────────────────────────────────────── */
.wn-v-rail {
  width: var(--wn-v-tab-w);
  background: var(--wn-surface);
  border-right: 1px solid var(--wn-border);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  position: relative;
}

.wn-v-section-label {
  padding: 12px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wn-text-dim);
}

.wn-v-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--wn-text-dim);
  font-size: 13px;
  font-weight: 400;
  transition: background var(--wn-transition), color var(--wn-transition),
              border-color var(--wn-transition);
  border-left: 3px solid transparent;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.wn-v-tab:hover:not(.disabled):not(.locked) {
  background: var(--wn-glass-hover);
  color: var(--wn-text-mid);
}

.wn-v-tab:active:not(.disabled):not(.locked) {
  background: var(--wn-glass);
}

.wn-v-tab.selected {
  background: var(--wn-glass);
  color: var(--wn-text-full);
  border-left-color: var(--wn-accent);
  font-weight: 500;
}

.wn-v-tab[data-category="simulation"].selected { border-left-color: var(--wn-sim); }
.wn-v-tab[data-category="video"].selected      { border-left-color: var(--wn-video); }
.wn-v-tab[data-category="assets"].selected     { border-left-color: var(--wn-assets); }
.wn-v-tab[data-category="settings"].selected   { border-left-color: var(--wn-settings); }

.wn-v-tab.disabled { opacity: 0.35; cursor: not-allowed; }
.wn-v-tab.locked   { opacity: 0.5; cursor: not-allowed; }

.wn-v-tab.previewing { color: var(--wn-warn); border-left-color: var(--wn-warn); background: rgba(246,173,85,0.05); }
.wn-v-tab.applied    { color: var(--wn-success); }
.wn-v-tab.simulating { color: var(--wn-sim); animation: wn-sim-pulse 2s ease infinite; }
@keyframes wn-sim-pulse {
  0%,100% { background: transparent; }
  50%      { background: var(--wn-sim-glow); }
}

.wn-v-tab-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.wn-v-tab-label { flex: 1; }
.wn-v-tab-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--wn-glass);
  border: 1px solid var(--wn-border);
  color: var(--wn-text-dim);
  font-weight: 600;
}

.wn-v-tab.selected .wn-v-tab-badge {
  background: var(--wn-accent-glow);
  border-color: var(--wn-accent);
  color: var(--wn-accent);
}

.wn-v-tab-state-icon {
  font-size: 11px;
  opacity: 0.7;
}

.wn-v-divider {
  height: 1px;
  background: var(--wn-border);
  margin: 6px 0;
}

/* ── Panel Content Area ───────────────────────────────────── */
.wn-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--wn-bg);
}

.wn-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--wn-border);
  background: var(--wn-surface);
  flex-shrink: 0;
}

.wn-panel-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wn-text-dim);
}

.wn-panel-breadcrumb-sep { opacity: 0.4; }

.wn-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--wn-text-full);
}

.wn-panel-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wn-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--wn-radius-sm);
  border: 1px solid var(--wn-border);
  background: var(--wn-glass);
  color: var(--wn-text-mid);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--wn-transition), border-color var(--wn-transition),
              color var(--wn-transition), transform 80ms;
}

.wn-btn:hover  { background: var(--wn-glass-hover); color: var(--wn-text-full); }
.wn-btn:active { transform: scale(0.97); }
.wn-btn.primary {
  background: var(--wn-accent-glow);
  border-color: var(--wn-accent);
  color: var(--wn-accent);
}
.wn-btn.danger { background: rgba(252,129,129,0.1); border-color: var(--wn-danger); color: var(--wn-danger); }

.wn-panel-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Panel inner card ─────────────────────────────────────── */
.wn-card {
  background: var(--wn-surface);
  border: 1px solid var(--wn-border);
  border-radius: var(--wn-radius);
  overflow: hidden;
}

.wn-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wn-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--wn-text-mid);
  letter-spacing: 0.02em;
}

.wn-card-body { padding: 14px; }

/* ── Empty / loading states ───────────────────────────────── */
.wn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--wn-text-dim);
  text-align: center;
}

.wn-empty-icon { font-size: 36px; opacity: 0.4; }
.wn-empty-title { font-size: 14px; font-weight: 600; }
.wn-empty-sub   { font-size: 12px; max-width: 260px; line-height: 1.6; }

/* ── Resize handle ────────────────────────────────────────── */
.wn-resize-handle {
  width: 4px;
  background: transparent;
  cursor: col-resize;
  transition: background 150ms;
  flex-shrink: 0;
}
.wn-resize-handle:hover { background: var(--wn-border-active); }

/* ── Scrollbar ────────────────────────────────────────────── */
.wn-v-rail::-webkit-scrollbar,
.wn-panel-body::-webkit-scrollbar { width: 4px; }
.wn-v-rail::-webkit-scrollbar-track,
.wn-panel-body::-webkit-scrollbar-track { background: transparent; }
.wn-v-rail::-webkit-scrollbar-thumb,
.wn-panel-body::-webkit-scrollbar-thumb { background: var(--wn-border); border-radius: 2px; }
.c3d-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 550px;
  background-color: #0a0c10;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  color: #e2e8f0;
}

.c3d-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating Header */
.c3d-header {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.c3d-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: linear-gradient(135deg, #00d4ff 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.c3d-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Popout Settings Panel */
.c3d-settings-panel {
  position: absolute;
  top: 76px;
  left: 16px;
  width: 320px;
  max-height: calc(100% - 96px);
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.c3d-panel-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.c3d-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c3d-control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.c3d-control-group input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.c3d-control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  -webkit-transition: transform 0.1s ease;
  transition: transform 0.1s ease;
}

.c3d-control-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.c3d-control-group select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.c3d-control-group select:focus {
  border-color: #38bdf8;
}

/* Selected Node Details Box */
.c3d-details-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c3d-details-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.c3d-details-symbol {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #c084fc;
}

.c3d-details-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.c3d-details-desc {
  font-size: 0.7rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

.c3d-details-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
}

.c3d-details-placeholder {
  font-size: 0.7rem;
  color: #64748b;
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

/* Right Side Workflow Watching Panel */
.c3d-workflow-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 340px;
  height: calc(100% - 32px);
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.c3d-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 45%;
  overflow-y: auto;
}

.c3d-task-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.c3d-task-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.c3d-task-name {
  font-weight: 600;
  color: #cbd5e1;
}

.c3d-task-status {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-initializing {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.status-passing {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.status-standby {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.status-balanced {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
}

.c3d-task-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.c3d-task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #c084fc);
  transition: width 0.4s ease;
}

/* Logs Console Viewport */
.c3d-logs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  min-height: 0; /* allows flex box scrolling */
}

.c3d-logs-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.c3d-logs-viewport {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  line-height: 1.4;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c3d-log-line {
  color: #a7f3d0;
  word-break: break-all;
}

.c3d-log-time {
  color: #64748b;
}

/* Compact layout mode (for embedding) */
.c3d-compact .c3d-settings-panel,
.c3d-compact .c3d-workflow-panel {
  display: none;
}
.decomposition-manifold-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: radial-gradient(circle at top right, #0f172a 0%, #020617 100%);
  color: #f8fafc;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  padding: 24px;
  gap: 24px;
}

/* ── Header ── */
.manifold-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
  padding-bottom: 20px;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.title-icon {
  width: 48px;
  height: 48px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.header-title h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: #fff;
}

.subtitle {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.system-status {
  display: flex;
  gap: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 8px;
}

.status-item .label {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 700;
}

.status-item .value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Main Grid ── */
.manifold-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: 1fr 200px;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.glass {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── 3D Viewport ── */
.wireframe-viewer {
  grid-row: span 1;
  position: relative;
  overflow: hidden;
}

.viewport-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.viewport-header h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.control-btn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.control-btn.active {
  background: #10b981;
  color: #020617;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.wireframe-canvas {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

.three-canvas-container {
  width: 100%;
  height: 100%;
}

.viewport-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(16, 185, 129, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Inventory Panel ── */
.inventory-panel {
  grid-column: 2;
  grid-row: span 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.parts-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parts-list::-webkit-scrollbar { width: 4px; }
.parts-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

.part-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.part-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateX(4px);
}

.part-card.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}

.part-name {
  font-size: 0.85rem;
  color: #f8fafc;
  font-weight: 600;
  display: block;
}

.part-id {
  font-size: 0.65rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.part-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.status-assembled { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-isolated { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-stripped { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.status-repair { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-replace { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.fastener-details {
  padding: 24px;
  background: rgba(2, 6, 23, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fastener-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fastener-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.fastener-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.fastener-card.removing {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
  animation: pulse 2s infinite ease-in-out;
}

.fastener-card.removed {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}

.f-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.f-type {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.f-specs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.spec-tag {
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
}

.f-material {
  font-size: 0.6rem;
  color: #64748b;
  font-style: italic;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-btn {
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.action-btn.isolate { background: #1e3a8a; color: #60a5fa; }
.action-btn.strip { background: #4c1d95; color: #a78bfa; }
.action-btn.repair { background: #78350f; color: #fbbf24; }
.action-btn.replace { background: #7f1d1d; color: #f87171; }

.action-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* ── Terminal ── */
.decomposition-terminal {
  grid-column: 1;
  grid-row: 2;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.terminal-header {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.1em;
}

.terminal-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.terminal-line {
  line-height: 1.5;
  white-space: pre-wrap;
}

.terminal-line.input { color: #10b981; }
.terminal-line.output { color: #94a3b8; }
.terminal-line.error { color: #ef4444; }
.terminal-line.system { color: #3b82f6; font-style: italic; }

.terminal-input-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-prompt {
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  margin-right: 8px;
  font-weight: 700;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

@keyframes pulse {
  0% { opacity: 1; box-shadow: 0 0 0px rgba(245, 158, 11, 0); }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
  100% { opacity: 1; box-shadow: 0 0 0px rgba(245, 158, 11, 0); }
}

