.auto-open {
  margin-top: 10px;
}
.auto-detail {
  margin-top: 18px;
}
#auto-model-dialog,
#generated-dialog {
  padding: 0;
  width: min(1020px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid #425349;
  border-radius: 20px;
  background: #141c19;
  color: #eaf4e8;
}
#auto-model-dialog[open],
#generated-dialog[open] {
  display: flex;
  flex-direction: column;
}
#auto-model-dialog::backdrop,
#generated-dialog::backdrop {
  background: #050a09cf;
  backdrop-filter: blur(8px);
}
.auto-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 30px;
  background: linear-gradient(120deg, #283729, #182320);
  border-bottom: 1px solid #35463b;
  flex: none;
}
.auto-head > div {
  min-width: 0;
}
.auto-head h2 {
  font-size: 27px;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.auto-head > button {
  flex: none;
}
.auto-body {
  padding: 24px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}
.auto-services {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.auto-services span {
  border: 1px solid #62553b;
  background: #29261d;
  color: #e4c689;
  border-radius: 30px;
  padding: 9px 13px;
  font-size: 12px;
}
.auto-services .connected {
  background: #273b25;
  border-color: #587847;
  color: #b9f978;
}
#auto-settings {
  padding: 16px 18px;
  border: 1px solid #39473e;
  border-radius: 12px;
}
#auto-settings summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.auto-key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.auto-key-grid label,
.auto-start > label,
.auto-recover label {
  display: grid;
  gap: 9px;
  font-size: 12px;
  color: #c1cdbf;
}
.auto-key-grid input,
.auto-start select,
.auto-recover input {
  background: #101713;
  color: #eaf4e8;
  border: 1px solid #465842;
  padding: 12px;
  border-radius: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.auto-start {
  padding: 24px 0;
  border-bottom: 1px solid #344037;
}
.auto-start select {
  margin-top: 10px;
}
.auto-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.auto-actions a {
  font-size: 12px;
}
.auto-message {
  color: #f1c28a;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.auto-steps {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #a3b498;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 14px 0 20px;
}
.auto-job {
  padding: 22px;
  border: 1px solid #3b493d;
  border-radius: 14px;
  background: linear-gradient(120deg, #1c271f, #18211e);
  margin-bottom: 16px;
}
.auto-job-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.auto-job h3 {
  margin: 7px 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.auto-job progress {
  width: 100%;
  height: 7px;
  accent-color: #b9f978;
}
.auto-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.auto-photos figure {
  margin: 0;
  background: #f2f4f0;
  border-radius: 10px;
  overflow: hidden;
}
.auto-photos img {
  width: 100%;
  height: 145px;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
}
.auto-photos figcaption {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #243128;
  font-size: 10px;
  color: #c2d0c0;
}
.auto-photos a {
  color: #b9f978;
}
.auto-empty {
  text-align: center;
  padding: 44px 20px;
  color: #9bab9d;
}
.auto-empty > span {
  font-size: 45px;
  color: #b9f978;
}
.auto-empty h3 {
  color: #ecf3e9;
}
.auto-empty p {
  max-width: 440px;
  margin: auto;
  line-height: 1.7;
  font-size: 13px;
}
.auto-recover {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}
.auto-recover label {
  flex: 1;
}
.generated-stage {
  position: relative;
  min-height: 240px;
  height: min(55vh, 550px);
  flex: none;
}
.generated-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.generated-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  padding: 15px 24px;
  font-size: 12px;
  border-top: 1px solid #344037;
}
.generated-note {
  margin: 0;
  padding: 0 24px 22px;
}
.generated-loading {
  position: absolute;
  inset: 40% 20px auto;
  text-align: center;
  padding: 15px;
  background: #14221ee8;
  border-radius: 10px;
}
#generated-dialog {
  overflow-y: auto;
}
@media (max-width: 650px) {
  #auto-model-dialog,
  #generated-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 14px;
  }
  .auto-head {
    padding: 18px;
    gap: 12px;
  }
  .auto-head h2 {
    font-size: 21px;
  }
  .auto-body {
    padding: 18px;
  }
  .auto-key-grid {
    grid-template-columns: 1fr;
  }
  .auto-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auto-photos img {
    height: 125px;
  }
  .auto-steps {
    font-size: 9px;
  }
  .auto-job {
    padding: 15px;
  }
  .auto-recover {
    flex-direction: column;
    align-items: stretch;
  }
  .auto-actions > button {
    max-width: 100%;
  }
}

.auto-free-note {
  padding: 18px;
  border: 1px solid #46633c;
  background: #21331f;
  border-radius: 12px;
}
.auto-source-label {
  margin-top: 18px;
}
#auto-source {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #465842;
  background: #101713;
  color: #eaf4e8;
  border-radius: 8px;
}

#auto-queue-progress {
  width: 100%;
  height: 8px;
  accent-color: #b9f978;
}
#auto-queue-status {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.auto-free-note {
  margin-bottom: 20px;
}
