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

/* A11y: visible focus ring for keyboard navigation. Hover state untouched. */
:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: 2px;
}

/* Light theme — CSS filter-based (pragmatic until full CSS-variable migration).
   Inverts dark → light while preserving image content (filter: none on media). */
body.light-mode {
  filter: invert(0.92) hue-rotate(180deg);
}
body.light-mode img,
body.light-mode video,
body.light-mode .no-invert,
body.light-mode [style*="url("] {
  filter: invert(1) hue-rotate(180deg);
}

body {
  background-color: #0a0a0f;
  background-image: url('assets/bg/starfield.png');
  background-repeat: repeat;
  background-size: 128px 128px;
  image-rendering: pixelated;
  color: #c0c0c0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2, h3, label, button, .pixel {
  font-family: 'Press Start 2P', monospace;
}

/* THEMED SCROLLBARS — cyan accent matches buttons / ENTER THE OFFICE */
html {
  scrollbar-color: #00ffff #0a0a0f;
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
}
::-webkit-scrollbar-thumb {
  background: #00ffff;
  border: 2px solid #0a0a0f;
  box-shadow: 0 0 8px rgba(0,255,255,0.4);
}
::-webkit-scrollbar-thumb:hover {
  background: #40ffff;
  box-shadow: 0 0 12px rgba(0,255,255,0.7);
}
::-webkit-scrollbar-corner {
  background: #0a0a0f;
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  max-width: 700px;
  padding: 24px 32px 0;
  margin-top: 20px;
}
.progress-track {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.progress-seg {
  flex: 1;
  height: 6px;
  background: #1a1a2e;
  transition: background 0.3s;
}
.progress-seg.active {
  background: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.3);
}
.progress-seg.done {
  background: #00ff41;
}
.progress-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  text-align: right;
}

/* STEP CONTAINER */
.step-container {
  width: 100%;
  max-width: 700px;
  padding: 32px;
  flex: 1;
}
.step { display: none; }
.step.active { display: block; }

.step-title {
  font-size: 20px;
  color: #00ffff;
  text-shadow: 0 0 12px rgba(0,255,255,0.4);
  margin-bottom: 8px;
}
.step-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  margin-bottom: 32px;
}
.step-content {
  margin-bottom: 32px;
  line-height: 1.8;
}
.step-content p {
  margin-bottom: 12px;
}

/* NAVIGATION */
.nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 32px;
}
.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.15s;
  text-shadow: 0 0 6px rgba(0,255,255,0.3);
  white-space: nowrap;
}
.btn:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}
.btn:active { background: rgba(0,255,255,0.15); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-back {
  color: #555;
  border-color: #333;
  text-shadow: none;
}
.btn-back:hover {
  color: #888;
  border-color: #555;
  background: rgba(255,255,255,0.03);
  box-shadow: none;
}
.btn-outline {
  color: #555;
  border-color: #333;
  text-shadow: none;
}
.btn-outline:hover {
  color: #888;
  border-color: #555;
  background: rgba(255,255,255,0.03);
  box-shadow: none;
}
.nav-right { margin-left: auto; }

/* CHARACTER GRID */
.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.char-card {
  border: 2px solid #1a1a2e;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #0f0f1a;
}
.char-card:hover { border-color: #333; }
.char-card.selected {
  border-color: #00ffff;
  box-shadow: 0 0 16px rgba(0,255,255,0.2), inset 0 0 20px rgba(0,255,255,0.05);
}
.char-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

/* PREMADE PIXEL-CHARACTER GRID (step 2) */
.premade-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}
.premade-card {
  border: 2px solid #1a1a2e;
  background-color: #0f0f1a;
  cursor: pointer;
  aspect-ratio: 1 / 1.4;
  background-repeat: no-repeat;
  background-position: center 60%;
  background-size: auto 80%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: all 0.15s;
}
.premade-card:hover { border-color: #333; }
.premade-card.selected {
  border-color: #00ffff;
  box-shadow: 0 0 16px rgba(0,255,255,0.2), inset 0 0 20px rgba(0,255,255,0.05);
}
.char-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #e0e0e0;
  margin-bottom: 8px;
}
.char-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
}

/* INPUTS */
.input-large {
  width: 100%;
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  padding: 16px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}
.input-large:focus {
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.15);
}
.input-large::placeholder { color: #333; }

.input-wrap {
  position: relative;
  width: 100%;
}
.input-normal {
  width: 100%;
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 14px 48px 14px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input-normal:focus {
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.15);
}
.input-normal::placeholder { color: #333; }
.btn-eye {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  width: 44px;
  background: transparent;
  border: none;
  color: #555;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-eye:hover { color: #888; }

textarea.input-mission {
  width: 100%;
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
textarea.input-mission:focus {
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.15);
}
textarea.input-mission::placeholder { color: #333; }

.input-hint {
  font-size: 11px;
  color: #444;
  margin-top: 8px;
  text-align: center;
}
.input-error {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ff0040;
  margin-top: 8px;
  display: none;
}
.input-error.show { display: block; }

/* MODEL CARDS */
.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.model-card {
  border: 2px solid #1a1a2e;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #0f0f1a;
  position: relative;
}
.model-card:hover { border-color: #333; }
.model-card.selected {
  border-color: #00ffff;
  box-shadow: 0 0 16px rgba(0,255,255,0.2), inset 0 0 20px rgba(0,255,255,0.05);
}
.model-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}
.model-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #e0e0e0;
  margin-bottom: 6px;
}
.model-desc {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}
.model-id {
  font-size: 10px;
  color: #444;
  margin-bottom: 8px;
  word-break: break-all;
}
.model-best {
  font-size: 10px;
  color: #555;
  font-style: italic;
}
.badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #00ff41;
  border: 1px solid #00ff41;
  padding: 3px 6px;
  display: inline-block;
  margin-top: 8px;
}

/* STEP 0 — CHOOSE YOUR PATH */
/* WELCOME + WORLD SCREENS */
.welcome-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}
.welcome-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0,255,255,0.5);
  margin-bottom: 8px;
}
.welcome-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  margin-bottom: 40px;
}
.welcome-input-group {
  width: 100%;
  max-width: 400px;
  text-align: left;
  margin-bottom: 20px;
}
.welcome-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #888;
  display: block;
  margin-bottom: 8px;
}
.welcome-input {
  width: 100%;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  color: #e0e0e0;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.welcome-input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.15);
}
.welcome-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 14px 32px;
  cursor: pointer;
  transition: all 0.15s;
  text-shadow: 0 0 6px rgba(0,255,255,0.3);
  width: 100%;
  max-width: 400px;
  margin-top: 16px;
}
.welcome-btn:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}
.welcome-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.world-card {
  border: 2px solid #00ffff;
  background: #0f0f1a;
  padding: 28px 24px;
  width: 260px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.world-card:hover {
  background: #131325;
  box-shadow: 0 0 20px rgba(0,255,255,0.12);
}
.world-card.selected {
  background: #0a1a2a;
  box-shadow: 0 0 24px rgba(0,255,255,0.2);
}
.world-card.locked {
  border-color: #333;
  opacity: 0.4;
  cursor: default;
}
.world-card.locked:hover {
  background: #0f0f1a;
  box-shadow: none;
}
.world-card-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}
.world-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #e0e0e0;
  margin-bottom: 8px;
}
.world-card-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  margin-bottom: 12px;
}
.world-card-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ff41;
}
.world-card-tag.locked-tag {
  color: #555;
}

.step0-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}
.step0-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #00ffff;
  text-shadow: 0 0 16px rgba(0,255,255,0.5);
  margin-bottom: 12px;
}
.step0-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  margin-bottom: 48px;
}
.path-cards {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.path-card {
  border: 2px solid #00ffff;
  background: #0f0f1a;
  padding: 32px 28px 28px;
  width: 280px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.path-card:hover {
  background: #131325;
  box-shadow: 0 0 20px rgba(0,255,255,0.12);
}
.path-card.purple-border {
  border-color: #8b5cf6;
}
.path-card.purple-border:hover {
  box-shadow: 0 0 20px rgba(139,92,246,0.15);
}
.path-card-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 16px;
}
.path-card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: #e0e0e0;
  margin-bottom: 16px;
}
.path-card-desc {
  font-size: 13px;
  color: #777;
  line-height: 1.8;
  margin-bottom: 20px;
  flex-grow: 1;
}
.path-card-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ff41;
  margin-bottom: 14px;
}
.path-card-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ffff;
  background: transparent;
  border: 2px solid #00ffff;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}
.path-card-btn:hover {
  background: rgba(0,255,255,0.08);
}
.path-card.purple-border .path-card-btn {
  color: #8b5cf6;
  border-color: #8b5cf6;
}
.path-card.purple-border .path-card-btn:hover {
  background: rgba(139,92,246,0.08);
}
.recommended-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #0a0a0f;
  background: #00ffff;
  padding: 4px 8px;
}
.step0-hint {
  font-size: 12px;
  color: #444;
  margin-top: 32px;
}

/* PREFAB SELECTION */
.prefab-wrap {
  min-height: 70vh;
}
.prefab-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #888;
  margin-bottom: 16px;
  margin-top: 32px;
  border-bottom: 1px solid #1a1a2e;
  padding-bottom: 8px;
}
.prefab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.prefab-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.prefab-card {
  border: 2px solid #1a1a2e;
  background: #0f0f1a;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.prefab-card:hover {
  border-color: #00ffff;
  background: #131325;
}
.prefab-card-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}
.prefab-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #e0e0e0;
  margin-bottom: 8px;
}
.prefab-card-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  flex-grow: 1;
}
.prefab-card-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ff41;
  border: 1px solid #00ff41;
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 10px;
  align-self: center;
}
.prefab-card-select {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
  background: transparent;
  border: 2px solid #00ffff;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.prefab-card-select:hover {
  background: rgba(0,255,255,0.08);
}
.prefab-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #333;
}
.prefab-card.locked:hover {
  border-color: #333;
  background: #0f0f1a;
}
.prefab-card.locked .prefab-card-tag {
  color: #666;
  border-color: #444;
}
.prefab-card.locked .prefab-card-select {
  display: none;
}
.prefab-back {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #555;
  cursor: pointer;
  margin-top: 32px;
  display: inline-block;
  transition: color 0.15s;
}
.prefab-back:hover {
  color: #888;
}
.prefab-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid #333;
  color: #888;
  font-size: 10px;
  padding: 6px 10px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.prefab-card.locked:hover .prefab-tooltip {
  display: block;
}
.prefab-card.locked {
  position: relative;
}

/* DATA SOURCE HUB */
.ds-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.ds-hub-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.ds-card {
  border: 2px solid #00ffff;
  background: #0f0f1a;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.ds-card:hover {
  background: #131325;
  box-shadow: 0 0 14px rgba(0,255,255,0.1);
}
.ds-card.connected {
  border-color: #00ff41;
}
.ds-card.connected:hover {
  box-shadow: 0 0 14px rgba(0,255,65,0.1);
}
.ds-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #333;
}
.ds-card.locked:hover {
  background: #0f0f1a;
  box-shadow: none;
}
.ds-card-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}
.ds-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #e0e0e0;
  margin-bottom: 6px;
}
.ds-card-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
}
.ds-card-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 8px;
}
.ds-badge-free {
  color: #00ff41;
  border: 1px solid #00ff41;
}
.ds-badge-premium {
  color: #666;
  border: 1px solid #444;
}
.ds-card-action {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
  background: transparent;
  border: 2px solid #00ffff;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.ds-card-action:hover {
  background: rgba(0,255,255,0.08);
}
.ds-card.connected .ds-card-action {
  color: #00ff41;
  border-color: #00ff41;
  cursor: default;
}
.ds-card.locked .ds-card-action {
  display: none;
}
.ds-card-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid #333;
  color: #888;
  font-size: 10px;
  padding: 6px 10px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.ds-card.locked:hover .ds-card-tooltip {
  display: block;
}
.ds-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #888;
  margin-bottom: 12px;
  margin-top: 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1a1a2e;
}
.ds-section-label:first-of-type {
  margin-top: 0;
}
/* Integration wizard within modal */
.ds-wizard { display: none; }
.ds-wizard.active { display: block; }
.ds-wizard-back {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-block;
  transition: color 0.15s;
}
.ds-wizard-back:hover { color: #888; }
.ds-team-card {
  border: 2px solid #1a1a2e;
  background: #0f0f1a;
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
}
.ds-team-card:hover { border-color: #555; }
.ds-team-card.selected {
  border-color: #00ffff;
  box-shadow: 0 0 10px rgba(0,255,255,0.15);
}
.ds-team-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #e0e0e0;
}
.ds-team-meta {
  font-size: 11px;
  color: #555;
}
.ds-loading {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffaa00;
  text-align: center;
  padding: 20px 0;
  animation: pulse 1s ease-in-out infinite;
}
.ds-verify-success {
  border: 2px solid #00ff41;
  background: #0a1a0f;
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.ds-verify-success .dvs-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ff41;
  margin-bottom: 10px;
}
.ds-verify-success .dvs-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}
.ds-verify-error {
  border: 2px solid #ff0040;
  background: #1a0a0f;
  padding: 20px;
  text-align: center;
  margin: 16px 0;
  display: none;
}
.ds-verify-error.show { display: block; }
.ds-verify-error .dve-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #ff0040;
  margin-bottom: 10px;
}
.ds-verify-error .dve-msg {
  font-size: 12px;
  color: #cc6677;
  line-height: 1.7;
}

