:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #64748b;
  --line: #d8dee8;
  --panel: #ffffff;
  --page: #eef3f8;
  --teal: #0f766e;
  --blue: #2563eb;
  --red: #b42318;
  --amber: #b7791f;
  --green: #0f7a45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
}

.brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

.topbar nav {
  display: flex;
  gap: 18px;
}

.topbar nav a {
  color: #dbeafe;
  font-weight: 600;
}

.page {
  margin: 0 auto;
  max-width: 1240px;
  padding: 28px;
}

.layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.detail {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 22px;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 16px;
}

.panel-header h1,
.panel h2 {
  margin: 0;
}

.panel-header p,
.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

.split {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.one {
  margin-top: 16px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
}

.field input,
.field textarea,
.field select {
  background: #ffffff;
  border: 1px solid #bcc7d6;
  border-radius: 6px;
  color: var(--ink);
  display: block;
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.field textarea {
  resize: vertical;
}

.field small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.field-error input,
.field-error textarea,
.field-error select {
  border-color: var(--red);
}

.error {
  color: var(--red);
  font-weight: 700;
  margin-top: 6px;
}

.actions {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

button {
  background: var(--teal);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
}

button:hover {
  background: #115e59;
}

.task-list,
.artifact-list {
  display: grid;
  gap: 10px;
}

.task-row,
.artifact-list a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.task-row span,
.artifact-list span {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.artifact-list small {
  color: var(--muted);
  flex: 0 0 auto;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  padding: 5px 10px;
}

.status-queued {
  background: #e0f2fe;
  color: #075985;
}

.status-running {
  background: #fef3c7;
  color: #92400e;
}

.status-completed {
  background: #dcfce7;
  color: var(--green);
}

.status-failed {
  background: #fee2e2;
  color: var(--red);
}

.alert {
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.alert-error {
  background: #fee2e2;
  color: var(--red);
}

.alert-warning {
  background: #fef3c7;
  color: var(--amber);
}

.alert-success {
  background: #dcfce7;
  color: var(--green);
}

.meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.meta div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.prompt {
  background: #0f172a;
  border-radius: 6px;
  color: #e2e8f0;
  max-height: 440px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .layout,
  .grid.two,
  .meta {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
  }
}
