.face-swap-page-root {
  width: 100%;
  margin-top: calc(20px - var(--page-shell-top-padding));
}

.face-swap-page {
  --face-swap-panel: #151718;
  --face-swap-output: #1a1c1d;
  --face-swap-field: #202223;
  --face-swap-line: rgb(255 255 255 / 8%);
  --face-swap-muted: #a3a6a5;
  width: min(1220px, calc(100vw - 72px));
  margin: 0 auto 84px;
  color: var(--brand-text-primary);
  font-family: inherit;
  font-weight: 400;
}

.face-swap-page *,
.face-swap-page *::before,
.face-swap-page *::after {
  box-sizing: border-box;
}

.face-swap-page button,
.face-swap-page input,
.face-swap-page strong,
.face-swap-page b,
.face-swap-page em {
  font: inherit;
  font-weight: 400;
}

.face-swap-hero-copy {
  width: min(760px, 100%);
  margin: 0 auto 38px;
  text-align: center;
}

.face-swap-hero-copy h1,
.face-swap-hero-copy p {
  margin: 0;
}

.face-swap-hero-copy h1 {
  font-size: clamp(40px, 4.3vw, 64px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: .98;
}

.face-swap-hero-copy .face-swap-subtitle {
  max-width: 650px;
  margin: 18px auto 0;
  color: #a8abab;
  font-size: 16px;
  line-height: 1.55;
}

.face-swap-workstation {
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.face-swap-composer,
.face-swap-output {
  min-width: 0;
  border: 1px solid var(--face-swap-line);
  border-radius: 18px;
  background: var(--face-swap-panel);
  box-shadow: 0 24px 64px rgb(0 0 0 / 26%);
}

.face-swap-composer {
  display: flex;
  min-height: 900px;
  flex-direction: column;
  padding: 16px;
}

.face-swap-workflow {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.face-swap-upload-field {
  min-width: 0;
}

.face-swap-upload-field > header {
  margin: 0 0 10px;
}

.face-swap-upload-field h2,
.face-swap-upload-field p {
  margin: 0;
}

.face-swap-upload-field h2 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.face-swap-upload-field p {
  margin-top: 4px;
  color: var(--face-swap-muted);
  font-size: 11px;
  line-height: 1.45;
}

.face-swap-upload {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
  place-content: center;
  place-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgb(255 255 255 / 18%);
  border-radius: 12px;
  background: rgb(255 255 255 / 1.5%);
  color: var(--brand-text-primary);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.face-swap-upload.is-face {
  margin: 0;
}

.face-swap-upload:hover,
.face-swap-upload:focus-visible,
.face-swap-upload.is-dragging,
.face-swap-preview-card.is-dragging {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
  outline: none;
}

.face-swap-upload:focus-visible,
.face-swap-preview-header button:focus-visible,
.face-swap-mode button:focus-visible,
.face-swap-submit:focus-visible,
.face-swap-secondary:focus-visible,
.face-swap-primary-small:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.face-swap-upload:active {
  transform: scale(.985);
}

.face-swap-upload-icon,
.face-swap-result-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 7%);
  background: var(--face-swap-field);
  box-shadow: 0 5px 16px rgb(0 0 0 / 22%);
}

.face-swap-upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.face-swap-upload-icon img,
.face-swap-result-placeholder img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: .88;
}

.face-swap-upload-action {
  max-width: 104px;
  font-size: 12px;
  line-height: 1.35;
}

.face-swap-preview-card {
  display: grid;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--face-swap-line);
  border-radius: 12px;
  background: #101112;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.face-swap-preview-card.is-face {
  width: 100%;
  margin: 0;
}

.face-swap-preview-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #090a0a;
}

.face-swap-preview-card.is-face .face-swap-preview-stage {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.face-swap-preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-swap-preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080909;
}