/* CHANNEL SETUP */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.channel-row-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #888;
  margin-bottom: 12px;
  margin-top: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1a1a2e;
}
.channel-row-label:first-of-type {
  margin-top: 0;
}
.channel-card {
  border: 2px solid #00ffff;
  background: #0f0f1a;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.channel-card:hover {
  background: #131325;
  box-shadow: 0 0 14px rgba(0,255,255,0.1);
}
.channel-card.yellow-border {
  border-color: #eab308;
}
.channel-card.yellow-border:hover {
  box-shadow: 0 0 14px rgba(234,179,8,0.1);
}
.channel-card.gray-border {
  border-color: #444;
  opacity: 0.7;
}
.channel-card.gray-border:hover {
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
}
.channel-card.green-active {
  border-color: #00ff41;
  background: rgba(0,255,65,0.05);
  cursor: default;
}
.channel-card.green-active:hover {
  background: rgba(0,255,65,0.05);
  box-shadow: 0 0 14px rgba(0,255,65,0.1);
}
.channel-card.green-active .channel-card-select {
  display: none;
}
.channel-card.no-click {
  border-color: #333;
  opacity: 0.4;
  cursor: default;
}
.channel-card.no-click:hover {
  background: #0f0f1a;
  box-shadow: none;
}
.channel-card-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}
.channel-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #e0e0e0;
  margin-bottom: 8px;
}
.channel-card-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  min-height: 50px;
}
.channel-card-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 10px;
}
.channel-badge-green {
  color: #00ff41;
  border: 1px solid #00ff41;
}
.channel-badge-yellow {
  color: #eab308;
  border: 1px solid #eab308;
}
.channel-badge-gray {
  color: #888;
  border: 1px solid #555;
}
.channel-card-select {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
  background: transparent;
  border: 2px solid #00ffff;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.channel-card-select:hover {
  background: rgba(0,255,255,0.08);
}
.channel-card.yellow-border .channel-card-select {
  color: #eab308;
  border-color: #eab308;
}
.channel-card.yellow-border .channel-card-select:hover {
  background: rgba(234,179,8,0.08);
}
.channel-card.gray-border .channel-card-select {
  color: #888;
  border-color: #555;
}
.channel-card.gray-border .channel-card-select:hover {
  background: rgba(255,255,255,0.03);
}
.channel-skip {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  cursor: pointer;
  margin-top: 24px;
  display: inline-block;
  transition: color 0.15s;
}
.channel-skip:hover {
  color: #888;
}
.channel-config {
  display: none;
}
.channel-config.active {
  display: block;
}
.channel-back {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #555;
  cursor: pointer;
  margin-bottom: 20px;
  display: inline-block;
  transition: color 0.15s;
}
.channel-back:hover {
  color: #888;
}
.channel-success-card {
  border: 2px solid #00ff41;
  background: #0a1a0f;
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}
.channel-success-card .cs-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ff41;
  margin-bottom: 14px;
}
.channel-success-card .cs-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}
.channel-info-card {
  border: 2px solid #eab308;
  background: #1a1508;
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}
.channel-info-card .ci-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #eab308;
  margin-bottom: 14px;
}
.channel-info-card .ci-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.8;
}
.channel-connect-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #00ffff;
  background: transparent;
  border: 2px solid #00ffff;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
  margin-top: 20px;
}
.channel-connect-btn:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}
.channel-connect-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.channel-connect-btn:disabled:hover {
  background: transparent;
  box-shadow: none;
}
.channel-input-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #888;
  display: block;
  margin-bottom: 6px;
  margin-top: 20px;
}
.channel-connecting {
  text-align: center;
  padding: 20px 0;
  display: none;
}
.channel-connecting.show {
  display: block;
}
.channel-connecting-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #ffaa00;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* Channel badge in topbar */
.channel-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.channel-badge.connected {
  color: #00ff41;
  border: 1px solid #00ff41;
  background: rgba(0,255,65,0.05);
}
.channel-badge.none {
  color: #888;
  border: 1px solid #444;
  background: transparent;
  cursor: pointer;
}
.channel-badge.none:hover {
  border-color: #888;
}

/* WELCOME */
.welcome-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 28px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0,255,255,0.5), 0 4px 0 #0a6e6e;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.6;
}
.welcome-text {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  line-height: 2;
  color: #888;
}
.welcome-text em {
  color: #00ffff;
  font-style: normal;
}

/* CREATING STEP */
.creating-center {
  text-align: center;
  padding: 20px 0;
}
.creating-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 20px;
}
.creating-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #00ffff;
  margin-bottom: 8px;
}
.creating-model {
  font-size: 12px;
  color: #555;
  margin-bottom: 28px;
}
.creating-log {
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
  line-height: 2.2;
}
.creating-log .log-line {
  color: #333;
  transition: color 0.3s;
}
.creating-log .log-line.active { color: #ffaa00; }
.creating-log .log-line.done { color: #00ff41; }

/* SUCCESS */
.success-center {
  text-align: center;
  padding: 20px 0;
}
.success-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 20px;
}
.success-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #00ffff;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(0,255,255,0.4);
}
.success-model {
  font-size: 12px;
  color: #555;
  margin-bottom: 24px;
}
.success-msg {
  color: #00ff41;
  font-size: 13px;
  line-height: 1.8;
}

/* ERROR BOX */
.error-box {
  border: 2px solid #ff0040;
  padding: 16px;
  color: #ff0040;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1.8;
  margin-top: 20px;
  display: none;
}
.error-box.show { display: block; }

/* LINK */
a { color: #00ffff; text-decoration: none; }
a:hover { text-decoration: underline; }

.security-note {
  font-size: 10px;
  color: #333;
  margin-top: 12px;
  line-height: 1.6;
}

/* COLOR SWATCH GRID */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 320px;
}
.swatch {
  width: 80px;
  height: 80px;
  border: 2px solid #1a1a2e;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swatch:hover { border-color: #555; }
.swatch.selected {
  border-color: #00ffff;
  box-shadow: 0 0 16px rgba(0,255,255,0.3);
}
.swatch.selected::after {
  content: '✓';
  font-size: 24px;
  color: #00ffff;
  text-shadow: 0 0 6px rgba(0,255,255,0.5), 0 1px 3px rgba(0,0,0,0.8);
}
.swatch-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #555;
  text-align: center;
  margin-top: 4px;
}
.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* OFFICE GRID */
.office-grid-wrap {
  overflow: auto;
  border: 2px solid #1a1a2e;
  max-width: 100%;
  margin: 0 auto;
}
/* Preview step: frame hugs the rendered room and stays centered under the name at any zoom */
#stepPreview .step-content {
  text-align: center;
}
#previewGridWrap {
  width: max-content;
  max-width: none;
  overflow: visible;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0;
  margin-right: 0;
}
.office-grid {
  display: grid;
  gap: 0;
}
.office-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  user-select: none;
  position: relative;
}
.office-agent-tile {
  animation: agentPulse 2s ease-in-out infinite;
}
.furniture-sprite {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
  pointer-events: none;
}
.office-bg {
  background-image: url('assets/furniture/office_bg_1_upper.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
@keyframes agentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.office-name-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #00ffff;
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(0,255,255,0.3);
}

/* ZOOM CONTROLS */
.zoom-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  align-items: center;
}
.zoom-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #1a1a2e;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.zoom-btn:hover {
  border-color: #00ffff;
  background: rgba(0,255,255,0.05);
}
.zoom-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  min-width: 40px;
  text-align: center;
}

/* ========== MAIN OFFICE SCREEN ========== */
.office-screen {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
}
.office-screen.show {
  display: flex;
}

/* TOP BAR */
.office-topbar {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 2px solid #1a1a2e;
  gap: 16px;
  flex-shrink: 0;
}
.office-topbar-back {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  cursor: pointer;
  text-decoration: none;
}
.office-topbar-back:hover { color: #888; text-decoration: none; }
.office-topbar-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #00ffff;
}
.office-topbar-model {
  font-size: 11px;
  color: #555;
}
.office-topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ff41;
}
.status-dot {
  width: 8px;
  height: 8px;
  background: #00ff41;
  box-shadow: 0 0 6px rgba(0,255,65,0.5);
}

/* ADD AGENT BTN in topbar */
.btn-add-agent {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  background: transparent;
  color: #00ff41;
  border: 2px solid #00ff41;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-add-agent:hover {
  background: rgba(0,255,65,0.08);
  box-shadow: 0 0 10px rgba(0,255,65,0.2);
}

/* OFFICE BODY */
.office-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.office-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

/* SIDEBAR */
.office-sidebar {
  width: 220px;
  border-left: 2px solid #1a1a2e;
  padding: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ffff;
  margin-bottom: 4px;
}
.sidebar-empty {
  font-size: 11px;
  color: #333;
  flex: 1;
}
.sidebar-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #1a1a2e;
  padding: 10px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.sidebar-btn:hover {
  border-color: #00ffff;
  background: rgba(0,255,255,0.05);
}
.btn-connect-source {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  background: #0a0a1a;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 12px 10px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  text-align: center;
  line-height: 1.6;
}
.btn-connect-source:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║ HUD overlay — top bar resources, left/right sidebars, bottom dock ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* TOP BAR */
.hud-topbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}
.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}
.hud-brand-logo {
  font-size: 24px;
  filter: drop-shadow(0 0 6px rgba(255,160,40,0.5));
}
.hud-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hud-brand-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #ffa040;
  letter-spacing: 1px;
}
.hud-brand-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #555;
  letter-spacing: 0.5px;
}
.hud-resources {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
}
.hud-resource {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.6);
  min-width: 100px;
}
.hud-resource-icon {
  font-size: 16px;
}
.hud-resource-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hud-resource-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #888;
  letter-spacing: 0.5px;
}
.hud-resource-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
}
.hud-topright {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}
.hud-day {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.6);
}
.hud-day-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #888;
}
.hud-day-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffd93d;
}
.hud-day-clock {
  font-size: 12px;
  margin-left: 4px;
}

/* BODY — 3-column grid: left sidebar | scene | right sidebar */
.hud-body {
  display: grid !important;
  grid-template-columns: 240px 1fr 260px;
  gap: 0;
}
.hud-sidebar {
  border-left: 2px solid #1a1a2e;
  border-right: 2px solid #1a1a2e;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: rgba(10,10,20,0.4);
}
.hud-sidebar-left {
  border-left: none;
}
.hud-sidebar-right {
  border-right: none;
}
.hud-panel {
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.7);
  padding: 10px;
}
.hud-panel-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ffff;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1a1a2e;
}
.hud-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.hud-list-icon {
  font-size: 10px;
  color: #555;
  flex-shrink: 0;
  margin-top: 2px;
}
.hud-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.hud-list-label {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #cfd;
}
.hud-list-sub {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: #555;
}

/* RIGHT — minimap */
.hud-minimap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 36px);
  gap: 4px;
}
.hud-minimap-room,
.hud-minimap-hub {
  border: 1px solid var(--accent, #1a1a2e);
  background: rgba(10,10,26,0.6);
  color: var(--accent, #888);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.hud-minimap-room:hover,
.hud-minimap-hub:hover {
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 8px var(--accent);
}
.hud-minimap-hub {
  grid-column: 2;
  grid-row: 2;
  font-weight: bold;
}

/* RIGHT — bars */
.hud-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
}
.hud-bar-label {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #cfd;
}
.hud-bar-count {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ffff;
}
.hud-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #1a1a2e;
  overflow: hidden;
}
.hud-bar-fill {
  height: 100%;
  background: var(--accent, #00ffff);
  box-shadow: 0 0 6px var(--accent, #00ffff);
  transition: width 0.3s;
}

/* BOTTOM BAR */
.hud-bottombar {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 8px 16px !important;
  align-items: center;
}
.hud-bottombar-left,
.hud-bottombar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.6);
  color: #888;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-icon-btn:hover {
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.3);
}
.hud-dock {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.hud-dock-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.7);
  color: #00ffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.hud-dock-btn:hover {
  border-color: #00ffff;
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 10px rgba(0,255,255,0.2);
}
.hud-dock-icon {
  font-size: 12px;
}
.hud-dock-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff4040;
  color: #fff;
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
  line-height: 16px;
  text-align: center;
}
.hud-action-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #1a1a2e;
  background: rgba(10,10,26,0.7);
  cursor: pointer;
  transition: all 0.15s;
}
.hud-action-card:hover {
  border-color: #00ff41;
  box-shadow: 0 0 10px rgba(0,255,65,0.2);
}
.hud-action-card-avatar {
  width: 28px;
  height: 28px;
  border: 1px solid #00ff41;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(0,255,65,0.05);
}
.hud-action-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hud-action-card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #cfd;
}
.hud-action-card-sub {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: #555;
}
.hud-action-card-dot {
  width: 8px;
  height: 8px;
  background: #00ff41;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,255,65,0.5);
  margin-left: 4px;
}

/* BOTTOM BAR */
.office-bottombar {
  border-top: 2px solid #1a1a2e;
  padding: 8px 20px;
  font-size: 10px;
  color: #333;
  text-align: center;
  flex-shrink: 0;
}

