:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #eef1f6;
  --text: #1a2332;
  --text-secondary: #4a5568;
  --muted: #6b7280;
  --border: #d8dee8;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --skip: #64748b;
  --skip-bg: #f1f5f9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  font-family: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1rem 2.5rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

.site-header {
  background: linear-gradient(165deg, #1e3a5f 0%, #2d4a6f 100%);
  color: #f8fafc;
  padding: 1.75rem 0 2rem;
  margin: 0 -1rem 1.5rem;
  padding-inline: 1rem;
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
}

.lede {
  margin: 0;
  max-width: 36rem;
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.55;
}

main {
  max-width: 920px;
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.section-help {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.loading {
  color: var(--muted);
  padding: 0.5rem 0;
}

.error-box {
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  color: var(--danger);
  font-size: 0.92rem;
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.run-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

.badge-success {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-partial {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-failed {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-skipped,
.badge-unknown {
  background: var(--skip-bg);
  color: var(--skip);
}

.run-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.stat-card {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.stat-card .value {
  font-size: 1.1rem;
  font-weight: 600;
}

.hint-box {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #1e3a8a;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.source-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
}

.source-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.source-card .source-desc {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.source-card .err-line {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--danger);
}

.alert-list {
  margin: 0;
  padding-left: 1.2rem;
}

.alert-list li {
  margin-bottom: 0.35rem;
}

.data-table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

.confidence-high {
  color: var(--danger);
  font-weight: 600;
}

.confidence-medium {
  color: var(--warn);
  font-weight: 600;
}

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

details.tech {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

details.tech summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}

details.tech pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.72rem;
  line-height: 1.45;
}

.site-footer {
  max-width: 920px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.35rem 0;
}

code {
  font-size: 0.85em;
  background: var(--surface-muted);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.empty-state {
  padding: 0.75rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }
  .panel {
    padding: 1rem;
  }
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.auth-form label {
  font-weight: 500;
  font-size: 0.9rem;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.inline-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form label {
  flex: 1 1 160px;
}

.hidden {
  display: none !important;
}

.mint-banner {
  border: 2px solid var(--warn);
  background: var(--warn-bg);
}

.mint-key {
  word-break: break-all;
  background: var(--surface);
  padding: 1rem;
  border-radius: 8px;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

.key-row {
  margin-bottom: 0.35rem;
}
