:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #15181d;
  --muted: #6f7782;
  --quiet: #9aa3ad;
  --line: #dde3ea;
  --line-strong: #c8d0d9;
  --nav: #15181d;
  --nav-soft: #20242b;
  --accent: #ef5a35;
  --accent-dark: #d54825;
  --teal: #147c7e;
  --blue: #2c5f93;
  --green: #16875b;
  --red: #bd3429;
  --shadow: 0 16px 40px rgba(22, 27, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f8fa 0, #f3f5f8 310px),
    var(--bg);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 16%, rgba(20, 124, 126, 0.12), transparent 30%),
    radial-gradient(circle at 80% 74%, rgba(239, 90, 53, 0.12), transparent 28%),
    #eef2f6;
}

.login-panel {
  width: min(410px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  padding: 38px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  font-size: 23px;
  margin: 18px 0 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff7a4f);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(239, 90, 53, 0.26);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  font-size: 17px;
  box-shadow: none;
}

.login-panel label,
.field-grid label,
.form-area > label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #3d4249;
}

.login-panel input,
input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 12px 13px;
  background: #fff;
  color: #202327;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 124, 126, 0.1);
}

.login-panel button,
.primary-action {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  padding: 13px 18px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(239, 90, 53, 0.18);
}

.login-panel button {
  width: 100%;
  margin-top: 20px;
}

.login-panel button:hover,
.primary-action:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.primary-action:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: #fff;
  padding: 24px 16px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 10px 30px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand span {
  font-size: 12px;
  color: #a7afb8;
  margin-top: 3px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #b2bac4;
  text-align: left;
  padding: 13px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  gap: 11px;
  align-items: center;
}

.nav-item span {
  min-width: 20px;
  font-size: 11px;
  color: #7f8994;
}

.nav-item:hover {
  background: var(--nav-soft);
  color: #fff;
}

.nav-item.active {
  background: #2a2f37;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.active span {
  color: #ff8a68;
}

.server-state {
  margin-top: auto;
  color: #a5adb7;
  font-size: 12px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.server-state i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37c98b;
  margin-right: 8px;
  box-shadow: 0 0 0 4px rgba(55, 201, 139, 0.12);
}

main {
  grid-column: 2;
  padding: 0 34px 50px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.eyebrow {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 7px;
}

header h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 12px;
  color: var(--green);
  background: #eaf7f1;
  border: 1px solid #cce9dc;
  padding: 8px 11px;
  border-radius: 6px;
  white-space: nowrap;
}

.billing-status {
  font-size: 12px;
  color: #245f49;
  background: #eaf7f1;
  border: 1px solid #cce9dc;
  padding: 8px 11px;
  border-radius: 6px;
  white-space: nowrap;
}

.billing-status.billing-error {
  color: #8b3128;
  background: #fff0ed;
  border-color: #f0c2b8;
}

.workspace-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #b9d5e5;
  background: #f3fbff;
  color: #17627c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.workspace-switch:hover {
  border-color: #78b4d2;
  background: #e9f7ff;
  color: #0f5168;
}

.billing-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.billing-note.billing-error {
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.form-area,
.run-panel,
#jobs {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(22, 27, 34, 0.04);
}

.form-area {
  padding: 28px;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
}

.section-title:not(:first-child) {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #eef1f4;
}