/* ========== MODAL OVERLAY ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,26,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show {
  display: flex;
}
.modal-box {
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #00ffff;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(0,255,255,0.3);
}
.modal-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  margin-bottom: 24px;
}

/* MODAL BUTTONS */
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-gray {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  background: transparent;
  color: #555;
  border: 2px solid #333;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-gray:hover { color: #888; border-color: #555; }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* ========== MODAL CARD (used by HQ room modals + dialogs) ========== */
.modal {
  background: #0f0f1a;
  border: 2px solid #1a1a2e;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* ========== CLOSE BUTTON (X) — used in modal headers ========== */
.profile-close {
  width: 28px;
  height: 28px;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
.profile-close:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: 1px;
}

/* ── Per-modal accent overrides (orchestrator + modal-on-modal dialogs) ── */
#orchestratorModal .modal { border-color: #ffa040; }
#orchestratorModal .profile-close { border-color: #ffa040; color: #ffa040; }
#orchestratorModal .profile-close:hover { background: #ff6464; color: #0a0a0f; border-color: #ff6464; }

#dataDashboardModal .modal { border-color: #00c8ff; }
#dataDashboardModal .profile-close { border-color: #00c8ff; color: #00c8ff; }
#dataDashboardModal .profile-close:hover { background: #ff6464; color: #0a0a0f; border-color: #ff6464; }

#dcWizardModal .modal,
#dcLedgerDetailModal .modal { border-color: #00c8ff; }
#dcWizardModal .profile-close,
#dcLedgerDetailModal .profile-close { border-color: #00c8ff; color: #00c8ff; }
#dcWizardModal .profile-close:hover,
#dcLedgerDetailModal .profile-close:hover { background: #ff6464; color: #0a0a0f; border-color: #ff6464; }

#trSkillDetailModal .modal { border-color: #ffa03c; }
#trSkillDetailModal .profile-close { border-color: #ffa03c; color: #ffa03c; }
#trSkillDetailModal .profile-close:hover { background: #ff6464; color: #0a0a0f; border-color: #ff6464; }

#troomDisbandModal .modal { border-color: #ff6464; }

/* ========== NOTION WIZARD MODAL ========== */
.notion-modal .modal-box {
  max-width: 560px;
  background: #0d0d1a;
  border-color: #00ffff;
}

/* Notion progress dots */
.notion-progress {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.notion-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1a2e;
  transition: background 0.3s, box-shadow 0.3s;
}
.notion-dot.active {
  background: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.4);
}
.notion-dot.done {
  background: #00ff41;
}

/* Notion wizard steps */
.notion-step { display: none; }
.notion-step.active { display: block; }

.notion-step-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #00ffff;
  margin-bottom: 24px;
  text-shadow: 0 0 8px rgba(0,255,255,0.3);
}

/* Instruction cards */
@keyframes slideInCard {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.notion-card {
  background: #111122;
  border: 1px solid #1a1a2e;
  padding: 16px 18px;
  margin-bottom: 12px;
  line-height: 1.8;
  font-size: 13px;
  color: #c0c0c0;
  animation: slideInCard 0.3s ease forwards;
}
.notion-card:nth-child(2) { animation-delay: 0.4s; opacity: 0; }
.notion-card:nth-child(3) { animation-delay: 0.8s; opacity: 0; }

.notion-card .card-num {
  font-size: 1.1rem;
  margin-right: 6px;
}
.notion-card .card-bold {
  color: #e0e0e0;
  font-weight: bold;
}
.notion-card .card-mono {
  font-family: 'Courier New', monospace;
  color: #00ffff;
  font-size: 12px;
}
.notion-card .card-sub {
  color: #666;
  font-size: 11px;
  margin-top: 4px;
}
.notion-card-btn {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #00ffff;
  border: 1px solid #00ffff;
  padding: 6px 12px;
  margin-top: 8px;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.notion-card-btn:hover {
  background: rgba(0,255,255,0.08);
  text-decoration: none;
}

/* Pulsing arrow */
@keyframes pulseDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
.pulse-arrow {
  animation: pulseDown 1s ease-in-out infinite;
  color: #00ffff;
  display: inline-block;
}

/* Notion form label inside modal */
.notion-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #888;
  display: block;
  margin-bottom: 6px;
  margin-top: 20px;
}

/* Notion creation log */
.notion-log {
  text-align: left;
  max-width: 400px;
  margin: 16px auto;
  line-height: 2.4;
}
.notion-log .nlog-line {
  color: #333;
  transition: color 0.3s;
}
.notion-log .nlog-line.active { color: #ffaa00; }
.notion-log .nlog-line.done { color: #00ff41; }

/* Notion error card */
.notion-error-card {
  border: 2px solid #ff0040;
  background: #1a0a0f;
  padding: 20px;
  margin-top: 16px;
  display: none;
}
.notion-error-card.show { display: block; }
.notion-error-card .err-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #ff0040;
  margin-bottom: 10px;
}
.notion-error-card .err-msg {
  font-size: 12px;
  color: #cc6677;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* Notion success card */
.notion-success-card {
  border: 2px solid #00ff41;
  background: #0a1a0f;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}
.notion-success-card .succ-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ff41;
  margin-bottom: 14px;
}
.notion-success-card .succ-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* Info pills */
.notion-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.notion-pill {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
  border: 1px solid #1a1a2e;
  padding: 8px 12px;
  background: #111;
}
.notion-pill-arrow {
  color: #00ffff;
  font-size: 14px;
}

.btn-full {
  width: 100%;
  text-align: center;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f1f0f;
  border: 2px solid #00ff41;
  color: #00ff41;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 14px 20px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  line-height: 1.6;
  max-width: 350px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* NOTION TILE indicator */
.notion-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #00ff41;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,255,65,0.6);
}

/* ========== BUILDING MAP ========== */
.building-map {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
  background: #0a0a0f;
}
.building-map.show {
  display: flex;
}

.bm-topbar {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 2px solid #1a1a2e;
  flex-shrink: 0;
}
.bm-topbar-left {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0,255,255,0.3);
}
.bm-topbar-center {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #fff;
  flex: 1;
  text-align: center;
}
.bm-topbar-right {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  cursor: pointer;
  text-decoration: none;
}
.bm-topbar-right:hover { color: #888; }

.bm-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  padding: 40px;
  flex-direction: column;
}

.bm-cards-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.bm-card {
  width: 280px;
  min-height: 200px;
  background: #111;
  border: 2px solid #00ffff;
  padding: 24px;
  font-family: 'Press Start 2P', monospace;
  position: relative;
  display: flex;
  flex-direction: column;
}
.bm-card-emoji { font-size: 2rem; margin-bottom: 8px; }
.bm-card-name { font-size: 12px; color: #e0e0e0; margin-bottom: 10px; }
.bm-card-status {
  font-size: 8px;
  color: #00ff41;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.bm-card-status .status-dot { width: 6px; height: 6px; }
.bm-card-info { font-size: 8px; color: #555; margin-bottom: 4px; }
.bm-card-tag {
  font-size: 7px;
  color: #00ff41;
  border: 1px solid #00ff41;
  display: inline-block;
  padding: 3px 6px;
  margin-top: 8px;
}
.bm-card-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 10px;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.15s;
  text-align: center;
}
.bm-card-btn:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 8px rgba(0,255,255,0.2);
}

/* CORRIDOR SVG */
.bm-corridor {
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.bm-corridor svg { width: 180px; height: 40px; }
.bm-corridor-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #555;
  margin-top: 4px;
}
.bm-corridor-sub {
  font-size: 9px;
  color: #333;
  margin-top: 4px;
}

@keyframes dashFlow {
  to { stroke-dashoffset: -20; }
}
@keyframes dashFlowFast {
  to { stroke-dashoffset: -20; }
}

.bm-send-task-wrap {
  margin-top: 20px;
  width: 280px;
  align-self: flex-end;
}
.btn-send-task {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  text-align: center;
}
.btn-send-task:hover {
  background: rgba(0,255,255,0.08);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}

/* DELEGATE MODAL */
.delegate-modal .modal-box { max-width: 480px; }
.delegate-agent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 14px 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}
.delegate-agent-tile {
  padding: 10px 6px;
  border: 2px solid #1a1a2e;
  background: #0d0d1a;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Press Start 2P', monospace;
}
.delegate-agent-tile:hover { border-color: #444; }
.delegate-agent-tile.selected {
  border-color: #00ffff;
  background: #0e1a2a;
}
.delegate-agent-tile .da-emoji { font-size: 22px; line-height: 1; }
.delegate-agent-tile .da-name {
  font-size: 8px;
  color: #e0e0e0;
  word-break: break-word;
  line-height: 1.4;
}
.delegate-agent-badge {
  font-size: 7px;
  padding: 2px 6px;
  border: 1px solid;
}
.delegate-agent-badge.idle { color: #00ff88; border-color: #00ff88; }
.delegate-agent-badge.busy { color: #ff9933; border-color: #ff9933; }
.delegate-textarea {
  width: 100%;
  background: #0a0a14;
  border: 2px solid #1a1a2e;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 14px;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}
.delegate-textarea:focus {
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.15);
}
.delegate-textarea::placeholder { color: #333; }

/* PAN CONTAINER */
.pan-container {
  width: 100%;
  flex: 1;
  overflow: hidden;
  cursor: grab;
  position: relative;
}
.pan-container.panning { cursor: grabbing; }
.pan-container .building-layout {
  position: absolute;
  user-select: none;
  transform-origin: 0 0;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

/* ========== BUILDING LAYOUT ========== */
.building-layout {
  display: grid;
  grid-template-areas:
    "agents-top    corr-left  lobby  corr-right  data-top"
    "agents-bottom corr-left  lobby  corr-right  data-bottom"
    ".             .          corr-down .         ."
    ".             .          channels  .         .";
  gap: 12px 0;
  align-items: center;
  justify-items: center;
  padding: 24px;
}
.bl-agents-top { grid-area: agents-top; }
.bl-agents-bottom { grid-area: agents-bottom; }
.bl-corr-left { grid-area: corr-left; align-self: stretch; }
.bl-lobby { grid-area: lobby; }
.bl-corr-right { grid-area: corr-right; align-self: stretch; }
.bl-data-top { grid-area: data-top; }
.bl-data-bottom { grid-area: data-bottom; }
.bl-corr-down { grid-area: corr-down; }
.bl-channels { grid-area: channels; }
.bl-teams { grid-area: teams; }
.bl-agents-left { grid-area: agents-left; }
.bl-agents-right { grid-area: agents-right; }

/* Stacked layout — lobby in the middle column, single agents tile around it
   (orchestrator above, extras alternating into left/right side columns), data
   sources between orchestrator and lobby, teams + channels stacked below.
   Toggled via <body data-office-layout="stacked"> (set in app.js OFFICE_LAYOUT
   const). To revert to the original 5-column horizontal grid, flip the const
   to 'legacy' — these rules then no-op and the default .building-layout above
   takes over. */
[data-office-layout="stacked"] .building-layout {
  grid-template-areas:
    ".            data-top      ."
    ".            data-bottom   ."
    ".            agents-top    ."
    "agents-left  lobby         agents-right"
    "agents-left  teams         agents-right"
    "agents-left  channels      agents-right";
  grid-template-columns: auto auto auto;
  gap: 16px 16px;
  align-items: start;
}
[data-office-layout="stacked"] .building-layout .bl-corr-left,
[data-office-layout="stacked"] .building-layout .bl-corr-right,
[data-office-layout="stacked"] .building-layout .bl-corr-down,
[data-office-layout="stacked"] .building-layout .bl-agents-bottom {
  display: none;
}
[data-office-layout="stacked"] .building-layout .bl-agents-top,
[data-office-layout="stacked"] .building-layout .bl-data-top,
[data-office-layout="stacked"] .building-layout .bl-data-bottom,
[data-office-layout="stacked"] .building-layout .bl-teams,
[data-office-layout="stacked"] .building-layout .bl-channels {
  justify-self: center;
}
/* Side agent panels stack their rooms vertically and align to the inner edge
   so the orchestrator/lobby column reads as the visual centerline. */
[data-office-layout="stacked"] .building-layout .bl-agents-left,
[data-office-layout="stacked"] .building-layout .bl-agents-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
}
[data-office-layout="stacked"] .building-layout .bl-agents-left { align-items: flex-end; }
[data-office-layout="stacked"] .building-layout .bl-agents-right { align-items: flex-start; }

/* Data source placeholder */
.ds-placeholder {
  border: 2px dashed #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #333;
  min-width: 120px;
  min-height: 80px;
}
.ds-placeholder:hover {
  border-color: #00ffff;
  color: #00ffff;
}

/* Channel room */
.channel-room-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  text-align: center;
  margin-top: 4px;
}

/* Horizontal corridor */
.corridor-h {
  height: 48px;
  background: #0a0a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.corridor-h .corridor-dots {
  display: flex;
  flex-direction: row;
  gap: 24px;
}
.corridor-h .corridor-label {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  margin-top: 0;
  margin-left: 12px;
}

/* Corridor flow animations */
@keyframes flowRight {
  0% { opacity: 0.3; transform: translateX(-4px) scale(0.7); }
  50% { opacity: 1; transform: translateX(4px) scale(1.2); }
  100% { opacity: 0.3; transform: translateX(-4px) scale(0.7); }
}
@keyframes flowDown {
  0% { opacity: 0.3; transform: translateY(-4px) scale(0.7); }
  50% { opacity: 1; transform: translateY(4px) scale(1.2); }
  100% { opacity: 0.3; transform: translateY(-4px) scale(0.7); }
}
.corr-flow-right .corridor-dot { animation: flowRight 1.5s ease-in-out infinite; }
.corr-flow-right .corridor-dot:nth-child(2) { animation-delay: 0.3s; }
.corr-flow-right .corridor-dot:nth-child(3) { animation-delay: 0.6s; }
.corr-flow-down .corridor-dot { animation: flowDown 1.5s ease-in-out infinite; }
.corr-flow-down .corridor-dot:nth-child(2) { animation-delay: 0.3s; }
.corr-flow-down .corridor-dot:nth-child(3) { animation-delay: 0.6s; }

/* ========== LEFT SLIDING NAVBAR ========== */
.agents-navbar {
  position: fixed;
  left: -220px;
  top: 0;
  width: 220px;
  height: 100vh;
  transition: left 0.3s ease;
  background: #0a0a1a;
  border-right: 2px solid #00ffff;
  z-index: 999;
  overflow-y: auto;
  padding: 60px 14px 20px;
}
.agents-navbar.open { left: 0; }

.navbar-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: #0a0a1a;
  border: 2px solid #00ffff;
  border-left: none;
  color: #00ffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 12px 6px;
  cursor: pointer;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  transition: left 0.3s ease;
  letter-spacing: 2px;
}
.navbar-toggle.open {
  left: 220px;
  writing-mode: horizontal-tb;
  padding: 10px 8px;
  letter-spacing: 0;
}
.navbar-toggle:hover {
  background: #111130;
}

.navbar-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00ffff;
  margin-bottom: 10px;
  margin-top: 4px;
}
.navbar-section-label.white {
  color: #888;
}
.navbar-divider {
  border: none;
  border-top: 1px solid #1a1a2e;
  margin: 12px 0;
}
.navbar-agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 2px;
  margin-bottom: 2px;
}
.navbar-agent-row:hover {
  background: #111130;
}
.navbar-agent-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.navbar-agent-info {
  flex: 1;
  min-width: 0;
}
.navbar-agent-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-agent-model {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff41;
  flex-shrink: 0;
}
.navbar-agent-dot.busy {
  background: #ffaa00;
  box-shadow: 0 0 6px #ffaa00;
  animation: agentBusyPulse 1s ease-in-out infinite;
}
@keyframes agentBusyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.navbar-ds-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.navbar-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #555;
  cursor: pointer;
  transition: color 0.15s;
}
.navbar-add-btn:hover { color: #00ffff; }
.navbar-empty-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #555;
  line-height: 1.6;
  padding: 6px 8px;
  font-style: normal;
  letter-spacing: 0.5px;
}
.navbar-settings-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #555;
  background: none;
  border: 1px solid #1a1a2e;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.navbar-settings-btn:hover {
  border-color: #333;
  color: #888;
}

