/* Queue panel shared by the instant and full-arch task cards.  Uses the
   pages' own tokens (--ink, --blue, --cyan, --line ...). */
.queue-panel {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(40, 104, 245, 0.07), rgba(32, 184, 202, 0.06)),
    rgba(255, 255, 255, 0.66);
}

.queue-panel[hidden] {
  display: none;
}

.queue-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The track: files in the order they will be served. */
.queue-track {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 4px 2px 0;
  list-style: none;
}

.queue-node {
  position: relative;
  display: grid;
  flex: 1 1 0;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 96px;
}

/* Connector to the previous node. */
.queue-node + .queue-node::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #d5e0f0;
}

.queue-node i {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 2px solid #c3d1e6;
  border-radius: 50%;
  background: #ffffff;
}

.queue-node small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.queue-node-running i {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(32, 184, 202, 0.45);
  animation: queue-pulse 1.8s ease-out infinite;
}

.queue-node-own i {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 104, 245, 0.16);
}

.queue-node-own small {
  color: var(--blue-deep);
  font-weight: 850;
}

.queue-node-own.queue-node-running i {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(40, 104, 245, 0.45);
}

.queue-node-gap span {
  position: relative;
  z-index: 1;
  padding: 1px 8px;
  border: 1px dashed #b9c8de;
  border-radius: 999px;
  background: #f4f8fe;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
}

@keyframes queue-pulse {
  0% { box-shadow: 0 0 0 0 rgba(32, 184, 202, 0.42); }
  70% { box-shadow: 0 0 0 9px rgba(32, 184, 202, 0); }
  100% { box-shadow: 0 0 0 0 rgba(32, 184, 202, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .queue-node-running i { animation: none; }
}

/* The three figures. */
.queue-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.queue-tile {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
}

.queue-tile span,
.queue-tile strong,
.queue-tile small {
  display: block;
}

.queue-tile span {
  color: #8693a7;
  font-size: 12px;
}

.queue-tile strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.queue-tile:first-child strong {
  color: var(--blue-deep);
}

.queue-tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.queue-basis {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.queue-basis svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Narrow screens: one compact row per figure, label left, value right. */
@media (max-width: 520px) {
  .queue-panel { gap: 12px; padding: 14px; }
  .queue-tiles { grid-template-columns: 1fr; gap: 8px; }
  .queue-tile {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "label value" "label note";
    align-items: center;
    column-gap: 12px;
    padding: 10px 14px;
  }
  .queue-tile span { grid-area: label; font-size: 13px; }
  .queue-tile strong { grid-area: value; margin-top: 0; font-size: 19px; text-align: right; }
  .queue-tile small { grid-area: note; margin-top: 0; text-align: right; }
  .queue-node small { font-size: 11px; }
}
