:root {
  color: #202124;
  background: #f5f6f7;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(21, 112, 239, 0.22);
  outline-offset: 1px;
}

.app-header {
  min-height: 88px;
  padding: 18px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #ffffff;
  border-bottom: 1px solid #dfe2e5;
}

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

h1 {
  font-size: 22px;
  line-height: 1.35;
}

.app-header p,
.section-heading p {
  margin-top: 4px;
  color: #687076;
  font-size: 13px;
  line-height: 1.5;
}

.runtime-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #cad0d5;
  border-radius: 5px;
  color: #4f575e;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 650;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.config-section,
.results-section {
  padding: 0 0 30px;
}

.results-section {
  padding-top: 28px;
  border-top: 1px solid #dfe2e5;
}

.section-heading {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h2 {
  font-size: 17px;
  line-height: 1.4;
}

.section-heading code {
  color: #3d4850;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-wide {
  grid-column: span 2;
}

.field > span {
  color: #4f575e;
  font-size: 12px;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd0d5;
  border-radius: 5px;
  background: #ffffff;
  color: #202124;
  font-size: 13px;
}

.file-field input {
  padding: 5px 7px;
}

.command-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.button.primary {
  margin-left: auto;
  color: #ffffff;
  background: #1769d2;
  border-color: #1769d2;
}

.button.secondary {
  color: #252a2e;
  background: #ffffff;
  border-color: #cbd0d5;
}

.button:hover:not(:disabled) {
  filter: brightness(0.97);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.step-list {
  display: grid;
  gap: 12px;
}

.step {
  overflow: hidden;
  border: 1px solid #d9dde1;
  border-radius: 7px;
  background: #ffffff;
}

.step-header {
  min-height: 62px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e5e7e9;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #3f484f;
  font-size: 13px;
  font-weight: 750;
}

.step-title {
  min-width: 0;
}

.step-title h3 {
  margin-bottom: 3px;
  font-size: 14px;
}

.step-title code {
  display: block;
  overflow: hidden;
  color: #687076;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  width: 78px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
}

.status.idle {
  color: #687076;
  background: #f7f8f8;
  border-color: #d9dde1;
}

.status.running {
  color: #805300;
  background: #fff8e5;
  border-color: #e7ca7c;
}

.status.success {
  color: #166534;
  background: #edf8f0;
  border-color: #98d3aa;
}

.status.error {
  color: #a32424;
  background: #fff0f0;
  border-color: #edaaaa;
}

pre {
  min-height: 96px;
  max-height: 280px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #26323a;
  background: #fbfbfc;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: span 2;
  }

  .button.primary {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .app-header {
    align-items: flex-start;
  }

  main {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

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

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

  .command-bar .button {
    width: 100%;
  }

  .step-header {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .status {
    grid-column: 2;
  }
}