/* Data sources 2x2 grid inside right column */
.ds-grid-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
  justify-items: center;
}

/* Channel row */
.channel-rooms-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
}

.room-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Agent room — shared wrapper for all agent rooms in building */
.agent-room {
  display: inline-block;
  background: #0a0a0f;
  border: 2px solid #00ffff;
}
.agent-room.orchestrator {
  border-width: 3px;
}
.agent-room-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}
.agent-room-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0,255,255,0.3);
}
.agent-room-model {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: #555;
  text-align: center;
  margin-bottom: 6px;
}

.sprite-walker {
  --walk-x: 0px;
  --walk-y: 0px;
  position: absolute;
  /* top/left are set per-room by applyBusyAnimations() — anchor at the IDLE_*
     tile (under the wooden chair). transform centers the sprite on that
     anchor; busy animations add walk deltas. */
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.6s ease-out;
}
.agent-character-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  /* width/height are set per-sprite by applyBusyAnimations() so the agent
     stays proportional to the office bg when tileSize changes (zoom). */
  background-size: 100% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px rgba(0,255,255,0.5));
  pointer-events: none;
}
.agent-room.orchestrator .agent-character-sprite {
  filter: drop-shadow(0 0 6px rgba(255,200,0,0.6));
}
/* Orchestrator room uses its own bg (central command — see build_orch_room.py)
   and a gold glow on the room frame to mark it as the leader's space. */
.agent-room.orchestrator .office-bg {
  background-image: url('assets/furniture/orch_room_bg.png');
}
.agent-room.orchestrator {
  box-shadow: 0 0 24px rgba(255, 170, 0, 0.5);
}
@keyframes agentBob {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-3px); }
}
/* Walk-cycle: when agent is busy, swap idle PNG for the 6-frame walk strip
   and step through it via background-position-x. Each character has its own
   _walk.png (96x32 native, 6 frames × 16px wide). Strip is sized to 6× sprite
   width via percent so the cycle keeps ratio across zoom levels. */
.agent-room.working-at-computer .agent-character-sprite,
.agent-room.working-pacing .agent-character-sprite {
  background-size: 600% 100%;
  animation: walkCycle 0.6s steps(6) infinite;
}
.agent-room.working-at-computer .agent-character-sprite[data-sprite="adam"],
.agent-room.working-pacing .agent-character-sprite[data-sprite="adam"] {
  background-image: url('assets/characters/adam_walk.png') !important;
}
.agent-room.working-at-computer .agent-character-sprite[data-sprite="alex"],
.agent-room.working-pacing .agent-character-sprite[data-sprite="alex"] {
  background-image: url('assets/characters/alex_walk.png') !important;
}
.agent-room.working-at-computer .agent-character-sprite[data-sprite="amelia"],
.agent-room.working-pacing .agent-character-sprite[data-sprite="amelia"] {
  background-image: url('assets/characters/amelia_walk.png') !important;
}
.agent-room.working-at-computer .agent-character-sprite[data-sprite="bob"],
.agent-room.working-pacing .agent-character-sprite[data-sprite="bob"] {
  background-image: url('assets/characters/bob_walk.png') !important;
}
@keyframes walkCycle {
  /* bg-size: 600% 100% stretches strip to 6× container. CSS bg-position-x
     percentages use position = X% * (container - image) / 100, so frame k
     lives at X = 20k%. steps(6, end) on `from 0% to 120%` lands cleanly on
     0, 20, 40, 60, 80, 100% — i.e. frames 0..5. */
  from { background-position-x: 0%; }
  to   { background-position-x: 120%; }
}
/* "I am working..." bubble — child of sprite-walker so it travels with the sprite */
.working-bubble {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d0d2a;
  border: 1px solid #ffaa00;
  color: #ffaa00;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  padding: 5px 8px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 11;
  text-shadow: 0 0 4px rgba(255,170,0,0.5);
}
.working-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #ffaa00;
}
.agent-room.working-at-computer .working-bubble,
.agent-room.working-pacing .working-bubble {
  opacity: 1;
  animation: workingBubblePulse 1.4s ease-in-out infinite;
}
@keyframes workingBubblePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Busy: walking to the computer tile (deltas provided via --walk-x / --walk-y) */
.agent-room.working-at-computer .sprite-walker {
  animation: walkToComputer 1.6s ease-out forwards;
}
@keyframes walkToComputer {
  0%   { transform: translate(-50%, -50%); }
  100% { transform: translate(calc(-50% + var(--walk-x)), calc(-50% + var(--walk-y))); }
}

/* Idle wander — driven by MAGMA.IdleBehaviour. Mutually exclusive with
 * .working-at-computer / .sitting (those classes take over the walker
 * via @keyframes walkToComputer). Uses `transition: transform` instead
 * of a keyframe so consecutive wander targets pick up smoothly from
 * the previous end-state instead of teleporting back to the anchor. */
.sprite-walker.walking-now {
  transition: transform var(--wander-duration, 1.6s) ease-out;
}
.sprite-walker.walking-now .agent-character-sprite[data-sprite^="premade_"],
.sprite-walker.walking-now .agent-character-sprite[data-sprite^="composed:"] {
  background-image: var(--sprite-walk) !important;
  background-size: 600% 100%;
  /* Slower than busy-mode (0.6s) — wander reads as a relaxed stroll
   * rather than the head-down rush to the computer. */
  animation: walkCycle 1s steps(6) infinite;
}

/* Idle interaction (etap C) — agent has reached an interactive prop
 * (coffee machine) and is cycling through the phone-down loop in
 * place. Same 6-frame walk-style animation timing; the only
 * difference is the source PNG which idle-behaviour swaps via
 * --sprite-walk before adding this class. */
.sprite-walker.interacting .agent-character-sprite[data-sprite^="composed:"] {
  background-image: var(--sprite-walk) !important;
  background-size: 600% 100%;
  animation: walkCycle 1.2s steps(6) infinite;
}

/* Coffee machine prop — bg sheet is 192×64 = 6 frames of 32×64,
 * cycled by stepping background-position-x. */
@keyframes coffeeCycle {
  from { background-position-x: 0; }
  to   { background-position-x: -600%; }
}
.coffee-prop {
  animation: coffeeCycle 1.5s steps(6) infinite;
}
/* Seated at desk — applied by app.js animationend handler once walkToComputer
   completes. Stops the walk-cycle bg cycling, swaps to the back-facing _sit
   sprite (single 16×32 frame, no strip), and keeps the walker pinned to the
   computer tile via the still-active forwards walkToComputer end-state. */
.agent-room.sitting .agent-character-sprite {
  animation: none !important;
  background-size: 100% 100% !important;
  background-position-x: 0 !important;
}
/* ?v=flip1 cache-buster — bumped whenever *_sit.png is re-extracted with a
   new pose, since the PNG path itself doesn't change but the bytes do. */
.agent-room.sitting .agent-character-sprite[data-sprite="adam"]   { background-image: url('assets/characters/adam_sit.png?v=flip1')   !important; }
.agent-room.sitting .agent-character-sprite[data-sprite="alex"]   { background-image: url('assets/characters/alex_sit.png?v=flip1')   !important; }
.agent-room.sitting .agent-character-sprite[data-sprite="amelia"] { background-image: url('assets/characters/amelia_sit.png?v=flip1') !important; }
.agent-room.sitting .agent-character-sprite[data-sprite="bob"]    { background-image: url('assets/characters/bob_sit.png?v=flip1')    !important; }
/* Premade pixel-art chars (Modern Interiors v3): per-sprite URLs would be 20×
   rules; instead the sprite element gets --sprite-walk / --sprite-sit set
   inline at construction time and CSS picks the var for the current state. */
.agent-room.working-at-computer .agent-character-sprite[data-sprite^="premade_"],
.agent-room.working-pacing       .agent-character-sprite[data-sprite^="premade_"],
.agent-room.working-at-computer .agent-character-sprite[data-sprite^="composed:"],
.agent-room.working-pacing       .agent-character-sprite[data-sprite^="composed:"] {
  background-image: var(--sprite-walk) !important;
}
.agent-room.sitting              .agent-character-sprite[data-sprite^="premade_"],
.agent-room.sitting              .agent-character-sprite[data-sprite^="composed:"] {
  background-image: var(--sprite-sit) !important;
}
/* Busy: pacing left-right (no computer in room) */
.agent-room.working-pacing .sprite-walker {
  animation: agentPace 3s ease-in-out infinite;
}
@keyframes agentPace {
  0%, 100% { transform: translate(calc(-50% - 35px), -50%); }
  50%      { transform: translate(calc(-50% + 35px), -50%); }
}
.agent-room::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  opacity: 0.3;
  pointer-events: none;
}
.agent-room::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  opacity: 0.25;
  pointer-events: none;
}

