:root {
  --bg: #f4efe5;
  --card: #fffdf9;
  --ink: #1f1b16;
  --muted: #6f6458;
  --line: #d9ccbb;
  --accent: #6c2f19;
  --accent-soft: #efe1d4;
  --ok: #2f6b2f;
  --warn: #a06a00;
  --todo: #666;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, #f9f3ea 0, #f4efe5 45%, #ebe2d2 100%);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
}

.shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.shell.narrow {
  width: min(840px, 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

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

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(31, 27, 22, 0.06);
}

.card h2 {
  margin-top: 0;
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
}

.json,
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f1e8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
}

.jobs,
.events {
  display: grid;
  gap: 12px;
}

.job-row,
.event-row {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.prompt {
  margin-top: 6px;
  line-height: 1.4;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.badge.queued {
  background: #ece8e1;
  color: var(--todo);
}

.badge.running {
  background: #fff2cf;
  color: var(--warn);
}

.badge.succeeded {
  background: #dff2df;
  color: var(--ok);
}

.badge.failed {
  background: #f8d7d7;
  color: #8a1f1f;
}

.form-card {
  display: grid;
  gap: 14px;
}

.error-box {
  padding: 12px;
  border: 1px solid #d8a6a6;
  border-radius: 12px;
  background: #f9e1e1;
  color: #7a1e1e;
  font-weight: 600;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

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

  .topbar {
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }
}
