:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5f6b82;
  --line: #d7dce6;
  --accent: #2d6cdf;
  --accent-soft: #eaf1ff;
  --good: #0b7a3b;
  --bad: #b3261e;
  --warn: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h1,
.band h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.topbar p,
.muted {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.chip {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.layout {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

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

.wide-band {
  overflow: hidden;
}

.band-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .wide,
.actions.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 3rem;
}

textarea:disabled {
  background: #f2f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  width: fit-content;
}

.checkbox-line input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.97);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.separated {
  margin-top: 1rem;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mini-button {
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.mini-button.danger {
  border-color: #f1b8b4;
  color: var(--bad);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: #fff;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  background: #f8fafc;
  color: var(--muted);
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: #f7fbff;
}

.state-queued {
  color: var(--warn);
}

.state-running {
  color: var(--accent);
}

.state-succeeded,
.state-complete {
  color: var(--good);
}

.state-failed,
.state-cancelled {
  color: var(--bad);
}

#detail {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  min-height: 12rem;
  font-size: 0.88rem;
}

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

  table {
    min-width: 720px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
