.dialog {
  width: 610px;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  box-shadow: 0 24px 64px #1018281f;
}
.dialog::backdrop {
  background: #10182866;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.dialog-heading h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
}
.close-button {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 0;
  padding: 0;
  line-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.close-button::before {
  z-index: 1;
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6472' stroke-width='1.65' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
.close-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.assets-dialog {
  width: 960px;
}
.assets-dialog .assets-grid {
  margin-top: 22px;
}
.templates-dialog {
  width: 980px;
}
.director-orbit {
  height: 106px;
  width: 106px;
  position: relative;
  margin: 30px auto 25px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.director-orbit span {
  font-size: 34px;
}
.director-orbit i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: director-turn 4s linear infinite;
}
.director-orbit i:nth-child(2) {
  inset: 13px;
  animation-direction: reverse;
  animation-duration: 6s;
}
#making {
  text-align: center;
}
#making h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
#task-explanation {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  margin: 12px auto 24px;
  max-width: 420px;
}
progress {
  display: block;
  width: 100%;
  height: 7px;
  appearance: none;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2);
  accent-color: var(--accent);
}
progress::-webkit-progress-bar {
  background: var(--surface-2);
}
progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 13px;
  margin: 10px 0 22px;
}
#cancel-task {
  margin-bottom: 5px;
  font-size: 13px;
}
#result-video {
  display: block;
  width: 100%;
  max-height: 62dvh;
  border-radius: 8px;
  background: #171b22;
}
#result-cover {
  display: block;
  width: 100%;
  max-height: 60dvh;
  object-fit: contain;
  border-radius: 8px;
}
#delivery-details {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
#delivery-details summary {
  cursor: pointer;
}
#delivery-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow: auto;
  padding: 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  line-height: 1.9;
}
#detail-files {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 7px;
}
#detail-files a {
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.again-button {
  width: 100%;
  margin-top: 24px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--accent);
  font-size: 13px;
}
.again-button:hover {
  background: var(--accent-soft);
}
.task-error {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #ddbcb7;
  border-radius: 8px;
  background: #fdf6f5;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.9;
}
#text-result {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.9;
}
@keyframes director-turn {
  to {
    transform: rotate(360deg);
  }
}

.close-button::after { content: ""; position: absolute; width: 28px; height: 28px; top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 6px; background: #f3f5f8; }
.close-button:hover::after { background: #e9edf2; }

.revision-dialog > .text-button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 8px;
}
