#v2-queue-panel {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 300px;
  /* Stop above the bottom-right minimap (180 + margins) so it never covers it. */
  max-height: calc(100vh - 280px);
  /* Vertical scroll only; clamp horizontal so long labels never pop a scrollbar. */
  overflow: hidden auto;
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid var(--neon-muted);
  padding: 10px 12px 12px;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 12px;
  /* Below the top bar (z-index 10) so the expanded MENU dropdown, which lives
     inside the top bar's stacking context, paints above the queue. */
  z-index: 9;
}

.queue-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.10);
  color: var(--neon-primary);
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 0 0 6px;
  transition: color 150ms;
}
.queue-title:hover { color: #66e6ff; }
/* Collapsed: header only — drop the separator that would dangle under it. */
.queue-title.collapsed {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.queue-chevron {
  display: inline-flex;
  flex: none;
  color: var(--neon-primary);
}

.queue-empty {
  color: #5a6878;
  font-size: 11px;
  font-style: italic;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item {
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.10);
  color: var(--ink);
  font-family: var(--font-body);
  padding: 6px 8px 8px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 150ms, border-color 150ms;
}
.queue-item:hover {
  background: rgba(0, 212, 255, 0.10);
  border-color: var(--neon-primary);
}
.queue-label {
  font-size: 12px;
  color: #e6edf3;
  text-transform: capitalize;
}
.queue-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}
.queue-bar {
  height: 3px;
  background: rgba(0, 212, 255, 0.10);
  position: relative;
  overflow: hidden;
}
.queue-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--neon-primary);
  transition: width 400ms ease-out;
}

.queue-item-build .queue-bar-fill { background: #ffaa00; }
.queue-item-unit  .queue-bar-fill { background: #ff5544; }
.queue-item-worker .queue-bar-fill { background: #44ddaa; }
.queue-item-move  .queue-bar-fill { background: #00d4ff; }

/* Phones: the build queue spans the width (minus small margins) and tucks under
   the top bar, clearing the notch. */
@media (max-width: 640px) {
  #v2-queue-panel {
    top: calc(60px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100dvh - 76px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
