/* ============================================================
   Generator extras — history, bulk, health, stats, queue
   Depends on styles.css tokens. Does not touch generator IDs.
   ============================================================ */

.gx-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: -24px 0 clamp(48px, 8vw, 88px);
}

.gx-panel {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: clamp(16px, 2.5vw, 22px);
}

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

.gx-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gx-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.18);
  flex: 0 0 auto;
}

.gx-sub {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.gx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gx-btn {
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.gx-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.gx-btn:active:not(:disabled) { transform: translateY(1px); }

.gx-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gx-btn-primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.gx-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  color: var(--on-accent);
  border-color: transparent;
}

.gx-btn-danger:hover:not(:disabled) {
  border-color: var(--bad);
  color: var(--bad);
}

/* ---------- live stats ---------- */
.gx-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .gx-stats { grid-template-columns: repeat(2, 1fr); }
}

.gx-stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 14px;
}

.gx-stat-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.gx-stat-value {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.gx-stat-ok .gx-stat-value { color: var(--ok); }
.gx-stat-fail .gx-stat-value { color: var(--bad); }
.gx-stat-rate .gx-stat-value { color: var(--accent); }

/* ---------- bulk ---------- */
.gx-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gx-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.gx-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.gx-meta-row strong { color: var(--accent); }

.gx-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.gx-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- health list ---------- */
.gx-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.gx-health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.gx-health-item.is-dead {
  opacity: 0.45;
  border-color: rgba(255, 107, 107, 0.35);
}

.gx-health-item.is-ok {
  border-color: rgba(61, 220, 151, 0.3);
}

.gx-health-item.is-unknown { opacity: 0.7; }

.gx-health-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.gx-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}
.gx-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.15); }
.gx-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15); }
.gx-dot.pending { background: var(--accent); animation: gx-pulse 1s ease infinite; }

@keyframes gx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.gx-filtered-note {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- history / queue lists ---------- */
.gx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.gx-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.gx-list-main {
  min-width: 0;
  flex: 1;
}

.gx-list-url {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
  word-break: break-all;
}

.gx-list-meta {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.gx-list-meta .ok { color: var(--ok); }
.gx-list-meta .fail { color: var(--bad); }

.gx-empty {
  padding: 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-s);
}

/* queue next banner */
.gx-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255, 178, 36, 0.07);
  border: 1px solid rgba(255, 178, 36, 0.3);
  border-radius: var(--radius-s);
}

.gx-next-text {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 0;
  word-break: break-all;
}

/* header queue badge */
.head-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 5px;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
}

.head-badge[hidden] { display: none; }

/* share preset status */
.gx-preset-note {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ok);
}
.gx-preset-note.is-err { color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  .gx-dot.pending { animation: none; }
}