.face-swap-preview-header {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.face-swap-preview-header small {
  min-width: 0;
  overflow: hidden;
  color: var(--face-swap-muted);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-swap-preview-header button {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--face-swap-line);
  border-radius: 7px;
  background: var(--face-swap-field);
  color: var(--brand-text-primary);
  cursor: pointer;
  font-size: 9px;
}

.face-swap-flow-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  align-self: center;
  margin: 8px 0;
}

.face-swap-flow-arrow img {
  width: 14px;
  height: 14px;
  filter: brightness(0) saturate(100%) invert(82%) sepia(89%) saturate(653%) hue-rotate(330deg) brightness(107%) contrast(104%);
  transform: rotate(90deg);
}

.face-swap-generation-row {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.face-swap-generation-row > span {
  color: var(--face-swap-muted);
  font-size: 11px;
  line-height: 1.35;
}

.face-swap-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--face-swap-field);
}

.face-swap-mode button {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--face-swap-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
}

.face-swap-mode button.is-active {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 7%, transparent);
  color: var(--brand-text-primary);
}

.face-swap-mode button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.face-swap-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.face-swap-settings label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--brand-text-primary);
  font-size: 11px;
  font-weight: 400;
}

.face-swap-settings small {
  min-height: 31px;
  margin: 0;
  color: var(--face-swap-muted);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.45;
}

.face-swap-settings input,
.face-swap-settings select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--face-swap-line);
  border-radius: 9px;
  background: var(--face-swap-field);
  color: var(--brand-text-primary);
  font: inherit;
  font-weight: 400;
}

.face-swap-settings input:focus-visible,
.face-swap-settings select:focus-visible {
  border-color: var(--brand-primary);
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 45%, transparent);
  outline-offset: 1px;
}

.face-swap-mode em {
  padding: 2px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  color: var(--brand-primary);
  font-size: 8px;
  font-style: normal;
}

.face-swap-status {
  margin: 10px 0 0;
  color: var(--face-swap-muted);
  font-size: 11px;
  line-height: 1.4;
}

.face-swap-status[hidden] {
  display: none;
}

.face-swap-page .face-swap-submit {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  padding: 0 72px 0 16px;
  border: .5px solid var(--brand-primary);
  border-radius: 13px;
  background: transparent;
  color: var(--brand-text-primary);
  cursor: pointer;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease;
}

.face-swap-page .face-swap-submit:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
  filter: brightness(1.035);
  transform: translateY(-1px);
}

.face-swap-page .face-swap-submit:active:not(:disabled) {
  transform: translateY(0) scale(.99);
}

.face-swap-page .face-swap-submit:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.face-swap-submit-label,
.face-swap-submit-cost {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.face-swap-submit-label {
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.face-swap-submit-label img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.face-swap-page .face-swap-submit-cost {
  position: absolute;
  right: 16px;
  gap: 4px;
  color: rgb(255 248 230 / 58%);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.face-swap-output {
  display: flex;
  min-height: 900px;
  overflow: hidden;
  flex-direction: column;
  padding: 0;
  background: #111213;
}

.face-swap-result {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 44%, #202223 0, var(--face-swap-output) 54%, #17191a 100%);
}

.face-swap-result.is-empty,
.face-swap-result.is-processing,
.face-swap-result.is-failed {
  flex-direction: column;
  padding: 28px;
  text-align: center;
}

.face-swap-result.is-failed .face-swap-result-placeholder {
  border-color: rgb(255 216 77 / 32%);
  background: rgb(255 216 77 / 8%);
}

.face-swap-result.is-failed .face-swap-result-placeholder img {
  filter: brightness(0) saturate(100%) invert(85%) sepia(88%) saturate(526%) hue-rotate(334deg) brightness(105%);
  opacity: 1;
}

.face-swap-result-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.face-swap-result-placeholder {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 14px;
}

.face-swap-result-placeholder img {
  width: 22px;
  height: 22px;
}

.face-swap-result strong {
  font-size: 18px;
  line-height: 1.3;
}

.face-swap-result small {
  max-width: 390px;
  margin-top: 8px;
  color: var(--face-swap-muted);
  font-size: 12px;
  line-height: 1.55;
}

.face-swap-result-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--face-swap-line);
  border-radius: 11px;
  background: rgb(12 13 14 / 86%);
  color: var(--face-swap-muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
}

.face-swap-result-hint img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%) invert(82%) sepia(89%) saturate(653%) hue-rotate(330deg) brightness(107%) contrast(104%);
}

