:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #191f26;
  --panel-soft: #222a33;
  --line: #35404c;
  --text: #f4f7fb;
  --muted: #aeb8c5;
  --accent: #6ed6a9;
  --accent-strong: #2fbf8f;
  --warn: #f4bd63;
  --bad: #ef7e7e;
  --blue: #83b7ff;
}

* {
  box-sizing: border-box;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.fineprint,
.muted,
.subtitle {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  line-height: 1.45;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-pill,
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-pill.ok,
.badge.ready {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.badge.running {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
}

.badge.blocked {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 60%, var(--line));
}

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

.panel {
  min-height: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.run-panel,
.progress-panel {
  min-height: 360px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 14px;
}

.wide,
.actions {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

select,
input,
button {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
}

select,
input {
  padding: 0 11px;
}

input[type="file"] {
  padding: 9px 11px;
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.78;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#run-button {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #06110d;
}

.small-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.stack,
.job-list {
  display: grid;
  gap: 12px;
}

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

.item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 700;
}

.detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.progress {
  height: 10px;
  overflow: hidden;
  margin: 10px 0 12px;
  border-radius: 999px;
  background: #0d1117;
  border: 1px solid var(--line);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 180ms ease;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: #07120e;
  background: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.log {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 640px);
    padding: 18px 0;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid,
  .form-grid,
  .actions,
  .job-list {
    grid-template-columns: 1fr;
  }

  .wide-panel {
    grid-column: auto;
  }
}
