.queue-shell {
  min-height: 100vh;
  background: var(--bg);
}

.queue-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  min-height: calc(100vh - 74px);
}

.queue-list-panel,
.queue-detail-panel {
  min-width: 0;
  background: var(--panel);
  padding: 20px;
  overflow: auto;
}

.queue-list-panel {
  border-right: 1px solid var(--line);
}

.queue-detail-panel {
  background: #f8fafc;
}

.queue-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.queue-item.active,
.queue-item:hover {
  border-color: var(--primary);
}

.queue-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.queue-item-meta,
.queue-message,
.subtask-meta,
.file-meta {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-succeeded {
  background: #dcfce7;
  color: #166534;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.progress-wrap {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease;
}

.queue-message {
  margin: 10px 0 18px;
}

.task-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  margin: -4px 0 14px;
}

.button.danger {
  background: #991b1b;
  border-color: #991b1b;
  color: #fff;
}

.button.danger-outline {
  background: #fff;
  border-color: #fecaca;
  color: #991b1b;
}

.button.danger:hover,
.button.danger-outline:hover {
  filter: brightness(0.97);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-note {
  color: var(--muted);
  font-size: 12px;
}

.queue-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
}

.queue-section h2 {
  margin-bottom: 10px;
}

.subtask-list,
.output-files {
  display: grid;
  gap: 8px;
}

.subtask-item,
.output-file {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.subtask-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.output-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output-file a {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  word-break: break-word;
}

.output-file a:hover {
  text-decoration: underline;
}

.queue-log {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dbeafe;
  background: #0f172a;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .queue-layout {
    grid-template-columns: 1fr;
  }

  .queue-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
