:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b2330;
  --line: #26303d;
  --text: #e6edf3;
  --muted: #8b98a7;
  --accent: #4c9aff;
  --accent-2: #1f6feb;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

code, pre, input, select, textarea, button { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.brand .logo { color: var(--accent); margin-right: 6px; }
.muted { color: var(--muted); font-weight: 400; }

.status { font-size: 12px; color: var(--muted); text-align: right; max-width: 55%; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.status.warn { color: var(--warn); }

main { padding: 22px; max-width: 1220px; margin: 0 auto; display: grid; gap: 16px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 22px 0;
  max-width: 1220px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--panel); border-color: var(--line); }

.providers { display: grid; gap: 12px; margin-bottom: 14px; }

.provider {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.provider.active { border-color: var(--accent); }

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

.provider .head strong { font-size: 13px; }
.provider .badge.ok { color: var(--ok); border-color: var(--ok); }

.flash {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
}

.flash.bad { border-color: var(--bad); color: var(--bad); }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.warn { border-color: var(--warn); color: var(--warn); }

.build-status { min-height: 18px; margin: 8px 0 4px; }
.build-status.bad { color: var(--bad); }
.build-status.ok { color: var(--ok); }
.req { color: var(--warn); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.panel h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }

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

.row { display: flex; gap: 12px; }
.row > label { flex: 1; }

label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
label.check input { width: auto; margin: 0; }

button {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

button:hover { border-color: var(--accent); }
button.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
button.primary:hover { background: var(--accent); }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.actions.tight { margin: 0 0 10px; }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 6px 8px; border-bottom: 1px solid var(--panel-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }

.output {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.releases { display: grid; gap: 8px; }
.release {
  display: grid;
  grid-template-columns: 90px 90px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.release .tag { color: var(--accent); font-weight: 600; }
.release .sha { color: var(--muted); font-family: ui-monospace, monospace; }
.release .notes { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Second line inside a job row: progress bar + phase text. */
.release-sub {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.release-sub .progress { flex: 0 0 180px; }
.release-sub .notes { flex: 1; }

/* Build progress (data comes from jobs/<id>/progress.json via the API). */
.progress {
  display: block;
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .4s ease;
}
.progress.ok i { background: var(--ok); }
.progress.bad i { background: var(--bad); }
.progress.indeterminate i {
  width: 35% !important;
  animation: progress-slide 1.4s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .progress i { transition: none; }
  .progress.indeterminate i { animation: none; margin-left: 0; }
}
.progress-card { display: grid; gap: 6px; margin-bottom: 10px; }
.progress-card .progress { height: 10px; }
.progress-card .hint { margin: 0; }
.progress-card.bad .progress i { background: var(--bad); }
.progress-card.ok .progress i { background: var(--ok); }

.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--bad); border-color: var(--bad); }

.footer { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; padding: 4px 4px 26px; flex-wrap: wrap; }
.footer code { color: var(--text); }