.section-title > span {
  width: 30px;
  height: 30px;
  background: #20242a;
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.section-title h3,
.section-title p {
  margin: 0;
}

.section-title h3 {
  font-size: 16px;
}

.section-title p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upload-box {
  min-height: 196px;
  border: 1px dashed #b9c2cc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.92)),
    var(--panel-soft);
}

.upload-box:hover {
  border-color: var(--teal);
  background: #fbfdfd;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-box img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f6f8;
}

.upload-box.has-image img {
  display: block;
}

.upload-box.has-image span,
.upload-box.has-image strong,
.upload-box.has-image small {
  display: none;
}

.upload-icon {
  font-size: 30px;
  color: #6f7884;
}

.upload-box strong {
  font-size: 15px;
}

.upload-box small {
  font-size: 12px;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field-grid.three {
  grid-template-columns: repeat(4, 1fr);
}

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

.top-gap {
  margin-top: 16px;
}

.run-panel {
  padding: 22px;
  position: sticky;
  top: 24px;
}

.run-panel h3 {
  font-size: 16px;
  margin: 0 0 18px;
}

.run-panel ol {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.run-panel li {
  counter-increment: steps;
  padding: 12px 0 12px 38px;
  border-bottom: 1px solid #edf0f3;
  font-size: 13px;
  position: relative;
  color: #4a5159;
}

.run-panel li:before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 9px;
  width: 24px;
  height: 24px;
  border: 1px solid #c9d1da;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--blue);
  background: #fff;
}

.primary-action {
  width: 100%;
}

.cost-note {
  text-align: center;
  color: #8b939e;
  font-size: 12px;
  margin: 12px 0 0;
  line-height: 1.5;
}

.project2-side-progress {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #d9e8ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  overflow: hidden;
}

.side-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.side-progress-top span {
  color: #1677ff;
  font-weight: 800;
}

.side-progress-bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7eef7;
}

.side-progress-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #41c6ff);
  transition: width 0.5s ease;
}

.project2-side-progress p {
  margin: 10px 0 0;
  color: #687282;
  font-size: 12px;
  line-height: 1.5;
}

.project2-progress-panel,
.project2-history-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 22px;
  border: 1px solid #dde4ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(19, 31, 51, 0.08);
  overflow: hidden;
}

.project2-progress-head,
.project2-history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.project2-progress-head h3,
.project2-history-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.project2-progress-head p,
.project2-progress-head span,
.project2-history-head p {
  margin: 0;
  color: #687282;
  font-size: 13px;
}

.project2-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.project2-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid #e3e9f0;
  border-radius: 12px;
  background: #f9fbfd;
  min-width: 0;
}

.project2-step:before {
  content: "";
  position: absolute;
  top: 31px;
  left: -14px;
  width: 14px;
  height: 2px;
  background: #dbe3ec;
}

.project2-step:first-child:before {
  display: none;
}

.project2-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef3f8;
  color: #607086;
  font-weight: 800;
}

.project2-step.running {
  border-color: #5aa9ff;
  background: #f4f9ff;
}

.project2-step.running .project2-step-dot {
  background: #1677ff;
  color: #fff;
}

.project2-step.complete {
  border-color: #bfe7d2;
  background: #f5fff8;
}

.project2-step.complete .project2-step-dot {
  background: #16a365;
  color: #fff;
}

.project2-step.failed {
  border-color: #f3b5b5;
  background: #fff7f7;
}

.project2-step.failed .project2-step-dot {
  background: #d93025;
  color: #fff;
}

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

.project2-step h4 {
  margin: 0;
  font-size: 14px;
}

.project2-step-top span,
.project2-step p {
  color: #687282;
  font-size: 12px;
}

.project2-step p {
  margin: 8px 0 12px;
  line-height: 1.5;
}

.project2-step-empty,
.project2-history-empty {
  padding: 12px;
  border: 1px dashed #d8e0e8;
  border-radius: 10px;
  text-align: center;
  color: #8a96a8 !important;
  background: #fff;
}

.project2-step-results,
.project2-history-results {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  min-width: 0;
}

.project2-output-card {
  flex: 0 0 150px;
}

.project2-output-card b {
  display: block;
  margin-bottom: 6px;
  color: #20242a;
  font-size: 12px;
}

.project2-output-card img,
.project2-output-card video {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef2f6;
}

.project2-output-card a {
  display: block;
  margin-top: 6px;
  color: #1368d8;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

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

.project2-history-item {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid #e4eaf1;
  border-radius: 12px;
  background: #fbfcfe;
}

.project2-history-item.complete {
  border-color: #bee8d3;
  background: #f8fffb;
}

.project2-history-item.failed {
  border-color: #f0b7b7;
  background: #fff8f8;
}

.project2-history-info span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: #607086;
  font-size: 12px;
  font-weight: 700;
}