/* Building placeholder — dashed "+" tiles */
.building-placeholder {
  border: 2px dashed rgba(0,255,255,0.4);
  background: rgba(0,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: rgba(0,255,255,0.5);
}
.building-placeholder:hover {
  border-color: rgba(0,255,255,0.8);
  color: rgba(0,255,255,0.9);
}

/* Webchat draggable window */
.webchat-window {
  position: fixed;
  left: 100px;
  top: 80px;
  width: 640px;
  height: 480px;
  background: #0a0a1a;
  border: 2px solid #00ffff;
  box-shadow: 0 0 40px rgba(0,255,255,0.2);
  display: none;
  flex-direction: column;
  z-index: 2000;
  font-family: 'Press Start 2P', monospace;
  resize: both;
  overflow: hidden;
  min-width: 400px;
  min-height: 300px;
}
.webchat-window.open { display: flex; }
.webchat-window.minimized .webchat-body { display: none; }
.webchat-window.minimized { height: auto !important; }

.webchat-titlebar {
  background: #0d0d2a;
  border-bottom: 1px solid #1a1a3a;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  user-select: none;
  font-size: 9px;
  color: #00ffff;
  flex-shrink: 0;
}
.webchat-titlebar:active { cursor: grabbing; }
.webchat-titlebar-controls {
  display: flex;
  gap: 8px;
}
.webchat-titlebar-controls button {
  background: none;
  border: 1px solid #333;
  color: #888;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: 'Press Start 2P', monospace;
}
.webchat-titlebar-controls button:hover {
  border-color: #00ffff;
  color: #00ffff;
}

.webchat-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* LEFT — agent list */
.webchat-agents {
  width: 160px;
  flex-shrink: 0;
  border-right: 1px solid #1a1a3a;
  overflow-y: auto;
  background: #080814;
}
.webchat-agents-title {
  padding: 10px 12px;
  font-size: 7px;
  color: #444;
  border-bottom: 1px solid #1a1a3a;
  letter-spacing: 1px;
}
.webchat-agent-row {
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #0d0d1a;
  transition: background 0.15s;
}
.webchat-agent-row:hover { background: #111130; }
.webchat-agent-row.active {
  background: #0d1a2a;
  border-left: 3px solid #00ffff;
}
.webchat-agent-row .ag-emoji { font-size: 18px; }
.webchat-agent-row .ag-info { flex: 1; overflow: hidden; }
.webchat-agent-row .ag-name {
  font-size: 7px;
  color: #00ffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.webchat-agent-row .ag-status {
  font-size: 7px;
  color: #444;
  margin-top: 3px;
}
.webchat-agent-row .ag-dot {
  width: 6px;
  height: 6px;
  background: #00ff88;
  border-radius: 50%;
  flex-shrink: 0;
}

/* RIGHT — chat */
.webchat-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.webchat-chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid #1a1a3a;
  font-size: 8px;
  color: #fff;
  background: #0d0d1a;
  flex-shrink: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.webchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.webchat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  word-wrap: break-word;
}
.webchat-bubble.user {
  align-self: flex-end;
  background: #0d3333;
  border: 1px solid #00ffff;
  color: #fff;
}
.webchat-bubble.agent {
  align-self: flex-start;
  background: #1a1a2e;
  border-left: 3px solid #00ffff;
  color: #ddd;
}
.bubble-time {
  font-size: 9px;
  color: #333;
  margin-top: 4px;
}
.webchat-input-area {
  padding: 10px;
  border-top: 1px solid #1a1a3a;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.webchat-input-area textarea {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  resize: none;
}
.webchat-input-area textarea:focus {
  border-color: #00ffff;
  outline: none;
}
.webchat-input-area button {
  background: #00ffff;
  color: #000;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  white-space: nowrap;
}
.webchat-input-area button:hover { background: #00cccc; }

@keyframes typingDot {
  0%,60%,100% { opacity: 0.2 }
  30% { opacity: 1 }
}
.typing-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #00ffff;
  border-radius: 50%;
  margin: 0 2px;
  animation: typingDot 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.notion-room-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ff88;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(0,255,136,0.3);
}
.notion-room-sub {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: #555;
  text-align: center;
  margin-bottom: 10px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-corridor {
  width: 48px;
  background: #0a0a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  align-self: stretch;
  margin-top: 28px;
}
.corridor-dots {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.corridor-dot {
  width: 8px;
  height: 8px;
  background: #00ffff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,255,255,0.5);
  animation: corridorFlow 1.5s ease-in-out infinite;
}
.corridor-dot:nth-child(2) { animation-delay: 0.3s; }
.corridor-dot:nth-child(3) { animation-delay: 0.6s; }
@keyframes corridorFlow {
  0%, 100% { opacity: 0.3; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}
.corridor-dot.fast {
  animation-duration: 0.4s;
}
.corridor-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #333;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin-top: 12px;
  letter-spacing: 2px;
}

/* Notion room grid */
.notion-grid-wrap {
  overflow: auto;
  border: 2px solid #1a1a2e;
}
.notion-grid {
  display: grid;
  gap: 0;
}

/* WORKER WIZARD OVERLAY */
.worker-wizard-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0a0f;
  z-index: 900;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}
.worker-wizard-overlay.show { display: flex; }

.wizard-topnav {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(10,10,15,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #1a1a2e;
  z-index: 10;
  box-sizing: border-box;
}
.wizard-nav-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-transform: uppercase;
}
.wizard-nav-btn:hover {
  background: #00ffff;
  color: #000;
}
.wizard-nav-btn.hidden { visibility: hidden; }
.wizard-nav-close {
  color: #ff6b6b;
  border-color: #ff6b6b;
}
.wizard-nav-close:hover {
  background: #ff6b6b;
  color: #000;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #1a1a2e; }

@media (max-width: 600px) {
  .char-grid, .model-grid { grid-template-columns: 1fr 1fr; }
  .premade-grid { grid-template-columns: repeat(4, 1fr); }
  .welcome-logo { font-size: 18px; }
  .step-container { padding: 20px; }
  .swatch-grid { grid-template-columns: repeat(3, 1fr); }
  .model-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .bm-cards-row { flex-direction: column; }
  .bm-corridor { width: 40px; height: 100px; }
  .bm-corridor svg { width: 40px; height: 100px; }
}

/* ═══ AGENT PROFILE POPUP (draggable) ═══ */
.agent-popup {
  position: fixed;
  left: 120px;
  top: 100px;
  width: 360px;
  height: 520px;
  background: #0a0a1a;
  border: 2px solid #00ffff;
  box-shadow: 0 0 40px rgba(0,255,255,0.15);
  display: none;
  flex-direction: column;
  z-index: 2500;
  font-family: 'Press Start 2P', monospace;
  resize: both;
  overflow: hidden;
  min-width: 300px;
  min-height: 300px;
}
.agent-popup.open { display: flex; }

.agent-popup-titlebar {
  background: #0d0d2a;
  border-bottom: 1px solid #1a1a3a;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  user-select: none;
  font-size: 8px;
  color: #00ffff;
  flex-shrink: 0;
}
.agent-popup-titlebar:active { cursor: grabbing; }
.agent-popup-titlebar button {
  background: none;
  border: 1px solid #333;
  color: #888;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 10px;
}
.agent-popup-titlebar button:hover {
  border-color: #00ffff;
  color: #00ffff;
}
.agent-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Room choice popup */
.room-choice-popup {
  position: fixed;
  z-index: 3000;
  background: #0a0a1a;
  border: 2px solid #00ffff;
  box-shadow: 0 0 30px rgba(0,255,255,0.2);
  font-family: 'Press Start 2P', monospace;
  width: 400px;
}
.room-choice-header {
  padding: 10px 14px;
  border-bottom: 1px solid #1a1a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  color: #00ffff;
  background: #0d0d2a;
}
.room-choice-header button {
  background: none;
  border: 1px solid #333;
  color: #888;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 10px;
}
.room-choice-header button:hover { border-color:#00ffff; color:#00ffff; }
.room-choice-tiles {
  display: flex;
  gap: 0;
}
.room-choice-tile {
  flex: 1;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  border-right: 1px solid #1a1a3a;
  transition: background 0.15s;
}
.room-choice-tile:last-child { border-right: none; }
.room-choice-tile:hover { background: #111130; }
.room-choice-tile.room-choice-fire .tile-label { color: #ff6b6b; }
.room-choice-tile.room-choice-fire:hover { background: #2a0d0d; }
.room-choice-tile.room-choice-fire:hover .tile-label { color: #ff8c8c; }
.tile-emoji { font-size: 32px; margin-bottom: 10px; }
.tile-label { font-size: 8px; color: #00ffff; margin-bottom: 6px; }
.tile-sub { font-size: 7px; color: #444; line-height: 1.6; }

.profile-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 20px 20px;
  border-bottom: 1px solid #1a1a3a;
  background: #0d0d22;
}

.profile-character {
  font-size: 72px;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #111130;
  border: 2px solid #1a1a3a;
  position: relative;
}
.profile-character::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent, #00ffff, transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { opacity: 0.2 } 50% { opacity: 1 } 100% { opacity: 0.2 }
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-size: 11px;
  color: #00ffff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-role {
  font-size: 8px;
  color: #888;
  margin-bottom: 4px;
}
.profile-model {
  font-size: 7px;
  color: #444;
  margin-bottom: 12px;
  background: #111;
  padding: 3px 6px;
  display: inline-block;
}
.profile-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: #666;
  margin-bottom: 4px;
}
.profile-xp-bar {
  height: 8px;
  background: #111;
  border: 1px solid #1a1a3a;
  position: relative;
  margin-bottom: 6px;
}
.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #005533, #00ff88);
  transition: width 0.8s ease;
}
.profile-level {
  font-size: 8px;
  color: #00ff88;
  text-align: right;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid #1a1a3a;
  flex-shrink: 0;
}
.profile-tab {
  flex: 1;
  padding: 12px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #444;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.profile-tab:hover { color: #888; }
.profile-tab.active {
  color: #00ffff;
  border-bottom-color: #00ffff;
  background: #0d0d22;
}

.profile-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

/* Stats tab */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #111;
  font-size: 8px;
}
.stat-label { color: #555; }
.stat-value { color: #00ffff; }

.activity-graph { margin-top: 20px; }
.activity-title {
  font-size: 7px; color: #444; margin-bottom: 10px;
}
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  border-bottom: 1px solid #1a1a3a;
}
.activity-bar {
  flex: 1;
  background: linear-gradient(180deg, #00ffff, #004444);
  min-height: 4px;
}
.activity-days {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  font-size: 6px;
  color: #333;
}
.activity-days span { flex: 1; text-align: center; }

/* Tokens tab */
.token-section { margin-bottom: 20px; }
.token-title {
  font-size: 7px; color: #444; margin-bottom: 8px;
}
.token-big {
  font-size: 18px; color: #00ffff; margin-bottom: 4px;
}
.token-sub { font-size: 8px; color: #00ff88; }
.token-breakdown { margin-top: 16px; }
.token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 7px;
}
.token-row-label { color: #555; width: 50px; }
.token-bar-bg {
  flex: 1; height: 10px;
  background: #111; border: 1px solid #1a1a3a;
}
.token-bar-fill { height: 100%; background: #00ffff; }
.token-row-val { color: #888; width: 70px; text-align: right; }

/* Skills tab */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.skill-card {
  background: #0d0d22;
  border: 1px solid #1a1a3a;
  padding: 12px;
  position: relative;
  cursor: default;
  transition: border-color 0.2s;
}
.skill-card:hover { border-color: #333 !important; }
.skill-card.equipped { background: #0d1020; }
.add-skill-card {
  border: 1px dashed #333 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  cursor: pointer;
  opacity: 0.6;
}
.add-skill-card:hover { opacity: 1; border-color: #00ffff !important; }
.skill-card-emoji {
  font-size: 24px; margin-bottom: 6px;
}
.add-skill-card .skill-card-emoji {
  font-size: 28px; color: #00ffff;
}
.skill-card-name {
  font-size: 7px; color: #ccc; margin-bottom: 4px;
}
.skill-rarity {
  font-size: 6px; margin-bottom: 6px;
  letter-spacing: 1px;
}
.skill-desc {
  font-family: 'Courier New', monospace;
  font-size: 10px; color: #555; line-height: 1.4;
}
.skill-remove {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none;
  color: #333; font-size: 10px; cursor: pointer;
  padding: 2px 4px;
}
.skill-remove:hover { color: #ff4444; }

/* Skill modal */
.skill-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}
.skill-modal-overlay.open { display: flex; }

.skill-modal {
  background: #0a0a1a;
  border: 2px solid #00ffff;
  width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,255,255,0.2);
}
.skill-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a3a;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #00ffff;
  flex-shrink: 0;
}
.skill-modal-header button {
  background: none; border: 1px solid #333;
  color: #888; width: 24px; height: 24px; cursor: pointer;
}
.skill-modal-header button:hover {
  border-color: #00ffff; color: #00ffff;
}
.skill-search {
  margin: 12px 18px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  flex-shrink: 0;
}
.skill-search:focus { border-color: #00ffff; outline: none; }

.skill-categories {
  display: flex;
  gap: 6px;
  padding: 0 18px 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.skill-cat {
  background: #111;
  border: 1px solid #222;
  color: #555;
  padding: 5px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.skill-cat:hover { border-color: #444; color: #888; }
.skill-cat.active {
  border-color: #00ffff; color: #00ffff; background: #0d1a2a;
}

.skill-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
  overflow-y: auto;
  flex: 1;
}

.skill-modal-card {
  background: #0d0d22;
  border: 1px solid #1a1a3a;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.skill-modal-card:hover {
  border-color: #00ffff;
  background: #0d1a2a;
}
.skill-modal-card.already-equipped {
  opacity: 0.55;
  cursor: pointer;
}
.skill-modal-card.already-equipped:hover {
  opacity: 1;
  border-color: #ff4466;
  background: #1a0d12;
}
.skill-modal-card.already-equipped::after {
  content: '✓ EQUIPPED';
  position: absolute;
  top: 6px; right: 6px;
  font-size: 6px;
  color: #00ff88;
  font-family: 'Press Start 2P', monospace;
}
.skill-modal-card.already-equipped:hover::after {
  content: '✕ REMOVE';
  color: #ff4466;
}

/* Teams */
.team-placeholder {
  border-color: #ffd93d !important;
  color: #ffd93d !important;
}
.team-placeholder:hover {
  background: rgba(255,217,61,0.08) !important;
  box-shadow: 0 0 20px rgba(255,217,61,0.2);
}
.team-room {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s;
  font-family: 'Press Start 2P', monospace;
}
.team-room:hover {
  filter: brightness(1.15);
}
.agent-speech-bubble {
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d0d2a;
  border: 1px solid #00ffff;
  color: #00ffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  padding: 5px 8px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  max-width: 110px;
  white-space: normal;
  text-align: center;
  line-height: 1.6;
}
.agent-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #00ffff;
}
.agent-speech-bubble.visible {
  opacity: 1;
}

/* Lobby entrance door — pixel-art double door, hover swaps closed→open frame.
   Sprite is 64×96 (2 tile × 3 tile @32px display); div sizes are inline,
   so background-size:100% 100% lets it scale with zoom-aware tileSize. */
.lobby-entrance-door {
  background-image: url('assets/furniture/lobby_door_closed.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
  transition: filter 0.15s ease-out, transform 0.15s ease-out;
}
.lobby-entrance-door:hover {
  background-image: url('assets/furniture/lobby_door_open.png');
  filter: drop-shadow(0 0 6px rgba(255, 212, 80, 0.55));
}
.lobby-entrance-door:active {
  transform: scale(0.98);
}

/* Receptionist NPC — Amelia sit-front sprite. Subtle idle bob so she doesn't
   read as completely static; hover adds a soft cyan glow to suggest she's
   approachable (no click action yet — future hook for agent picker). */
.lobby-receptionist {
  animation: receptionist-idle 2.4s ease-in-out infinite;
  transition: filter 0.18s ease-out;
  cursor: help;
}
.lobby-receptionist:hover {
  filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.55));
}
@keyframes receptionist-idle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}

/* Lobby agent-door portals — invisible by default; on hover a soft cyan
   inset glow + scaled label show the passage is interactive. Clicking the
   portal scrolls the corresponding agent room into view (focusAgentFromLobby). */
.agent-door-portal {
  background: transparent;
  transition: background 0.18s ease-out, box-shadow 0.18s ease-out;
}
.agent-door-portal:hover {
  background: radial-gradient(ellipse at 50% 100%, rgba(0, 255, 255, 0.22) 0%, rgba(0, 255, 255, 0) 70%);
  box-shadow: inset 0 -6px 14px rgba(0, 255, 255, 0.35);
}
.agent-door-portal:hover + .agent-door-label {
  /* Each portal is immediately followed by its name label in the DOM,
     so the adjacent-sibling combinator (+) highlights only that one label. */
  color: #ffffff !important;
  text-shadow: 0 0 4px #00ffff, 0 0 6px #00ffff !important;
}
.agent-door-portal:active {
  background: rgba(0, 255, 255, 0.25);
}

/* ── Orchestrator panel tabs (sesja 2026-05-19, punkt 02 B.2) ──
   DASHBOARD | DIRECTORY tabs on top of orchestratorModal. Orange accent
   matches the orchestrator theme (#ffa040). */
.orch-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
}
.orch-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.orch-tab:hover {
  color: #ffa040;
}
.orch-tab.active {
  color: #ffa040;
  background: rgba(255, 160, 64, 0.08);
  border-color: #ffa040;
  border-bottom: 1px solid rgba(255, 160, 64, 0.08);
  margin-bottom: -1px;
}
.orch-tab-panel {
  animation: orchTabFadeIn 0.18s ease-out;
}
@keyframes orchTabFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Assistant Hub modal (purple #b45aff theme) ───────────────── */

/* Cap modal height so long content scrolls instead of overflowing
   the viewport. Tabs stay sticky at the top of the scroll area. */
#assistantHubModal .modal {
  max-height: 88vh;
  overflow-y: auto;
  border-color: #b45aff;
}
#assistantHubModal .profile-close {
  border-color: #b45aff;
  color: #b45aff;
}
#assistantHubModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#assistantHubModal .ah-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
  padding-bottom: 0;
}

.ah-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
}
.ah-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 16px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.ah-tab:hover { color: #b45aff; }
.ah-tab.active {
  color: #b45aff;
  background: rgba(180, 90, 255, 0.08);
  border-color: #b45aff;
  border-bottom: 1px solid rgba(180, 90, 255, 0.08);
  margin-bottom: -1px;
}
.ah-tab-panel { animation: ahTabFadeIn 0.18s ease-out; }
@keyframes ahTabFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Reusable bits for all 4 tabs */
.ah-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #b45aff;
  letter-spacing: 1px;
  margin: 4px 0 10px;
}
.ah-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.ah-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 12px;
  background: transparent;
  color: #b45aff;
  border: 1px solid #b45aff;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ah-btn:hover { background: rgba(180, 90, 255, 0.12); }
.ah-btn[disabled] {
  color: #444;
  border-color: #2a2a3a;
  cursor: not-allowed;
  background: transparent;
}
.ah-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
}
.ah-btn-ghost:hover { color: #b45aff; border-color: #b45aff; background: rgba(180, 90, 255, 0.06); }
.ah-pill {
  display: inline-block;
  padding: 2px 8px;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  border: 1px solid #1a1a2e;
  border-radius: 10px;
  color: #888;
}
.ah-pill-on  { color: #00ff41; border-color: #00ff41; }
.ah-pill-off { color: #555;    border-color: #2a2a3a; }
.ah-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #1a1a2e;
  background: rgba(180, 90, 255, 0.03);
  margin-bottom: 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.ah-row-main { flex: 1; min-width: 0; }
.ah-row-title { color: #cfd; margin-bottom: 2px; }
.ah-row-sub { color: #777; font-size: 10px; word-break: break-all; }
.ah-empty {
  text-align: center;
  padding: 18px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}
.ah-form {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 12px;
  padding: 14px;
  border: 1px solid #b45aff;
  background: rgba(180, 90, 255, 0.04);
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.ah-form label { color: #888; align-self: center; font-size: 10px; }
.ah-form input, .ah-form select, .ah-form textarea {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.ah-form input:focus, .ah-form select:focus, .ah-form textarea:focus {
  border-color: #b45aff;
  outline: none;
}
.ah-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.ah-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #1a1a2e;
  background: rgba(180, 90, 255, 0.03);
  margin-bottom: 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #888;
}
.ah-notice-icon { color: #b45aff; font-size: 14px; }
.ah-notice-text { flex: 1; }

.ah-tool-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(180, 90, 255, 0.03);
  border: 1px solid #1a1a2e;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ah-tool-suggestion:hover {
  background: rgba(180, 90, 255, 0.08);
  border-color: #b45aff;
}

/* ── Research Lab modal (cyan #00ffff theme) ──────────────────── */

#researchLabModal .modal {
  max-height: 90vh;
  overflow-y: auto;
  border-color: #00ffff;
}
#researchLabModal .profile-close {
  border-color: #00ffff;
  color: #00ffff;
}
#researchLabModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#researchLabModal .rl-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
}

.rl-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
}
.rl-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.rl-tab:hover { color: #00ffff; }
.rl-tab.active {
  color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
  border-color: #00ffff;
  border-bottom: 1px solid rgba(0, 255, 255, 0.08);
  margin-bottom: -1px;
}
.rl-tab-panel { animation: rlTabFadeIn 0.18s ease-out; }
@keyframes rlTabFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rl-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
  letter-spacing: 1px;
  margin: 4px 0 10px;
}
.rl-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.rl-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 12px;
  background: transparent;
  color: #00ffff;
  border: 1px solid #00ffff;
  cursor: pointer;
  transition: background 0.15s;
}
.rl-btn:hover { background: rgba(0, 255, 255, 0.12); }
.rl-btn[disabled] {
  color: #444;
  border-color: #2a2a3a;
  cursor: not-allowed;
  background: transparent;
}
.rl-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
}
.rl-btn-ghost:hover { color: #00ffff; border-color: #00ffff; background: rgba(0, 255, 255, 0.06); }

/* Search input + filter chips */
.rl-search {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  flex: 1;
  min-width: 180px;
}
.rl-search:focus { border-color: #00ffff; outline: none; }
.rl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rl-chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  padding: 6px 10px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.rl-chip:hover { color: #00ffff; border-color: #00ffff; }
.rl-chip.active {
  color: #00ffff;
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
}

/* Master-detail layout */
.rl-split {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.rl-list {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  max-height: 56vh;
  overflow-y: auto;
}
.rl-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a2e;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
  transition: background 0.12s;
}
.rl-list-item:last-child { border-bottom: none; }
.rl-list-item:hover { background: rgba(0, 255, 255, 0.04); }
.rl-list-item.active {
  background: rgba(0, 255, 255, 0.08);
  border-left: 2px solid #00ffff;
  padding-left: 10px;
}
.rl-list-title { color: #cfd; margin-bottom: 4px; font-size: 11px; line-height: 1.3; }
.rl-list-meta  { color: #666; font-size: 9px; }

.rl-detail {
  border: 1px solid #1a1a2e;
  background: rgba(0, 255, 255, 0.02);
  padding: 16px;
  max-height: 56vh;
  overflow-y: auto;
  min-height: 280px;
}
.rl-detail-empty {
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  text-align: center;
  padding: 60px 20px;
}
.rl-detail-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #00ffff;
  letter-spacing: 1px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.rl-detail-meta {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 10px;
  margin: 14px 0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
}
.rl-detail-meta dt { color: #666; }
.rl-detail-meta dd { color: #cfd; margin: 0; word-break: break-word; }
.rl-detail-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #1a1a2e;
}
.rl-detail-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.rl-detail-body {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.rl-log {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #888;
}
.rl-log li {
  padding: 3px 0 3px 14px;
  position: relative;
}
.rl-log li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: #00ffff;
}
.rl-log-ts { color: #555; margin-right: 8px; }

.rl-pill {
  display: inline-block;
  padding: 3px 9px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #1a1a2e;
  color: #888;
  margin-right: 4px;
}
.rl-pill-pending     { color: #ffd93d; border-color: #ffd93d; }
.rl-pill-in_progress { color: #00ffff; border-color: #00ffff; }
.rl-pill-completed   { color: #00ff41; border-color: #00ff41; }
.rl-pill-error       { color: #ff6464; border-color: #ff6464; }
.rl-pill-low      { color: #888; border-color: #2a2a3a; }
.rl-pill-normal   { color: #cfd; border-color: #2a2a3a; }
.rl-pill-high     { color: #ffd93d; border-color: #ffd93d; }
.rl-pill-critical { color: #ff6464; border-color: #ff6464; }

/* Form (delegate tab) */
.rl-form {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px 14px;
  padding: 18px;
  border: 1px solid #00ffff;
  background: rgba(0, 255, 255, 0.03);
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.rl-form label {
  color: #888;
  align-self: start;
  font-size: 10px;
  padding-top: 8px;
}
.rl-form input, .rl-form select, .rl-form textarea {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  width: 100%;
  box-sizing: border-box;
}
.rl-form textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.rl-form input:focus, .rl-form select:focus, .rl-form textarea:focus {
  border-color: #00ffff;
  outline: none;
}
.rl-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.rl-empty {
  text-align: center;
  padding: 36px 20px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}

/* Mobile / narrow viewport: stack list + detail */
@media (max-width: 720px) {
  .rl-split { grid-template-columns: 1fr; }
  .rl-list { max-height: 30vh; }
  .rl-detail { max-height: none; }
}

/* ── Operations Command Center modal (cyan #00ffff theme) ────── */

#operationsModal .modal {
  max-height: 92vh;
  overflow-y: auto;
  border-color: #00ffff;
}
#operationsModal .profile-close {
  border-color: #00ffff;
  color: #00ffff;
}
#operationsModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#operationsModal .op-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
}

.op-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
  flex-wrap: wrap;
}
.op-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.op-tab:hover { color: #00ffff; }
.op-tab.active {
  color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
  border-color: #00ffff;
  border-bottom: 1px solid rgba(0, 255, 255, 0.08);
  margin-bottom: -1px;
}
.op-tab-panel { animation: opTabFadeIn 0.18s ease-out; }
@keyframes opTabFadeIn { from { opacity: 0; } to { opacity: 1; } }

.op-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00ffff;
  letter-spacing: 1px;
  margin: 4px 0 10px;
}
.op-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.op-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 7px 11px;
  background: transparent;
  color: #00ffff;
  border: 1px solid #00ffff;
  cursor: pointer;
  transition: background 0.15s;
}
.op-btn:hover { background: rgba(0, 255, 255, 0.12); }
.op-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
}
.op-btn-ghost:hover { color: #00ffff; border-color: #00ffff; background: rgba(0, 255, 255, 0.06); }
.op-btn-ghost.active {
  color: #00ffff;
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
}

.op-counter-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd;
  margin-bottom: 10px;
}
.op-counter-row b { color: #00ffff; }

/* Filter selects */
.op-select {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.op-select:focus { border-color: #00ffff; outline: none; }
.op-search {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  min-width: 180px;
  flex: 1 1 200px;
}
.op-search:focus { border-color: #00ffff; outline: none; }

/* Data table */
.op-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.op-table thead th {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  color: #00ffff;
  padding: 10px 8px;
  background: rgba(0, 255, 255, 0.04);
  border-bottom: 1px solid #00ffff;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.op-table thead th[data-sort]:hover { background: rgba(0, 255, 255, 0.10); }
.op-table thead th .op-sort-mark { color: #00ffff; margin-left: 4px; }
.op-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #1a1a2e;
  vertical-align: middle;
}
.op-table tbody tr:hover { background: rgba(0, 255, 255, 0.03); }
.op-table tbody tr.op-row-expandable { cursor: pointer; }
.op-table tbody tr.op-row-expanded {
  background: rgba(0, 255, 255, 0.05);
}
.op-table tbody tr.op-row-detail td {
  background: #0a0a0f;
  padding: 14px 16px;
  border-bottom: 2px solid #00ffff;
}

.op-pill {
  display: inline-block;
  padding: 3px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #1a1a2e;
  color: #888;
  white-space: nowrap;
}
.op-pill-pending     { color: #ffd93d; border-color: #ffd93d; }
.op-pill-in_progress { color: #00ffff; border-color: #00ffff; }
.op-pill-completed   { color: #00ff41; border-color: #00ff41; }
.op-pill-error       { color: #ff6464; border-color: #ff6464; }
.op-pill-cancelled   { color: #888;    border-color: #555;    }
.op-pill-low      { color: #888;    border-color: #2a2a3a; }
.op-pill-normal   { color: #cfd;    border-color: #2a2a3a; }
.op-pill-high     { color: #ffd93d; border-color: #ffd93d; }
.op-pill-critical { color: #ff6464; border-color: #ff6464; }

/* KPI / summary cards */
.op-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.op-card {
  border: 1px solid #1a1a2e;
  background: rgba(0, 255, 255, 0.03);
  padding: 14px 16px;
}
.op-card-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.op-card-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #00ffff;
  letter-spacing: 1px;
}
.op-card-sub {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #666;
  margin-top: 6px;
}
.op-trend-up   { color: #00ff41; }
.op-trend-down { color: #ff6464; }
.op-trend-flat { color: #888;    }

/* Chart container — Chart.js renders into the inner canvas */
.op-chart-host {
  position: relative;
  width: 100%;
  height: 260px;
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  padding: 14px;
  margin-bottom: 14px;
}
.op-chart-host canvas { display: block; max-width: 100%; }

/* Room cards (Company tab) */
.op-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.op-room-card {
  border: 1px solid #1a1a2e;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-left: 3px solid var(--room-accent, #00ffff);
  font-family: 'Courier New', monospace;
}
.op-room-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--room-accent, #00ffff);
  margin-bottom: 8px;
}
.op-room-meta { font-size: 10px; color: #888; line-height: 1.5; }
.op-room-meta b { color: #cfd; }

/* Alerts list (Company tab) */
.op-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-left: 3px solid #ffd93d;
  background: rgba(255, 217, 61, 0.05);
  margin-bottom: 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd;
}
.op-alert.op-alert-err  { border-left-color: #ff6464; background: rgba(255, 100, 100, 0.05); }
.op-alert.op-alert-ok   { border-left-color: #00ff41; background: rgba(0, 255, 65, 0.04); color: #888; }

/* Forecast calculator */
.op-calc {
  border: 1px solid #00ffff;
  background: rgba(0, 255, 255, 0.04);
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd;
}
.op-calc input {
  background: #0a0a0f;
  color: #00ffff;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.op-calc input:focus { border-color: #00ffff; outline: none; }
.op-calc-result {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #00ffff;
  letter-spacing: 1px;
}
.op-calc-label { color: #666; font-size: 10px; margin-bottom: 4px; }

.op-empty {
  text-align: center;
  padding: 36px 20px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}

@media (max-width: 720px) {
  .op-calc { grid-template-columns: 1fr; }
  .op-chart-host { height: 200px; }
}

/* ── Training Room modal (orange #ffa03c theme) ───────────────── */

#trainingRoomModal .modal {
  max-height: 90vh;
  overflow-y: auto;
  border-color: #ffa03c;
}
#trainingRoomModal .profile-close {
  border-color: #ffa03c;
  color: #ffa03c;
}
#trainingRoomModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#trainingRoomModal .tr-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
}

.tr-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
  flex-wrap: wrap;
}
.tr-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 16px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tr-tab:hover { color: #ffa03c; }
.tr-tab.active {
  color: #ffa03c;
  background: rgba(255, 160, 60, 0.08);
  border-color: #ffa03c;
  border-bottom: 1px solid rgba(255, 160, 60, 0.08);
  margin-bottom: -1px;
}
.tr-tab-panel { animation: trTabFadeIn 0.18s ease-out; }
@keyframes trTabFadeIn { from { opacity: 0; } to { opacity: 1; } }

.tr-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffa03c;
  letter-spacing: 1px;
  margin: 4px 0 12px;
}
.tr-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 14px;
  background: transparent;
  color: #ffa03c;
  border: 1px solid #ffa03c;
  cursor: pointer;
  transition: background 0.15s;
}
.tr-btn:hover { background: rgba(255, 160, 60, 0.12); }
.tr-btn[disabled] { color: #444; border-color: #2a2a3a; cursor: not-allowed; }
.tr-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
}
.tr-btn-ghost:hover { color: #ffa03c; border-color: #ffa03c; background: rgba(255, 160, 60, 0.06); }

/* Form */
.tr-form {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px 18px;
  padding: 20px;
  border: 1px solid #ffa03c;
  background: rgba(255, 160, 60, 0.03);
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.tr-form label {
  color: #888;
  align-self: start;
  font-size: 10px;
  padding-top: 8px;
}
.tr-form input, .tr-form select, .tr-form textarea {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  width: 100%;
  box-sizing: border-box;
}
.tr-form textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.tr-form input:focus, .tr-form select:focus, .tr-form textarea:focus {
  border-color: #ffa03c;
  outline: none;
}
.tr-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Tags input (Tools) */
.tr-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  padding: 8px;
  min-height: 38px;
}
.tr-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 160, 60, 0.12);
  color: #ffa03c;
  border: 1px solid #ffa03c;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
}
.tr-tag-close {
  cursor: pointer;
  color: #ffa03c;
  font-weight: bold;
  margin-left: 2px;
}
.tr-tag-input {
  flex: 1;
  min-width: 100px;
  border: none !important;
  background: transparent !important;
  padding: 4px !important;
  outline: none;
}
.tr-tag-suggest {
  font-size: 9px;
  color: #555;
  padding: 4px 8px;
  cursor: pointer;
  border: 1px dashed #1a1a2e;
  border-radius: 3px;
}
.tr-tag-suggest:hover { color: #ffa03c; border-color: #ffa03c; }

/* Param rows */
.tr-param-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
}
.tr-param-row input { width: 100%; }

/* Picker (emoji + color) */
.tr-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tr-pick-preview {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 2px solid #ffa03c;
  background: rgba(255, 160, 60, 0.06);
  border-radius: 4px;
  flex-shrink: 0;
}
.tr-emoji-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  flex: 1;
  min-width: 240px;
}
.tr-emoji-btn {
  background: transparent;
  border: 1px solid #1a1a2e;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: border-color 0.12s, background 0.12s;
}
.tr-emoji-btn:hover { border-color: #ffa03c; background: rgba(255, 160, 60, 0.06); }
.tr-emoji-btn.active { border-color: #ffa03c; background: rgba(255, 160, 60, 0.18); }
.tr-color-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tr-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
}
.tr-color-swatch:hover { transform: scale(1.15); }
.tr-color-swatch.active { border-color: #fff; box-shadow: 0 0 0 1px #0a0a0f, 0 0 8px currentColor; }

/* Pills */
.tr-pill {
  display: inline-block;
  padding: 3px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #1a1a2e;
  color: #888;
  margin-right: 4px;
}
.tr-pill-cat-technical     { color: #00ffff; border-color: #00ffff; }
.tr-pill-cat-analytical    { color: #b45aff; border-color: #b45aff; }
.tr-pill-cat-communication { color: #00ff41; border-color: #00ff41; }
.tr-pill-cat-creative      { color: #ffd93d; border-color: #ffd93d; }
.tr-pill-cat-other         { color: #888;    border-color: #555;    }
.tr-pill-lvl-basic         { color: #888;    border-color: #2a2a3a; }
.tr-pill-lvl-intermediate  { color: #cfd;    border-color: #2a2a3a; }
.tr-pill-lvl-advanced      { color: #ffa03c; border-color: #ffa03c; }
.tr-pill-lvl-expert        { color: #ff6464; border-color: #ff6464; }

/* Library grid */
.tr-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tr-search {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 7px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  flex: 1;
  min-width: 200px;
}
.tr-search:focus { border-color: #ffa03c; outline: none; }
.tr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  padding: 5px 9px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  cursor: pointer;
}
.tr-chip:hover { color: #ffa03c; border-color: #ffa03c; }
.tr-chip.active { color: #ffa03c; border-color: #ffa03c; background: rgba(255, 160, 60, 0.08); }

.tr-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.tr-skill-card {
  border: 1px solid #1a1a2e;
  background: #0f0f1a;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
  position: relative;
  font-family: 'Courier New', monospace;
  border-top: 3px solid var(--skill-color, #ffa03c);
}
.tr-skill-card:hover {
  border-color: var(--skill-color, #ffa03c);
  background: rgba(255, 160, 60, 0.04);
  transform: translateY(-1px);
}
.tr-skill-emoji { font-size: 28px; margin-bottom: 8px; }
.tr-skill-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #cfd;
  letter-spacing: 1px;
  margin-bottom: 6px;
  line-height: 1.3;
}
.tr-skill-pills { margin-bottom: 8px; }
.tr-skill-desc {
  font-size: 10px;
  color: #888;
  line-height: 1.4;
  margin-bottom: 10px;
  /* clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tr-skill-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #666;
  border-top: 1px dashed #1a1a2e;
  padding-top: 8px;
}
.tr-skill-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #555;
  font-size: 12px;
}

/* Master-detail for AGENTS tab */
.tr-split {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.tr-agent-list {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  max-height: 60vh;
  overflow-y: auto;
}
.tr-agent-item {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a2e;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.12s;
}
.tr-agent-item:last-child { border-bottom: none; }
.tr-agent-item:hover { background: rgba(255, 160, 60, 0.04); }
.tr-agent-item.active {
  background: rgba(255, 160, 60, 0.10);
  border-left: 3px solid #ffa03c;
  padding-left: 9px;
}
.tr-agent-name { color: #cfd; }
.tr-agent-role { color: #666; font-size: 9px; }
.tr-agent-count {
  background: rgba(255, 160, 60, 0.16);
  color: #ffa03c;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 3px 7px;
  border: 1px solid #ffa03c;
  min-width: 18px;
  text-align: center;
}
.tr-agent-count.zero {
  background: transparent;
  color: #555;
  border-color: #2a2a3a;
}

.tr-detail {
  border: 1px solid #1a1a2e;
  background: rgba(255, 160, 60, 0.02);
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
  min-height: 280px;
}
.tr-detail-empty {
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  text-align: center;
  padding: 70px 20px;
}
.tr-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
}
.tr-detail-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ffa03c;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.tr-detail-role { font-family: 'Courier New', monospace; font-size: 10px; color: #666; }

.tr-assign-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
}

.tr-empty {
  text-align: center;
  padding: 36px 20px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}

/* Skill detail modal sections */
.tr-detail-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 12px;
  margin: 12px 0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
}
.tr-detail-meta dt { color: #666; }
.tr-detail-meta dd { color: #cfd; margin: 0; word-break: break-word; }
.tr-detail-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #1a1a2e;
}
.tr-detail-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .tr-split { grid-template-columns: 1fr; }
  .tr-form { grid-template-columns: 1fr; }
  .tr-form label { padding-top: 0; }
}

/* ── Data Center modal (cyan-blue #00c8ff theme) ─────────────── */

#dataCenterModal .modal {
  max-height: 92vh;
  overflow-y: auto;
  border-color: #00c8ff;
}
#dataCenterModal .profile-close {
  border-color: #00c8ff;
  color: #00c8ff;
}
#dataCenterModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#dataCenterModal .dc-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
}

.dc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
  flex-wrap: wrap;
}
.dc-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.dc-tab:hover { color: #00c8ff; }
.dc-tab.active {
  color: #00c8ff;
  background: rgba(0, 200, 255, 0.08);
  border-color: #00c8ff;
  border-bottom: 1px solid rgba(0, 200, 255, 0.08);
  margin-bottom: -1px;
}
.dc-tab-panel { animation: dcTabFadeIn 0.18s ease-out; }
@keyframes dcTabFadeIn { from { opacity: 0; } to { opacity: 1; } }

.dc-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #00c8ff;
  letter-spacing: 1px;
  margin: 4px 0 12px;
}
.dc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dc-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 14px;
  background: transparent;
  color: #00c8ff;
  border: 1px solid #00c8ff;
  cursor: pointer;
  transition: background 0.15s;
}
.dc-btn:hover { background: rgba(0, 200, 255, 0.12); }
.dc-btn[disabled] { color: #444; border-color: #2a2a3a; cursor: not-allowed; }
.dc-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
}
.dc-btn-ghost:hover { color: #00c8ff; border-color: #00c8ff; background: rgba(0, 200, 255, 0.06); }
.dc-btn-ghost.active { color: #00c8ff; border-color: #00c8ff; background: rgba(0, 200, 255, 0.08); }

.dc-search {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  min-width: 200px;
  flex: 1 1 200px;
}
.dc-search:focus { border-color: #00c8ff; outline: none; }
.dc-select {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 7px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.dc-select:focus { border-color: #00c8ff; outline: none; }
.dc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  padding: 5px 9px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  cursor: pointer;
}
.dc-chip:hover { color: #00c8ff; border-color: #00c8ff; }
.dc-chip.active { color: #00c8ff; border-color: #00c8ff; background: rgba(0, 200, 255, 0.08); }

/* Connection cards */
.dc-conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.dc-conn-card {
  border: 1px solid #1a1a2e;
  background: #0f0f1a;
  padding: 14px;
  font-family: 'Courier New', monospace;
  position: relative;
  border-top: 3px solid var(--conn-color, #00c8ff);
}
.dc-conn-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dc-conn-icon { font-size: 26px; }
.dc-conn-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #cfd;
  letter-spacing: 1px;
  line-height: 1.3;
}
.dc-conn-sub { font-size: 9px; color: #666; margin-top: 2px; }
.dc-conn-cat {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 8px;
}
.dc-conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  margin-bottom: 4px;
}
.dc-conn-status-active   { color: #00ff41; }
.dc-conn-status-error    { color: #ff6464; }
.dc-conn-status-attention{ color: #ffd93d; }
.dc-conn-status-untested { color: #888; }
.dc-conn-meta { font-size: 9px; color: #666; margin-bottom: 10px; }
.dc-conn-actions {
  display: flex;
  gap: 6px;
  border-top: 1px dashed #1a1a2e;
  padding-top: 10px;
  flex-wrap: wrap;
}

/* Wizard */
.dc-wiz-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #00c8ff;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.dc-wiz-step {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #888;
  margin-bottom: 14px;
}
.dc-wiz-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
}
.dc-wiz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a2e;
}
.dc-wiz-dot.active { background: #00c8ff; }
.dc-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.dc-type-tile {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  padding: 14px 8px;
  cursor: pointer;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #cfd;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.dc-type-tile:hover { border-color: #00c8ff; background: rgba(0, 200, 255, 0.06); transform: translateY(-1px); }
.dc-type-tile.active { border-color: #00c8ff; background: rgba(0, 200, 255, 0.12); }
.dc-type-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.dc-wiz-form {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.dc-wiz-form label { color: #888; align-self: center; font-size: 10px; }
.dc-wiz-form input, .dc-wiz-form select {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 7px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  width: 100%;
  box-sizing: border-box;
}
.dc-wiz-form input:focus, .dc-wiz-form select:focus { border-color: #00c8ff; outline: none; }
.dc-wiz-notice {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #888;
  padding: 8px 10px;
  border-left: 3px solid #ffd93d;
  background: rgba(255, 217, 61, 0.05);
}
.dc-wiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 10px;
}
.dc-wiz-actions .dc-btn,
.dc-wiz-actions .dc-btn-ghost {
  /* Uniform width + style across the wizard footer so BACK / CANCEL /
     NEXT / DONE all look the same. */
  min-width: 110px;
  font-size: 8px;
  padding: 10px 14px;
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
  cursor: pointer;
}
.dc-wiz-actions button:not([disabled]):hover {
  color: #00c8ff;
  border-color: #00c8ff;
  background: rgba(0, 200, 255, 0.06);
}
.dc-wiz-actions button.dc-btn-primary {
  color: #00c8ff;
  border-color: #00c8ff;
}
.dc-wiz-actions button.dc-btn-primary:hover {
  background: rgba(0, 200, 255, 0.14);
}

/* Tutorial card — shows up in wizard step 2 per connection type */
.dc-tutorial {
  background: rgba(0, 200, 255, 0.04);
  border: 1px solid #1a1a2e;
  border-left: 3px solid #00c8ff;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.dc-tutorial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.dc-tutorial-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #00c8ff;
  letter-spacing: 1px;
}
.dc-tutorial-toggle {
  font-size: 11px;
  color: #888;
}
.dc-tutorial-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #1a1a2e;
}
.dc-tutorial ol {
  margin: 0;
  padding-left: 22px;
  line-height: 1.7;
}
.dc-tutorial li { margin-bottom: 4px; }
.dc-tutorial a {
  color: #00c8ff;
  text-decoration: none;
  border-bottom: 1px dotted #00c8ff;
}
.dc-tutorial a:hover { color: #ffd93d; border-color: #ffd93d; }
.dc-tutorial code {
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  padding: 1px 6px;
  font-size: 10px;
  color: #ffd93d;
}
.dc-wiz-result {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  padding: 16px;
  margin: 12px 0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.dc-wiz-result-ok { border-color: #00ff41; background: rgba(0, 255, 65, 0.06); }
.dc-wiz-result-err { border-color: #ff6464; background: rgba(255, 100, 100, 0.06); }
.dc-wiz-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #1a1a2e;
  border-top: 2px solid #00c8ff;
  border-radius: 50%;
  animation: dcSpin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
@keyframes dcSpin { to { transform: rotate(360deg); } }

/* Files browser */
.dc-files-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 14px;
}
.dc-tree {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  max-height: 58vh;
  overflow-y: auto;
  padding: 4px;
}
.dc-tree-item {
  padding: 6px 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
}
.dc-tree-item:hover { background: rgba(0, 200, 255, 0.06); }
.dc-tree-item.active { background: rgba(0, 200, 255, 0.12); color: #00c8ff; }
.dc-tree-indent { display: inline-block; width: 14px; }
.dc-tree-icon { font-size: 13px; flex-shrink: 0; }

.dc-files-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dc-files-path {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #666;
  padding: 6px 8px;
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  word-break: break-all;
}
.dc-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 80px 110px 110px 110px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid #1a1a2e;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #c0c0c0;
}
.dc-file-row.head {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #00c8ff;
  border-bottom: 1px solid #00c8ff;
  background: rgba(0, 200, 255, 0.04);
}
.dc-file-row .nm { color: #cfd; word-break: break-all; cursor: pointer; }
.dc-file-row .nm:hover { color: #00c8ff; }
.dc-file-actions { display: flex; gap: 4px; }
.dc-file-preview {
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  border-left: 3px solid #00c8ff;
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd;
  max-height: 36vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tables for SEARCH + HISTORY tabs */
.dc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.dc-table thead th {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  color: #00c8ff;
  padding: 10px 8px;
  background: rgba(0, 200, 255, 0.04);
  border-bottom: 1px solid #00c8ff;
  text-align: left;
  white-space: nowrap;
}
.dc-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #1a1a2e;
  vertical-align: middle;
}
.dc-table tbody tr.expandable { cursor: pointer; }
.dc-table tbody tr.expandable:hover { background: rgba(0, 200, 255, 0.04); }
.dc-table tbody tr.detail td {
  background: #0a0a0f;
  padding: 14px 16px;
  border-bottom: 2px solid #00c8ff;
}

.dc-pill {
  display: inline-block;
  padding: 3px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #1a1a2e;
  color: #888;
}
.dc-pill-web      { color: #00c8ff; border-color: #00c8ff; }
.dc-pill-database { color: #b45aff; border-color: #b45aff; }
.dc-pill-files    { color: #ffa03c; border-color: #ffa03c; }
.dc-pill-api      { color: #00ff41; border-color: #00ff41; }
.dc-pill-research { color: #b45aff; border-color: #b45aff; }
.dc-pill-delegate { color: #ffa040; border-color: #ffa040; }
.dc-pill-chat     { color: #00c8ff; border-color: #00c8ff; }
.dc-pill-error    { color: #ff6464; border-color: #ff6464; }
.dc-pill-completed{ color: #00ff41; border-color: #00ff41; }
.dc-pill-in_progress { color: #00c8ff; border-color: #00c8ff; }
.dc-pill-pending  { color: #ffd93d; border-color: #ffd93d; }

.dc-empty {
  text-align: center;
  padding: 40px 20px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}
.dc-empty-big {
  text-align: center;
  padding: 60px 30px;
  border: 2px dashed #1a1a2e;
}
.dc-empty-big .dc-btn { font-size: 10px; padding: 14px 28px; }

@media (max-width: 720px) {
  .dc-files-layout { grid-template-columns: 1fr; }
  .dc-tree { max-height: 28vh; }
  .dc-file-row { grid-template-columns: 1fr; }
}

/* ── Team Room modal (purple #c77dff theme) ─────────────────── */

#teamRoomModal .modal {
  max-height: 92vh;
  overflow-y: auto;
  border-color: #c77dff;
}
#teamRoomModal .profile-close {
  border-color: #c77dff;
  color: #c77dff;
}
#teamRoomModal .profile-close:hover {
  background: #ff6464;
  color: #0a0a0f;
  border-color: #ff6464;
}
#teamRoomModal .troom-tabs {
  position: sticky;
  top: 0;
  background: #0f0f1a;
  z-index: 5;
  padding-top: 4px;
}

.troom-header-list {
  margin-bottom: 14px;
}
.troom-header-team {
  margin-bottom: 14px;
}
.troom-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #1a1a2e;
  color: #888;
  padding: 6px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  cursor: pointer;
  margin-bottom: 12px;
}
.troom-back:hover { color: #c77dff; border-color: #c77dff; background: rgba(199, 125, 255, 0.06); }

.troom-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a1a2e;
  flex-wrap: wrap;
}
.troom-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  border: 1px solid #1a1a2e;
  border-bottom: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.troom-tab:hover { color: #c77dff; }
.troom-tab.active {
  color: #c77dff;
  background: rgba(199, 125, 255, 0.08);
  border-color: #c77dff;
  border-bottom: 1px solid rgba(199, 125, 255, 0.08);
  margin-bottom: -1px;
}
.troom-tab-panel { animation: troomFadeIn 0.18s ease-out; }
@keyframes troomFadeIn { from { opacity: 0; } to { opacity: 1; } }

.troom-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #c77dff;
  letter-spacing: 1px;
  margin: 4px 0 12px;
}
.troom-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 14px;
  background: transparent;
  color: #c77dff;
  border: 1px solid #c77dff;
  cursor: pointer;
  transition: background 0.15s;
}
.troom-btn:hover { background: rgba(199, 125, 255, 0.12); }
.troom-btn[disabled] { color: #444; border-color: #2a2a3a; cursor: not-allowed; }
.troom-btn-ghost {
  background: transparent;
  color: #888;
  border: 1px solid #1a1a2e;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 14px;
  cursor: pointer;
}
.troom-btn-ghost:hover { color: #c77dff; border-color: #c77dff; background: rgba(199, 125, 255, 0.06); }

.troom-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.troom-search {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  min-width: 200px;
  flex: 1 1 200px;
}
.troom-search:focus { border-color: #c77dff; outline: none; }
.troom-select {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 7px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.troom-select:focus { border-color: #c77dff; outline: none; }

/* Team grid cards (mode A) */
.troom-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.troom-team-card {
  border: 1px solid #1a1a2e;
  background: #0f0f1a;
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  border-top: 3px solid var(--team-color, #c77dff);
}
.troom-team-card:hover {
  border-color: var(--team-color, #c77dff);
  background: rgba(199, 125, 255, 0.04);
  transform: translateY(-2px);
}
.troom-team-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.troom-team-emoji { font-size: 32px; }
.troom-team-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--team-color, #c77dff);
  line-height: 1.3;
}
.troom-team-desc {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #888;
  margin-bottom: 12px;
  min-height: 18px;
}
.troom-team-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #1a1a2e;
  padding-top: 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.troom-team-stats b { color: #cfd; }

.troom-pill {
  display: inline-block;
  padding: 3px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  border: 1px solid #1a1a2e;
  color: #888;
}
.troom-pill-active   { color: #00ff41; border-color: #00ff41; }
.troom-pill-paused   { color: #ffd93d; border-color: #ffd93d; }
.troom-pill-archived { color: #888;    border-color: #555;    }

/* CREATE form (inline) */
.troom-form {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 16px;
  padding: 18px;
  border: 1px solid #c77dff;
  background: rgba(199, 125, 255, 0.04);
  margin-bottom: 18px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  animation: troomFadeIn 0.18s ease-out;
}
.troom-form label {
  color: #888;
  align-self: center;
  font-size: 10px;
}
.troom-form input, .troom-form select, .troom-form textarea {
  background: #0a0a0f;
  color: #c0c0c0;
  border: 1px solid #1a1a2e;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  width: 100%;
  box-sizing: border-box;
}
.troom-form input:focus, .troom-form select:focus, .troom-form textarea:focus {
  border-color: #c77dff;
  outline: none;
}
.troom-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.troom-emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.troom-emoji-btn {
  background: transparent;
  border: 1px solid #1a1a2e;
  padding: 6px 8px;
  font-size: 18px;
  cursor: pointer;
}
.troom-emoji-btn:hover { border-color: #c77dff; background: rgba(199, 125, 255, 0.06); }
.troom-emoji-btn.active { border-color: #c77dff; background: rgba(199, 125, 255, 0.18); }
.troom-color-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.troom-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
}
.troom-color-swatch:hover { transform: scale(1.15); }
.troom-color-swatch.active { border-color: #fff; box-shadow: 0 0 0 1px #0a0a0f, 0 0 8px currentColor; }

/* Team detail header (mode B) */
.troom-team-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.troom-team-head-emoji { font-size: 38px; }
.troom-team-head-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  color: #c77dff;
}
.troom-team-head-meta {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #888;
  margin-top: 4px;
}

/* KPI cards */
.troom-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.troom-card {
  border: 1px solid #1a1a2e;
  background: rgba(199, 125, 255, 0.03);
  padding: 14px 16px;
}
.troom-card-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.troom-card-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #c77dff;
  letter-spacing: 1px;
}

/* Work row (in Overview "what team works on" section) */
.troom-work-agent {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
}
.troom-work-agent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #cfd;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.troom-work-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-left: 2px solid #1a1a2e;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.troom-work-task-bar {
  flex: 0 0 100px;
  height: 6px;
  background: #1a1a2e;
  border-radius: 1px;
  overflow: hidden;
}
.troom-work-task-bar-fill {
  height: 100%;
  background: #c77dff;
}
.troom-work-idle {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #555;
  padding: 6px 12px;
}

/* Activity feed */
.troom-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid #1a1a2e;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.troom-feed-item:last-child { border-bottom: none; }
.troom-feed-dot { color: #c77dff; font-size: 10px; }
.troom-feed-when { margin-left: auto; color: #666; font-size: 10px; }

/* AGENTS tab — master detail */
.troom-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.troom-pane {
  border: 1px solid #1a1a2e;
  background: #0a0a0f;
  padding: 12px;
}
.troom-pane-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a2e;
}
.troom-agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #1a1a2e;
  background: #0f0f1a;
  margin-bottom: 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.troom-agent-row .nm { color: #cfd; font-weight: bold; }
.troom-agent-row .sub { color: #666; font-size: 10px; margin-top: 2px; }

/* WORK tab tables */
.troom-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c0c0c0;
}
.troom-table thead th {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  color: #c77dff;
  padding: 10px 8px;
  background: rgba(199, 125, 255, 0.04);
  border-bottom: 1px solid #c77dff;
  text-align: left;
  white-space: nowrap;
}
.troom-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #1a1a2e;
  vertical-align: middle;
}
.troom-table tbody tr:hover { background: rgba(199, 125, 255, 0.04); }

/* Status / priority pills shared with op-pill colors */
.troom-pill-pending     { color: #ffd93d; border-color: #ffd93d; }
.troom-pill-in_progress { color: #c77dff; border-color: #c77dff; }
.troom-pill-completed   { color: #00ff41; border-color: #00ff41; }
.troom-pill-error       { color: #ff6464; border-color: #ff6464; }
.troom-pill-cancelled   { color: #888;    border-color: #555;    }
.troom-pill-low      { color: #888;    border-color: #2a2a3a; }
.troom-pill-normal   { color: #cfd;    border-color: #2a2a3a; }
.troom-pill-high     { color: #ffd93d; border-color: #ffd93d; }
.troom-pill-critical { color: #ff6464; border-color: #ff6464; }

/* DANGER ZONE (settings) */
.troom-danger {
  border: 2px solid #ff6464;
  background: rgba(255, 100, 100, 0.05);
  padding: 18px;
  margin-top: 24px;
}
.troom-danger-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #ff6464;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* Chart host scoped (reuse Operations dimensions) */
.troom-chart-host {
  position: relative;
  width: 100%;
  height: 240px;
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  padding: 14px;
  margin-bottom: 14px;
}

.troom-empty {
  text-align: center;
  padding: 40px 20px;
  color: #555;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  border: 1px dashed #1a1a2e;
}
.troom-empty-big {
  text-align: center;
  padding: 70px 30px;
  border: 2px dashed #1a1a2e;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .troom-split { grid-template-columns: 1fr; }
  .troom-form { grid-template-columns: 1fr; }
}
