.workflow-choice-migration {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 1120px;
  max-width: calc(100vw - 144px);

  button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 16px;
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(4, 7, 11, 0.78);
    color: #fff;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;

    &:hover,
    &:focus-visible {
      border-color: var(--accent-3);
      background: rgba(0, 0, 0, 0.92);
    }
  }

  span {
    max-width: 680px;
    color: #b8c2cb;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
  }

  .legacy-migration-workflow-status {
    max-width: 760px;
    padding: 9px 12px;
    border-left: 3px solid var(--accent-3);
    background: rgba(4, 7, 11, 0.72);
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
  }
}

.status-modal.legacy-migration-modal {
  place-items: stretch;
  padding: 12px;

  .status-modal-dialog {
    width: 100%;
    height: calc(100dvh - 24px);
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    margin: 0;
  }

  .status-modal-body {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
  }

  .status-modal-actions {
    flex-wrap: wrap;
    flex: 0 0 auto;
    padding-top: 12px;
    border-top: var(--border-width) solid var(--line-soft);
  }
}

.legacy-migration-body {
  gap: 14px;
  align-content: start;
  grid-auto-rows: max-content;
}

.legacy-migration-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;

  input {
    min-width: 0;
  }
}

.legacy-migration-status {
  padding: 10px 12px;
  border: var(--border-width) solid var(--line-soft);
  background: #000;
  color: #dce4ec;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: pre-line;
}

.legacy-migration-long-paths,
.legacy-official-migration-continuation,
.legacy-official-migration-cleanup {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: var(--border-width) solid rgba(247, 201, 72, 0.68);
  background: rgba(247, 201, 72, 0.08);

  &[hidden] {
    display: none;
  }

  strong {
    color: var(--accent-3);
  }

  span,
  small {
    color: #dce4ec;
    line-height: 1.4;
  }
}

.legacy-migration-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legacy-migration-progress {
  &[hidden] {
    display: none;
  }
}

.legacy-migration-progress-metrics {
  span {
    overflow-wrap: anywhere;
  }
}

.legacy-migration-progress-warning {
  padding: 10px 12px;
  border: var(--border-width) solid rgba(247, 201, 72, 0.58);
  background: rgba(247, 201, 72, 0.08);
  color: #f7d978;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

#legacyMigrationBusy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: wait;

  &[hidden] {
    display: none;
  }
}

.legacy-migration-summary {
  display: grid;
  gap: 12px;
}

.legacy-migration-summary[hidden] {
  display: none;
}

.legacy-migration-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px;
  border: var(--border-width) solid var(--line-soft);
  background: #000;

  span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
  }

  strong {
    color: #fff;
    font-size: 18px;
  }

  small {
    grid-column: 1 / -1;
    color: #aeb9c4;
    font-size: 13px;
    overflow-wrap: anywhere;
    user-select: text;
  }
}

.legacy-migration-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;

  > div {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 10px 12px;
    border: var(--border-width) solid var(--line-soft);
    background: #000;
  }

  span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
  }

  strong {
    color: #fff;
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
  }
}

.legacy-migration-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.legacy-migration-target {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border-color: var(--line-soft);
  background: #000;
  color: #fff;
  text-align: left;

  span {
    color: #aeb9c4;
    font-size: 13px;
    line-height: 1.4;
  }

  &.is-selected {
    border-color: var(--accent-3);
    background: rgba(247, 201, 72, 0.08);
  }
}

.legacy-migration-livery-review {
  display: grid;
  gap: 8px;

  &[hidden] {
    display: none;
  }

  > span {
    color: #aeb9c4;
    font-size: 13px;
  }
}

.legacy-migration-livery-rows {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.legacy-migration-livery-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 9px 10px;
  border: var(--border-width) solid var(--line-soft);
  background: #000;

  strong {
    color: #fff;
  }

  span,
  small {
    color: #aeb9c4;
    font-size: 12px;
  }

  small {
    grid-column: 1 / -1;
  }

  &[data-status="ready"] > span,
  &[data-status="converted"] > span,
  &[data-status="already_installed"] > span {
    color: #7ff0b2;
  }

  &[data-status="ready_with_feature_loss"] > span,
  &[data-status="blocked"] > span {
    color: #f7d978;
  }

  &[data-status="incomplete"] > span,
  &[data-status="failed"] > span {
    color: #ff8d8d;
  }
}

.legacy-official-migration-summary {
  color: #fff;
  font-weight: 700;
}

.legacy-official-migration-cleanup {
  margin-top: 4px;
  border-color: rgba(70, 216, 140, 0.68);
  background: rgba(70, 216, 140, 0.09);

  strong {
    color: #7ff0b2;
  }
}

.legacy-migration-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;

  > div {
    padding: 12px;
    border: var(--border-width) solid var(--line-soft);
    background: #000;
  }

  > div[hidden] {
    display: none;
  }

  strong {
    color: #fff;
    font-size: 15px;
  }

  ul {
    margin: 8px 0 0;
    padding-left: 20px;
    color: #b8c2cb;
    font-size: 14px;
    line-height: 1.45;
  }
}

.legacy-migration-policy-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: var(--border-width) solid rgba(247, 201, 72, 0.58);
  background: rgba(247, 201, 72, 0.08);

  strong {
    color: var(--accent-3);
    font-size: 15px;
  }

  span {
    color: #dce4ec;
    font-size: 14px;
    line-height: 1.4;
  }
}

.legacy-migration-completion {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: var(--border-width) solid rgba(70, 216, 140, 0.68);
  background: rgba(70, 216, 140, 0.09);

  &[hidden] {
    display: none;
  }

  strong {
    color: #7ff0b2;
    font-size: 16px;
  }

  span {
    color: #dce4ec;
    font-size: 14px;
    line-height: 1.45;
  }
}

.legacy-migration-modal[data-migration-complete="true"] {
  #legacyMigrationCloseX {
    display: none;
  }
}

.legacy-migration-modal[data-migration-running="true"] {
  .legacy-migration-path-row,
  #legacyMigrationCloseX {
    display: none;
  }
}