.face-swap-result-image,
.face-swap-result-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080909;
}

.face-swap-result-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.face-swap-secondary,
.face-swap-primary-small {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
}

.face-swap-secondary {
  border: 1px solid rgb(255 255 255 / 14%);
  background: rgb(17 18 19 / 88%);
  color: var(--brand-text-primary);
}

.face-swap-primary-small {
  border: 1px solid var(--brand-primary);
  background: var(--brand-primary);
  color: #171817;
}

.face-swap-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  border: 2px solid rgb(255 255 255 / 10%);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: face-swap-spin 800ms linear infinite;
}

.face-swap-steps,
.face-swap-gallery {
  margin-top: 92px;
}

.face-swap-section-heading {
  margin-bottom: 30px;
  text-align: center;
}

.face-swap-section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.face-swap-section-heading p {
  max-width: 680px;
  margin: 12px auto 0;
  color: var(--face-swap-muted);
  font-size: 13px;
  line-height: 1.5;
}

.face-swap-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  margin: 0;
  padding: 0 34px;
  list-style: none;
}

.face-swap-steps li {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.face-swap-step-number {
  color: var(--brand-primary);
  font-size: 17px;
  line-height: 1;
}

.face-swap-steps h3 {
  margin: 13px 0 9px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
}

.face-swap-steps li > p {
  min-height: 42px;
  margin: 0;
  color: var(--face-swap-muted);
  font-size: 13px;
  line-height: 1.55;
}

.face-swap-step-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--face-swap-line);
  border-radius: 16px;
  background: var(--face-swap-field);
  box-shadow: 0 18px 38px rgb(0 0 0 / 20%);
}

.face-swap-step-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.face-swap-step-media.is-face {
  width: 90%;
  align-self: center;
  border-radius: 50%;
}

.face-swap-step-media-badge {
  position: absolute;
  right: 13px;
  bottom: 13px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  background: rgb(31 33 34 / 88%);
  box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
}

.face-swap-step-media-badge img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

.face-swap-step-media.is-result .face-swap-step-media-badge {
  border-color: var(--brand-primary);
}

.face-swap-step-result-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--brand-primary);
  box-shadow: 0 0 10px rgb(255 216 77 / 28%);
}

.face-swap-step-arrow {
  position: absolute;
  top: 64%;
  right: -38px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
}

.face-swap-step-arrow img {
  width: 18px;
  height: 18px;
  filter: brightness(0) saturate(100%) invert(82%) sepia(89%) saturate(653%) hue-rotate(330deg) brightness(107%) contrast(104%);
}

.face-swap-gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(3, 170px);
  gap: 14px;
}

.face-swap-example.upscale-compare-card {
  --upscale-line: var(--face-swap-line);
  height: auto;
  min-height: 0;
  border-radius: 14px;
}

.face-swap-example .upscale-compare-before {
  filter: none;
  transform: none;
}

.face-swap-example .upscale-compare-image {
  object-position: center;
}

.face-swap-example.is-left-tall .upscale-compare-image,
.face-swap-example.is-right-top .upscale-compare-image {
  object-position: center 30%;
}

.face-swap-example .upscale-compare-label {
  top: 10px;
  padding: 5px 9px;
  font-size: 10px;
}

.face-swap-example .upscale-compare-label.is-before {
  left: 10px;
}

.face-swap-example .upscale-compare-label.is-after {
  right: 10px;
}

