:root {
  --bg: #0b1020;
  --panel: #121a2f;
  --muted-panel: #18223d;
  --text: #f3f6ff;
  --muted: #b6c2e0;
  --accent: #67e8f9;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --critical: #f87171;
  --border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #09101f, #0f172a);
  color: var(--text);
}

a { color: var(--accent); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.container.narrow {
  width: min(760px, calc(100% - 2rem));
}

.card,
.stat-card {
  background: rgba(18, 26, 47, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  margin-bottom: 1rem;
}

.hero h1,
.card h1,
.card h2,
.card h3 {
  margin-top: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 0.5rem 0;
}

.muted {
  color: var(--muted);
}

.page-actions,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

.banner {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border: 1px solid transparent;
}

.banner-info {
  background: rgba(103, 232, 249, 0.12);
  color: var(--accent);
  border-color: rgba(103, 232, 249, 0.22);
}

.banner-warn,
.warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
}

.banner-danger,
.danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.22);
}

.scan-form {
  display: grid;
  gap: 1rem;
}

.disabled-panel {
  opacity: 0.68;
}

.field-group {
  display: grid;
  gap: 1rem;
}

.two-up {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--muted-panel);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.options {
  gap: 0.7rem;
}

.checkbox {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.checkbox input {
  width: auto;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  text-decoration: none;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: #06202a;
}

.secondary-btn {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.primary-btn[disabled],
.secondary-btn[disabled],
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-header,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-row {
  margin-top: 1rem;
}

.status-badge,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-badge {
  text-transform: capitalize;
}

.status-queued { background: rgba(251, 191, 36, 0.16); color: var(--warn); }
.status-running { background: rgba(103, 232, 249, 0.16); color: var(--accent); }
.status-completed { background: rgba(52, 211, 153, 0.16); color: var(--success); }
.status-failed { background: rgba(248, 113, 113, 0.16); color: var(--danger); }

/* Progress steps timeline */
.progress-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0;
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1.2rem;
  border-left: 2px solid var(--border);
}
.progress-step:last-child { border-left-color: transparent; }
.progress-dot {
  position: absolute;
  left: -0.375rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.progress-step-done .progress-dot {
  background: var(--success);
}
.progress-step-done .progress-label {
  color: var(--success);
}
.progress-step-active .progress-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.progress-step-active .progress-label {
  color: var(--accent);
  font-weight: 600;
}
.progress-step-pending .progress-dot {
  background: var(--muted-panel);
  border: 1px solid var(--muted);
}
.progress-time {
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.kv-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 1rem 0 0;
}

.kv-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kv-grid dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.kv-grid dd {
  margin: 0.35rem 0 0;
  word-break: break-word;
}

.grid,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.two-column-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1rem;
}

.stat-card {
  margin-bottom: 0;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.7rem;
}

.list-spaced {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.2rem;
}

.compact-list {
  margin: 0.6rem 0 0;
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  padding: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.truncate-cell {
  word-break: break-word;
  max-width: 420px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(103, 232, 249, 0.12);
  color: var(--accent);
}

.pill-accessible,
.pill-present,
.pill-completed,
.pill-confirmed,
.pill-not-affected,
.pill-low,
.pill-success {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
}

.pill-blocked,
.pill-running,
.pill-medium,
.pill-queued,
.pill-unknown,
.pill-unverified {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warn);
}

.pill-critical,
.pill-high,
.pill-failed {
  background: rgba(248, 113, 113, 0.16);
  color: var(--danger);
}

.top-space {
  margin-top: 1rem;
}

.subheading {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

details summary {
  cursor: pointer;
}
