:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --ink: #1d2326;
  --muted: #667075;
  --line: #d8d4ca;
  --panel: #ffffff;
  --panel-soft: #faf9f5;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --coral: #ce5b45;
  --gold: #b48416;
  --shadow: 0 18px 45px rgba(29, 35, 38, 0.08);
}

* {
  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;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

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

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

h1 {
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

.server-pill {
  min-width: 138px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 9px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}

.server-pill.ready {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--teal-dark);
}

.server-pill.busy {
  border-color: rgba(180, 132, 22, 0.35);
  color: var(--gold);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.upload-panel,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
}

.field-label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.field-label input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field-label input:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.status-panel {
  padding: 20px;
}

.dropzone {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8b2a6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(206, 91, 69, 0.07)),
    var(--panel-soft);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.dropzone.dragging {
  border-color: var(--teal);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(206, 91, 69, 0.1)),
    var(--panel-soft);
}

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.dropzone-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.dropzone-copy strong {
  color: var(--ink);
  font-size: 22px;
}

.drop-icon {
  width: 46px;
  height: 46px;
  border: 2px solid var(--teal);
  border-radius: 8px;
  position: relative;
}

.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  background: var(--teal);
}

.drop-icon::before {
  width: 18px;
  height: 2px;
  left: 12px;
  top: 21px;
}

.drop-icon::after {
  width: 2px;
  height: 18px;
  left: 20px;
  top: 13px;
}

.file-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
  min-height: 0;
  margin-top: 14px;
}

.thumb {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.runtime-note {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

button,
.download-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary,
.download-button {
  background: var(--teal);
  color: #ffffff;
}

.primary:hover,
.download-button:hover {
  background: var(--teal-dark);
}

.secondary {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary:hover {
  border-color: #aca59a;
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 13px;
}

.notice {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 14px;
}

.meter {
  height: 8px;
  margin: 18px 0 18px;
  border-radius: 999px;
  background: #ece8df;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  transition: width 240ms ease;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 0;
}

.status-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

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

dd {
  margin: 5px 0 0;
  min-height: 22px;
  overflow-wrap: anywhere;
  font-weight: 720;
}

.download-row {
  margin-top: 16px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-grid a {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.preview-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.log-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14191b;
  color: #dfe7e4;
  overflow: hidden;
}

.log-box summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #ffffff;
  font-weight: 720;
}

.log-box pre {
  max-height: 280px;
  margin: 0;
  padding: 0 14px 14px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.log-actions {
  display: flex;
  margin-top: 10px;
}

.log-actions .download-button {
  min-height: 36px;
}

.examples-section,
.jobs-section,
.ack-section {
  margin-top: 28px;
}

.ack-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ack-section p {
  margin: 0;
}

.ack-section a {
  color: var(--teal-dark);
  font-weight: 720;
}

.example-list,
.job-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.example-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  align-items: start;
}

.job-list {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.example-card,
.job-item {
  height: auto;
  display: grid;
  align-items: start;
  justify-items: start;
  justify-content: stretch;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.example-card {
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.job-item {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.job-select {
  width: 100%;
  min-height: 0;
  display: grid;
  align-items: start;
  justify-items: start;
  justify-content: stretch;
  gap: 4px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  padding: 12px 48px 12px 12px;
  font-weight: inherit;
  text-align: left;
  white-space: normal;
}

.job-select:hover {
  background: rgba(15, 118, 110, 0.05);
}

.job-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.job-delete:hover:not(:disabled) {
  border-color: rgba(206, 91, 69, 0.28);
  background: rgba(206, 91, 69, 0.1);
  color: var(--coral);
}

.job-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.example-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.example-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.example-previews {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.example-previews a {
  display: block;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.example-previews img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.example-actions {
  width: 100%;
  margin-top: 0;
}

.example-actions .download-button {
  width: 100%;
  min-width: 0;
  padding-block: 10px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.job-item.active {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: inset 3px 0 0 var(--teal);
}

.job-name {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 820;
}

.job-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.job-date {
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.job-stage {
  color: var(--muted);
  font-size: 13px;
}

.job-status {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.job-status.failed {
  color: var(--coral);
}

.job-status.running,
.job-status.queued {
  color: var(--gold);
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 22px, 680px);
    padding-top: 18px;
  }

  .topbar,
  .workspace,
  .status-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .server-pill {
    justify-self: start;
  }

  .dropzone {
    min-height: 210px;
  }
}
