:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #17191f;
  --muted: #68707f;
  --line: #d9dde5;
  --panel: #ffffff;
  --accent: #176b87;
  --accent-strong: #0e4d64;
  --ok: #167245;
  --warn: #9a5d00;
  --bad: #a42b2b;
}

* {
  box-sizing: border-box;
}

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

.shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.composer {
  grid-row: 1 / span 2;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.transform-form {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.transform-form h2 {
  font-size: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 230px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.14);
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 0 14px;
}

button[type="button"] {
  background: #fff;
  color: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.gallery,
.activity {
  padding: 28px;
}

.activity {
  border-top: 1px solid var(--line);
}

.gallery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

#mcp-url {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.jobs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.events {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.event strong {
  font-size: 13px;
  line-height: 1.35;
}

.event code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.event .detail {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event .time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.job {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.job img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1f5;
}

.placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f2f4f7;
  font-size: 13px;
}

.job h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.status.succeeded {
  background: #e5f5ed;
  color: var(--ok);
}

.status.failed,
.status.timed_out {
  background: #fde9e9;
  color: var(--bad);
}

.status.running,
.status.queued {
  background: #fff3d8;
  color: var(--warn);
}

.job p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress {
  display: grid;
  gap: 6px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.progress-row.muted {
  color: var(--muted);
  font-weight: 600;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 12px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4c9a7b);
  transition: width 0.4s ease;
}

details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  padding: 8px 10px;
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
}

pre {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.links a,
.links button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}

.links a {
  border: 1px solid var(--line);
  color: var(--accent-strong);
  padding: 0 10px;
}

.links button {
  padding: 0 10px;
}

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

  .composer {
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .event {
    grid-template-columns: 1fr;
  }
}
