:root {
  --bg-1: #f2f6f3;
  --bg-2: #e4ece9;
  --ink: #14201a;
  --muted: #4f6258;
  --card: rgba(255, 255, 255, 0.78);
  --stroke: rgba(20, 32, 26, 0.12);
  --brand: #0f766e;
  --brand-strong: #0b5a54;
  --warn: #b45309;
  --danger: #b42318;
  --ok: #0f7a37;
  --shadow: 0 18px 48px rgba(20, 32, 26, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #f7fbf9 0%, transparent 45%),
    radial-gradient(circle at 90% 8%, #e8f4f1 0%, transparent 42%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.shell {
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
  padding: 34px 0 42px;
  display: grid;
  gap: 18px;
}

.hero {
  display: grid;
  gap: 10px;
  animation: rise 0.48s ease;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 0.98;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
  font-size: 18px;
}

.composer,
.workspace,
.stats,
.access-panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.composer {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  padding: 16px;
  animation: rise 0.55s ease;
}

.access-panel {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  animation: rise 0.58s ease;
}

.job-form {
  display: grid;
  gap: 11px;
}

.field-row {
  display: grid;
  gap: 6px;
}

label {
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 12px;
  color: var(--ink);
}

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

input:focus,
textarea:focus {
  border-color: color-mix(in oklab, var(--brand), white 30%);
  outline: 2px solid color-mix(in oklab, var(--brand), white 74%);
  outline-offset: 1px;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

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

#submitBtn {
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.form-message {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.caps {
  border-left: 1px dashed var(--stroke);
  padding-left: 14px;
  display: flex;
  align-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.cap {
  border-radius: 999px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font-family: "IBM Plex Mono", monospace;
}

.cap.bad {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger), white 65%);
}

.cap.warn {
  color: var(--warn);
  border-color: color-mix(in oklab, var(--warn), white 65%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.stat {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.stat-value {
  font-weight: 700;
  font-size: 28px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 600px;
  overflow: hidden;
  animation: rise 0.62s ease;
}

.queue-pane {
  border-right: 1px solid var(--stroke);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--stroke);
}

.pane-head h2 {
  margin: 0;
  font-size: 18px;
}

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

.job-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.job-item {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 13px;
  padding: 11px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.job-open {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  display: grid;
  gap: 6px;
}

.job-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.job-item.active {
  border-color: color-mix(in oklab, var(--brand), white 48%);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand), white 78%);
}

.job-title {
  font-weight: 600;
  line-height: 1.25;
  font-size: 14px;
}

.job-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  border: 1px solid var(--stroke);
  background: #fff;
}

.chip.processing {
  color: var(--warn);
}

.chip.completed {
  color: var(--ok);
}

.chip.failed {
  color: var(--danger);
}

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

.ghost-danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger), white 70%);
}

.tiny {
  font-size: 12px;
  padding: 6px 10px;
}

.detail-pane {
  padding: 14px;
  overflow: auto;
}

.empty-state {
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  padding: 30px;
  color: var(--muted);
}

.detail-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-head h3 {
  margin: 0;
  font-size: 26px;
}

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

.section {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
}

.section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.section p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

pre {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.transcript {
  max-height: 340px;
  overflow: auto;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

  .caps {
    border-left: 0;
    border-top: 1px dashed var(--stroke);
    padding: 12px 0 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .queue-pane {
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
    max-height: 340px;
  }

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