:root {
  --bg: #f5f8ff;
  --panel: #ffffff;
  --panel-2: #f0f4ff;
  --accent: #0ea5e9;
  --accent-2: #f97316;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --good: #16a34a;
  --warn: #d97706;
  --danger: #ef4444;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 12% 20%, rgba(14, 165, 233, 0.18), transparent 28%),
              radial-gradient(circle at 85% 20%, rgba(249, 115, 22, 0.16), transparent 28%),
              linear-gradient(135deg, #f5f8ff, #eef2ff 50%, #f8fbff);
  color: var(--text);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

h1 {
  margin: 8px 0 12px;
  font-size: 36px;
}

h3 { margin: 0; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--accent-2);
}

.lede {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

label span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, button, textarea {
  font: inherit;
  color: var(--text);
}

input, select {
  width: 100%;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
}

button {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0b11;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover { box-shadow: 0 6px 22px rgba(34, 211, 238, 0.25); }
button:active { transform: translateY(1px); }

.actions { display: flex; align-items: center; gap: 10px; }

.status { margin: 0; color: var(--muted); font-size: 14px; }

.meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.label { color: var(--muted); margin: 0; font-size: 13px; }
.value { margin: 6px 0 0; font-weight: 600; }

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

.select-group { display: flex; align-items: end; gap: 10px; }

.pill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.pill-list li {
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.ref-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.commit-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.commit {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.commit:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.commit h4 { margin: 0 0 6px; font-size: 16px; }
.commit .meta { color: var(--muted); font-size: 13px; margin: 0; }
.commit .sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--accent-2); margin: 4px 0 0; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  background: var(--accent-2);
}
.badge.warn { background: #fed7aa; color: #9a3412; }

.inline { display: flex; gap: 10px; align-items: center; }
.inline input { width: 240px; }

#detail-body {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-height: 140px;
  line-height: 1.5;
}

.diff-files {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-files li {
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.diff-files .file-name { font-weight: 600; margin: 0 0 6px; }
.diff-files .stats { color: var(--muted); font-size: 13px; margin: 0; }

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
}

.pill-label { margin: 0; color: var(--muted); font-size: 12px; }
.pill-value { margin: 0; font-weight: 600; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
  box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.15);
}

#status.good { color: var(--good); }
#status.warn { color: var(--warn); }
#status.danger { color: var(--danger); }

@media (max-width: 800px) {
  header { flex-direction: column; }
  .inline { width: 100%; }
  .inline input { width: 100%; }
}