.project2-history-info strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.project2-history-info p {
  margin: 0;
  color: #687282;
  font-size: 12px;
  line-height: 1.5;
}

#jobs {
  padding: 24px;
}

.jobs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.jobs-header h3 {
  margin: 0;
  font-size: 20px;
}

.jobs-header button,
.project4-side button {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 8px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.jobs-header button:hover,
.project4-side button:hover {
  border-color: #8e98a5;
  color: var(--accent-dark);
}

.jobs-list {
  display: grid;
  gap: 14px;
}

.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.job-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.job-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.job-type {
  font-size: 11px;
  color: var(--muted);
}

.job-name {
  font-size: 16px;
  margin: 4px 0;
}

.job-state {
  font-size: 12px;
  padding: 5px 8px;
  background: #f0f2f4;
  border-radius: 5px;
  white-space: nowrap;
}

.progress {
  height: 4px;
  background: #eceff2;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 99px;
}

.progress i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--accent);
  animation: load 1.8s ease-in-out infinite;
}

.job-card.done .progress i {
  width: 100%;
  animation: none;
  background: var(--green);
}

.job-card.failed .progress i {
  width: 100%;
  animation: none;
  background: var(--red);
}

.job-message {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.results,
.stage-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.result-item,
.stage-result {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px;
  border-radius: 7px;
}

.result-item img,
.result-item video,
.stage-result img,
.stage-result video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #111418;
  border-radius: 4px;
}

.result-item video,
.stage-result video {
  aspect-ratio: 9 / 16;
  max-height: 430px;
}

.result-item a,
.stage-result a {
  display: block;
  text-align: center;
  color: #30363d;
  font-size: 12px;
  text-decoration: none;
  padding: 8px 3px 2px;
}

.result-item a:hover,
.stage-result a:hover {
  color: var(--accent-dark);
}

.maintenance-view .project4-layout {
  display: none;
}