.face-swap-example .upscale-compare-handle {
  width: 38px;
  height: 38px;
}

.face-swap-example.is-left-top {
  grid-column: 1 / 4;
  grid-row: 1;
}

.face-swap-example.is-left-tall {
  grid-column: 1 / 4;
  grid-row: 2 / 4;
}

.face-swap-example.is-center {
  grid-column: 4 / 10;
  grid-row: 1 / 3;
}

.face-swap-example.is-right-top {
  grid-column: 10 / 13;
  grid-row: 1;
}

.face-swap-example.is-right-middle {
  grid-column: 10 / 13;
  grid-row: 2;
}

.face-swap-example.is-bottom-wide {
  grid-column: 4 / 11;
  grid-row: 3;
}

@keyframes face-swap-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .face-swap-page {
    width: min(100% - 32px, 760px);
  }

  .face-swap-workstation {
    grid-template-columns: 1fr;
  }

  .face-swap-composer,
  .face-swap-output {
    min-height: 0;
  }

  .face-swap-output {
    height: min(720px, 84vw);
    min-height: 500px;
  }

  .face-swap-steps ol {
    gap: 32px;
    padding: 0;
  }

  .face-swap-step-arrow {
    right: -29px;
  }

  .face-swap-gallery-grid {
    grid-template-rows: repeat(3, 138px);
  }
}

@media (max-width: 820px) {
  .face-swap-page {
    width: min(100% - 20px, 620px);
  }

  .face-swap-steps ol {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .face-swap-steps li {
    width: min(100%, 390px);
    margin: 0 auto;
  }

  .face-swap-steps li > p {
    min-height: 0;
  }

  .face-swap-step-arrow {
    position: static;
    align-self: center;
    margin: 22px 0 -12px;
    transform: rotate(90deg);
  }

  .face-swap-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .face-swap-example.is-left-top,
  .face-swap-example.is-left-tall,
  .face-swap-example.is-center,
  .face-swap-example.is-right-top,
  .face-swap-example.is-right-middle,
  .face-swap-example.is-bottom-wide {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .face-swap-example.is-center,
  .face-swap-example.is-bottom-wide {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 480px) {
  .face-swap-hero-copy h1 {
    font-size: 38px;
  }

  .face-swap-hero-copy .face-swap-subtitle {
    font-size: 14px;
  }

  .face-swap-composer,
  .face-swap-output {
    border-radius: 14px;
  }

  .face-swap-composer {
    padding: 12px;
  }

  .face-swap-settings {
    grid-template-columns: 1fr;
  }

  .face-swap-settings small {
    min-height: 0;
  }

  .face-swap-output {
    padding: 0;
    height: 470px;
    min-height: 470px;
  }

  .face-swap-result.is-empty,
  .face-swap-result.is-processing,
  .face-swap-result.is-failed {
    padding: 22px 18px 104px;
  }

  .face-swap-result-hint {
    right: 9px;
    bottom: 9px;
    left: 9px;
    gap: 10px;
    padding: 12px;
    font-size: 10px;
  }

  .face-swap-result-actions {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .face-swap-steps,
  .face-swap-gallery {
    margin-top: 72px;
  }

  .face-swap-section-heading {
    margin-bottom: 24px;
  }

  .face-swap-gallery-grid {
    grid-template-columns: 1fr;
  }

  .face-swap-example.is-left-top,
  .face-swap-example.is-left-tall,
  .face-swap-example.is-center,
  .face-swap-example.is-right-top,
  .face-swap-example.is-right-middle,
  .face-swap-example.is-bottom-wide {
    grid-column: 1;
    aspect-ratio: 4 / 3;
  }

  .face-swap-example.is-left-tall,
  .face-swap-example.is-right-top {
    aspect-ratio: 4 / 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .face-swap-page *,
  .face-swap-page *::before,
  .face-swap-page *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .face-swap-spinner {
    animation: none;
  }
}
