﻿/* Extracted from site-new.css. Legacy rules remain in site-new.css until visual verification is complete. */

.task-stats,
.history-list {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.94rem;
  line-height: 1.5;
  white-space: pre-line;
}

.history-list {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.2rem 0.45rem 0.35rem 0.2rem;
  scrollbar-gutter: stable;
}

#history-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

#history-panel .history-list {
  flex: 1 1 auto;
}

.history-row {
  display: grid;
  gap: 0.18rem;
  padding: 0.55rem 0.6rem;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.history-row:not(.is-unavailable):hover,
.history-row:not(.is-unavailable):focus-visible,
.history-row.is-selected {
  background: var(--secondary);
  box-shadow: 0 0 0 1px rgba(11, 117, 255, 0.24);
  outline: none;
}

.history-row.is-loading {
  cursor: progress;
  opacity: 0.66;
}

.history-row.is-unavailable {
  cursor: default;
}

.history-row.is-unavailable strong {
  color: var(--muted-foreground);
}

.history-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.history-row-content {
  display: grid;
  gap: 0.18rem;
  align-content: start;
  flex: 1 1 auto;
  min-width: 0;
}

.history-row-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.history-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.history-row strong {
  color: var(--foreground);
  font-size: 0.95rem;
  min-width: 0;
}

.history-row span {
  color: var(--muted-foreground);
  font-size: 0.86rem;
}

.history-row .history-status {
  box-sizing: border-box;
  display: inline-flex;
  width: 5.45rem;
  min-height: 1.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.3rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.history-row .history-status-done {
  background: #e7f0ff;
  color: #1759a8;
}

.history-row .history-status-error {
  background: #fdeaea;
  color: var(--danger);
}

.history-row .history-status-cancelled {
  background: #fff2c7;
  color: #7a5700;
}

.history-row .history-status-processing {
  background: #e8f7ee;
  color: #137333;
}

.history-row .history-status-queued,
.history-row .history-status-default {
  background: #eef1f5;
  color: #4b5563;
}

.history-row .history-queue-position,
.history-row .history-task-progress-label {
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 600;
}

.history-task-progress {
  display: grid;
  gap: 0.24rem;
  width: min(100%, 18rem);
}

.history-task-progress-bar {
  position: relative;
  display: block;
  height: 0.28rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.history-task-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 240ms ease;
}

.history-task-progress-fill.is-indeterminate {
  width: 38%;
  animation: history-progress-indeterminate 1.25s ease-in-out infinite;
}

@keyframes history-progress-indeterminate {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(300%); }
}

.history-download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.85rem;
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
}

.history-download-button::before {
  content: "↓";
  font-size: 0.92rem;
  line-height: 1;
}

.history-download-button:hover:not(:disabled) {
  border-color: rgba(11, 117, 255, 0.42);
  color: var(--primary);
}

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

.history-download-message {
  color: var(--muted-foreground);
}

.history-row:first-child {
  border-top: 0;
}

.history-delete-button {
  display: inline-grid;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--background);
  color: var(--muted-foreground);
  cursor: pointer;
}

.history-delete-button svg {
  width: 1rem;
  height: 1rem;
}

.history-delete-button:hover,
.history-delete-button:focus-visible {
  border-color: #dc8c8c;
  color: var(--danger);
  outline: none;
}

.history-delete-modal-panel {
  width: min(28rem, 100%);
}

.history-delete-task-name {
  display: block;
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
  color: var(--foreground);
}