.maintenance-card {
  max-width: 760px;
  margin: 48px auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.maintenance-card span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 6px;
  background: #fff3ed;
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

.maintenance-card h2 {
  margin: 18px 0 10px;
  font-size: 28px;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
}

.project1-records {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.project-record-list,
.stage-list {
  display: grid;
  gap: 14px;
}

.stage-list.compact {
  grid-column: 1 / -1;
}

.project-record-card,
.stage-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.record-card-head,
.stage-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-card-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.record-card-head h4 {
  margin: 0;
}

.record-card-head span,
.stage-row.complete .stage-row-head span {
  color: #059669;
  font-size: 13px;
  font-weight: 800;
}

.stage-row-head span {
  color: var(--muted);
  font-size: 12px;
}

.stage-row.failed .stage-row-head span,
.record-error {
  color: #dc2626;
}

.record-error {
  margin: 12px 0;
  font-size: 13px;
}

.stage-progress {
  height: 6px;
  margin: 10px 0;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.stage-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.stage-output img,
.stage-output video {
  max-width: 280px;
  max-height: 220px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.stage-text {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  background: #111827;
  color: #f9fafb;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
}

.download-link,
.stage-output a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

@keyframes load {
  0% {
    transform: translateX(-100%);
    width: 30%;
  }
  50% {
    width: 55%;
  }
  100% {
    transform: translateX(330%);
    width: 30%;
  }
}

.project4-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.project4-main {
  display: grid;
  gap: 18px;
}

.stage-card,
.project4-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(22, 27, 34, 0.04);
}

.stage-card {
  padding: 24px;
  transition: border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.stage-card.locked {
  opacity: 0.56;
}

.stage-card.busy {
  border-color: #e7a590;
  box-shadow: 0 8px 28px rgba(239, 90, 53, 0.08);
}

.stage-card.complete {
  border-color: #b9ddcf;
}

.stage-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.stage-head > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #20242a;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.stage-head h3,
.stage-head p {
  margin: 0;
}

.stage-head h3 {
  font-size: 17px;
}

.stage-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stage-state {
  font-size: 11px;
  color: #717982;
  background: #f0f2f4;
  padding: 6px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.complete .stage-state {
  color: var(--green);
  background: #eaf7f1;
}

.busy .stage-state {
  color: #b04b2e;
  background: #fff0eb;
}

.video-upload {
  min-height: 260px;
}

.video-upload video {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101214;
}

.video-upload.has-video video {
  display: block;
}

.video-upload.has-video span,
.video-upload.has-video strong,
.video-upload.has-video small {
  display: none;
}

.stage-action {
  border: 0;
  background: #23272d;
  color: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 16px;
  font-weight: 750;
  cursor: pointer;
}

.stage-action:hover {
  background: #111418;
  transform: translateY(-1px);
}

.stage-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.stage-action.danger {
  background: var(--accent);
  box-shadow: 0 10px 18px rgba(239, 90, 53, 0.16);
}

.stage-action.danger:hover {
  background: var(--accent-dark);
}

.script-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
}

.script-field textarea {
  font-weight: 400;
  min-height: 220px;
}

.cost-warning {
  margin-top: 16px;
  padding: 11px 13px;
  background: #fff5ec;
  border-left: 3px solid var(--accent);
  color: #75402f;
  font-size: 12px;
  line-height: 1.6;
}

.project4-side {
  position: sticky;
  top: 24px;
  padding: 20px;
}

.project4-side h3 {
  font-size: 16px;
  margin: 0 0 16px;
}

.project4-side ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project4-side li {
  position: relative;
  padding: 12px 0 12px 32px;
  border-bottom: 1px solid #eef1f4;
  font-size: 12px;
  color: #777f89;
}

.project4-side li:before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 14px;
  height: 14px;
  border: 1px solid #bfc7d0;
  border-radius: 50%;
  background: #fff;
}

.project4-side li.active {
  color: #20242a;
  font-weight: 750;
}

.project4-side li.active:before {
  border: 4px solid var(--accent);
}

.project4-side li.done {
  color: var(--green);
}

.project4-side li.done:before {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #fff;
}

.project4-side p {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 18px 0;
  line-height: 1.5;
}

.project4-side button {
  width: 100%;
}

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

  .sidebar {
    width: 86px;
    padding: 18px 10px;
  }

  .brand {
    justify-content: center;
    padding: 4px 0 24px;
  }

  .brand > div:last-child,
  .nav-item:not(.active) {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 12px 8px;
  }

  .nav-item.active {
    font-size: 0;
  }

  .nav-item span {
    font-size: 11px;
    min-width: auto;
  }

  .server-state {
    display: none;
  }

  main {
    grid-column: 2;
    padding: 0 20px 42px;
  }

  .workspace,
  .project4-layout {
    grid-template-columns: 1fr;
  }

  .run-panel,
  .project4-side {
    position: static;
  }

  .project4-side {
    order: -1;
  }

  .project4-side ol {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .project4-side li {
    border-bottom: 0;
    padding: 30px 6px 6px;
    text-align: center;
  }

  .project4-side li:before {
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
  }

  .field-grid.three {
    grid-template-columns: 1fr 1fr;
  }

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

  .project2-history-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px;
    flex-direction: row;
    align-items: center;
  }

  .brand {
    padding: 0;
  }

  .sidebar nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
  }

  .brand > div:last-child,
  .nav-item {
    font-size: 0;
  }

  .nav-item span {
    font-size: 10px;
  }

  main {
    padding: 0 12px 30px;
  }

  header {
    min-height: 86px;
  }

  header h2 {
    font-size: 21px;
  }

  .workspace {
    display: block;
  }

  .run-panel {
    margin-top: 14px;
    position: static;
  }

  .upload-grid,
  .field-grid,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .upload-box {
    min-height: 164px;
  }

  .form-area,
  .stage-card {
    padding: 18px;
  }

  .stage-head {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .stage-state {
    grid-column: 2;
    justify-self: start;
  }

  .project4-side ol {
    grid-template-columns: 1fr 1fr;
  }

  .stage-results,
  .results {
    grid-template-columns: 1fr;
  }

  .project2-progress-head,
  .project2-history-head {
    display: grid;
  }

  .project2-progress-steps {
    grid-template-columns: 1fr;
  }

  .project2-step:before {
    display: none;
  }
}
